aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/YoutubeDL.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2020-11-05 23:13:21 +0530
committerpukkandan <pukkandan@gmail.com>2020-12-13 20:05:04 +0530
commit2d30509fc893f58cac77c25134a246ed9d76e7ed (patch)
treef5a915077cc6f5dc7abf42554cf6bfadda4203ee /youtube_dlc/YoutubeDL.py
parent732044afb2e8ffbaa37fe91310906ff549edd6ad (diff)
downloadhypervideo-pre-2d30509fc893f58cac77c25134a246ed9d76e7ed.tar.lz
hypervideo-pre-2d30509fc893f58cac77c25134a246ed9d76e7ed.tar.xz
hypervideo-pre-2d30509fc893f58cac77c25134a246ed9d76e7ed.zip
Add --force-download-archive by by h-h-h-h
Authored-by: h-h-h-h
Diffstat (limited to 'youtube_dlc/YoutubeDL.py')
-rw-r--r--youtube_dlc/YoutubeDL.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/youtube_dlc/YoutubeDL.py b/youtube_dlc/YoutubeDL.py
index 97e4f451f..8fe608fc9 100644
--- a/youtube_dlc/YoutubeDL.py
+++ b/youtube_dlc/YoutubeDL.py
@@ -166,6 +166,8 @@ class YoutubeDL(object):
forcejson: Force printing info_dict as JSON.
dump_single_json: Force printing the info_dict of the whole playlist
(or video) as a single JSON line.
+ force_write_download_archive: Force writing download archive regardless of
+ 'skip_download' or 'simulate'.
simulate: Do not download the video files.
format: Video format code. see "FORMAT SELECTION" for more details.
format_sort: How to sort the video formats. see "Sorting Formats" for more details.
@@ -1856,8 +1858,11 @@ class YoutubeDL(object):
# Forced printings
self.__forced_printings(info_dict, filename, incomplete=False)
- # Do nothing else if in simulate mode
if self.params.get('simulate', False):
+ if self.params.get('force_write_download_archive', False):
+ self.record_download_archive(info_dict)
+
+ # Do nothing else if in simulate mode
return
if filename is None:
@@ -2188,7 +2193,10 @@ class YoutubeDL(object):
except (PostProcessingError) as err:
self.report_error('postprocessing: %s' % str(err))
return
- self.record_download_archive(info_dict)
+ must_record_download_archive = True
+
+ if must_record_download_archive or self.params.get('force_write_download_archive', False):
+ self.record_download_archive(info_dict)
def download(self, url_list):
"""Download a given list of URLs."""