mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-14 23:32:33 +00:00
Pre-check video IDs in the archive before downloading
This commit is contained in:
parent
d052b9a112
commit
9a68de1217
1 changed files with 11 additions and 1 deletions
|
@ -821,12 +821,22 @@ class YoutubeDL(object):
|
||||||
if not ie.suitable(url):
|
if not ie.suitable(url):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
ie = self.get_info_extractor(ie.ie_key())
|
ie_key = ie.ie_key()
|
||||||
|
ie = self.get_info_extractor(ie_key)
|
||||||
if not ie.working():
|
if not ie.working():
|
||||||
self.report_warning('The program functionality for this site has been marked as broken, '
|
self.report_warning('The program functionality for this site has been marked as broken, '
|
||||||
'and will probably not work.')
|
'and will probably not work.')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
try:
|
||||||
|
temp_id = ie.extract_id(url) if callable(getattr(ie, 'extract_id', None)) else ie._match_id(url)
|
||||||
|
except AssertionError:
|
||||||
|
temp_id = None
|
||||||
|
if temp_id is not None and self.in_download_archive({'id': temp_id, 'ie_key': ie_key}):
|
||||||
|
self.to_screen("[download] [%s] %s has already been recorded in archive" % (
|
||||||
|
ie_key, temp_id))
|
||||||
|
break
|
||||||
|
|
||||||
ie_result = ie.extract(url)
|
ie_result = ie.extract(url)
|
||||||
if ie_result is None: # Finished already (backwards compatibility; listformats and friends should be moved here)
|
if ie_result is None: # Finished already (backwards compatibility; listformats and friends should be moved here)
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue