aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/YoutubeDL.py
diff options
context:
space:
mode:
authorTom-Oliver Heidel <github@tom-oliver.eu>2020-11-16 23:00:44 +0100
committerGitHub <noreply@github.com>2020-11-16 23:00:44 +0100
commit228385340e9a976f52735078218a9b8ecfe7ae7a (patch)
tree6a4575d3198699653d8a9c78d5207e40fe2de431 /youtube_dlc/YoutubeDL.py
parent63dcccd07cfa1016ffb0531ebdc4ca2a1bc72793 (diff)
parentea6e0c2b0d3e83f2f8a7766e07a57a2b5495afcc (diff)
downloadhypervideo-pre-228385340e9a976f52735078218a9b8ecfe7ae7a.tar.lz
hypervideo-pre-228385340e9a976f52735078218a9b8ecfe7ae7a.tar.xz
hypervideo-pre-228385340e9a976f52735078218a9b8ecfe7ae7a.zip
Merge pull request #187 from pukkandan/break-on-existing
Stop download after encountering video in archive
Diffstat (limited to 'youtube_dlc/YoutubeDL.py')
-rw-r--r--youtube_dlc/YoutubeDL.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/youtube_dlc/YoutubeDL.py b/youtube_dlc/YoutubeDL.py
index c85cbd88f..bf02192eb 100644
--- a/youtube_dlc/YoutubeDL.py
+++ b/youtube_dlc/YoutubeDL.py
@@ -210,6 +210,8 @@ class YoutubeDL(object):
download_archive: File name of a file where all downloads are recorded.
Videos already present in the file are not downloaded
again.
+ break_on_existing: Stop the download process after attempting to download a file that's
+ in the archive.
cookiefile: File name where cookies should be read from and dumped to.
nocheckcertificate:Do not verify SSL certificates
prefer_insecure: Use HTTP instead of HTTPS to retrieve information.
@@ -1048,8 +1050,12 @@ class YoutubeDL(object):
reason = self._match_entry(entry, incomplete=True)
if reason is not None:
- self.to_screen('[download] ' + reason)
- continue
+ if reason.endswith('has already been recorded in the archive') and self.params.get('break_on_existing'):
+ print('[download] tried downloading a file that\'s already in the archive, stopping since --break-on-existing is set.')
+ break
+ else:
+ self.to_screen('[download] ' + reason)
+ continue
entry_result = self.process_ie_result(entry,
download=download,