fix
This commit is contained in:
parent
e0d686f227
commit
abe5971f8c
1 changed files with 29 additions and 32 deletions
|
|
@ -217,10 +217,9 @@ class DownloadQueue:
|
||||||
else:
|
else:
|
||||||
already.add(url)
|
already.add(url)
|
||||||
try:
|
try:
|
||||||
with ThreadPoolExecutor(thread_name_prefix='extract_info') as pool:
|
|
||||||
LOG.debug(f'extracting info from {url=}')
|
LOG.debug(f'extracting info from {url=}')
|
||||||
entry = await asyncio.get_running_loop().run_in_executor(
|
entry = await asyncio.get_running_loop().run_in_executor(
|
||||||
pool,
|
None,
|
||||||
ExtractInfo,
|
ExtractInfo,
|
||||||
mergeConfig(self.config.ytdl_options, ytdlp_config),
|
mergeConfig(self.config.ytdl_options, ytdlp_config),
|
||||||
url,
|
url,
|
||||||
|
|
@ -236,7 +235,7 @@ class DownloadQueue:
|
||||||
|
|
||||||
LOG.debug(f'No metadata, Rechecking with archive disabled. {url=}')
|
LOG.debug(f'No metadata, Rechecking with archive disabled. {url=}')
|
||||||
entry = await asyncio.get_running_loop().run_in_executor(
|
entry = await asyncio.get_running_loop().run_in_executor(
|
||||||
pool,
|
None,
|
||||||
ExtractInfo,
|
ExtractInfo,
|
||||||
mergeConfig(self.config.ytdl_options, ytdlp_config),
|
mergeConfig(self.config.ytdl_options, ytdlp_config),
|
||||||
url,
|
url,
|
||||||
|
|
@ -257,7 +256,7 @@ class DownloadQueue:
|
||||||
if self.isDownloaded(entry):
|
if self.isDownloaded(entry):
|
||||||
raise yt_dlp.utils.ExistingVideoReached()
|
raise yt_dlp.utils.ExistingVideoReached()
|
||||||
|
|
||||||
LOG.debug(f'extract_info length: {len(entry)}')
|
LOG.debug(f'extract_info for [{url=}] length: {len(entry)}')
|
||||||
except yt_dlp.utils.ExistingVideoReached:
|
except yt_dlp.utils.ExistingVideoReached:
|
||||||
return {'status': 'error', 'msg': 'Video has been downloaded already and recorded in archive.log file.'}
|
return {'status': 'error', 'msg': 'Video has been downloaded already and recorded in archive.log file.'}
|
||||||
except yt_dlp.utils.YoutubeDLError as exc:
|
except yt_dlp.utils.YoutubeDLError as exc:
|
||||||
|
|
@ -348,10 +347,8 @@ class DownloadQueue:
|
||||||
LOG.info(f'Waiting for worker to be free.')
|
LOG.info(f'Waiting for worker to be free.')
|
||||||
await asyncio.sleep(1)
|
await asyncio.sleep(1)
|
||||||
|
|
||||||
LOG.debug(f"Has '{executor.get_available_workers()}' free workers.")
|
|
||||||
|
|
||||||
while not self.queue.hasDownloads():
|
while not self.queue.hasDownloads():
|
||||||
LOG.info('Waiting for item to download.')
|
LOG.info(f"Waiting for item to download. '{executor.get_available_workers()}' free workers.")
|
||||||
await self.event.wait()
|
await self.event.wait()
|
||||||
self.event.clear()
|
self.event.clear()
|
||||||
LOG.debug(f"Cleared wait event.")
|
LOG.debug(f"Cleared wait event.")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue