aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/YoutubeDL.py
diff options
context:
space:
mode:
authorTom-Oliver Heidel <github@tom-oliver.eu>2020-11-16 22:59:24 +0100
committerGitHub <noreply@github.com>2020-11-16 22:59:24 +0100
commit63dcccd07cfa1016ffb0531ebdc4ca2a1bc72793 (patch)
tree110e02e2fb8512e3d6077070fddcfff26e05b4c8 /youtube_dlc/YoutubeDL.py
parentd052b9a112fb7ae749a829dceba6e3289663a303 (diff)
parentfe5caa2a7c0bb6f17c6833b540691b4df4cbde90 (diff)
downloadhypervideo-pre-63dcccd07cfa1016ffb0531ebdc4ca2a1bc72793.tar.lz
hypervideo-pre-63dcccd07cfa1016ffb0531ebdc4ca2a1bc72793.tar.xz
hypervideo-pre-63dcccd07cfa1016ffb0531ebdc4ca2a1bc72793.zip
Merge pull request #181 from pukkandan/precheck-archive
Check IDs in the archive before downloading webpage
Diffstat (limited to 'youtube_dlc/YoutubeDL.py')
-rw-r--r--youtube_dlc/YoutubeDL.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/youtube_dlc/YoutubeDL.py b/youtube_dlc/YoutubeDL.py
index dd55ba0f2..c85cbd88f 100644
--- a/youtube_dlc/YoutubeDL.py
+++ b/youtube_dlc/YoutubeDL.py
@@ -821,12 +821,22 @@ class YoutubeDL(object):
if not ie.suitable(url):
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():
self.report_warning('The program functionality for this site has been marked as broken, '
'and will probably not work.')
try:
+ try:
+ temp_id = ie.extract_id(url) if callable(getattr(ie, 'extract_id', None)) else ie._match_id(url)
+ except (AssertionError, IndexError):
+ temp_id = None
+ if temp_id is not None and self.in_download_archive({'id': temp_id, 'ie_key': ie_key}):
+ self.to_screen("[%s] %s: has already been recorded in archive" % (
+ ie_key, temp_id))
+ break
+
ie_result = ie.extract(url)
if ie_result is None: # Finished already (backwards compatibility; listformats and friends should be moved here)
break