From feea256aa59f794b65eeb82c3a16ecf72a0c761f Mon Sep 17 00:00:00 2001 From: Cyberes Date: Mon, 6 Feb 2023 23:07:20 -0700 Subject: [PATCH] forgot to re-add the url --- downloader.py | 3 ++- process/threads.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/downloader.py b/downloader.py index a72fee7..f454600 100755 --- a/downloader.py +++ b/downloader.py @@ -52,7 +52,8 @@ parser.add_argument('--download-cache-file-directory', default=user_data_dir('au parser.add_argument('--silence-errors', '-s', action='store_true', help="Don't print any error messages to the console.") parser.add_argument('--ignore-downloaded', '-i', action='store_true', help='Ignore videos that have been already downloaded and let youtube-dl handle everything.') parser.add_argument('--erase-downloaded-tracker', '-e', action='store_true', help='Erase the tracked video file.') -parser.add_argument('--ratelimit-sleep', type=int, default=5, help='How many seconds to sleep to prevent rate-limiting.') +parser.add_argument('--ratelimit-sleep', type=int, default=5, + help='How many seconds to sleep between items to prevent rate-limiting. Does not affect time between videos as you should be fine since it takes a few seconds to merge everything and clean up.') parser.add_argument('--input-datatype', choices=['auto', 'txt', 'yaml'], default='auto', help='The datatype of the input file. If set to auto, the file will be scanned for a URL on the firstline.' 'If is a URL, the filetype will be set to txt. If it is a key: value pair then the filetype will be set to yaml.') parser.add_argument('--log-dir', default=None, help='Where to store the logs. Must be set when --output is not.') diff --git a/process/threads.py b/process/threads.py index 12eb903..91eef37 100644 --- a/process/threads.py +++ b/process/threads.py @@ -92,7 +92,10 @@ def download_video(args) -> dict: try: kwargs['ydl_opts']['logger'] = ytdl_logger() # dummy silent logger yt_dlp = ydl.YDL(kwargs['ydl_opts']) + url = video['url'] video = yt_dlp.sanitize_info(yt_dlp.extract_info(video['url'], download=False)) + video['url'] = url + del url try: base_path = os.path.splitext(yt_dlp.prepare_filename(video))[0] except AttributeError: