Skip to content

Commit

Permalink
Fix downloader _should_retry criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
AliOsm committed Jun 29, 2024
1 parent 51dbb91 commit bf2d47d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tafrigh/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def _initialize_youtube_dl_without_archive(self) -> None:
def _should_retry(self, url_data: dict[str, Any]) -> bool:
if '_type' in url_data and url_data['_type'] == 'playlist':
for entry in url_data['entries']:
if entry and not os.path.exists(os.path.join(self.output_dir, f"{entry['id']}.{entry['ext']}")):
if entry and not os.path.exists(os.path.join(self.output_dir, f"{entry['id']}.mp3")):
return True
else:
if not os.path.exists(os.path.join(self.output_dir, f"{url_data['id']}.{url_data['ext']}")):
if not os.path.exists(os.path.join(self.output_dir, f"{url_data['id']}.mp3")):
return True

return False
Expand Down

0 comments on commit bf2d47d

Please sign in to comment.