]>
Commit | Line | Data |
---|---|---|
cc52de43 | 1 | #!/usr/bin/env python3 |
dcdb292f | 2 | # coding: utf-8 |
235b3ba4 | 3 | |
347182a0 | 4 | f'You are using an unsupported version of Python. Only Python versions 3.6 and above are supported by yt-dlp' # noqa: F541 |
a4bc4336 | 5 | |
235b3ba4 | 6 | __license__ = 'Public Domain' |
235b3ba4 | 7 | |
0d94f247 | 8 | import codecs |
8f563f32 | 9 | import io |
e9f4ccd1 | 10 | import itertools |
235b3ba4 | 11 | import os |
0f818663 | 12 | import random |
43820c03 | 13 | import re |
235b3ba4 | 14 | import sys |
235b3ba4 | 15 | |
2daabe49 PH |
16 | from .options import ( |
17 | parseOpts, | |
18 | ) | |
8c25f81b | 19 | from .compat import ( |
e68301af | 20 | compat_getpass, |
e9f4ccd1 | 21 | compat_shlex_quote, |
e07e9313 | 22 | workaround_optparse_bug9161, |
8c25f81b | 23 | ) |
982ee69a | 24 | from .cookies import SUPPORTED_BROWSERS |
8c25f81b | 25 | from .utils import ( |
a4fd0415 PH |
26 | DateRange, |
27 | decodeOption, | |
a4fd0415 | 28 | DownloadError, |
76a264ac | 29 | error_to_compat_str, |
8b0d7497 | 30 | ExistingVideoReached, |
590bc6f6 | 31 | expand_path, |
347de493 | 32 | match_filter_func, |
a4fd0415 | 33 | MaxDownloadsReached, |
a4fd0415 | 34 | preferredencoding, |
62e609ab | 35 | read_batch_urls, |
8b0d7497 | 36 | RejectedVideoReached, |
df692c5a | 37 | render_table, |
a4fd0415 | 38 | SameFileError, |
e3946f98 | 39 | setproctitle, |
a4fd0415 PH |
40 | std_headers, |
41 | write_string, | |
a4fd0415 | 42 | ) |
c19bc311 | 43 | from .update import run_update |
92a86f4c | 44 | from .downloader import ( |
a4fd0415 PH |
45 | FileDownloader, |
46 | ) | |
2bad0e5d | 47 | from .extractor import gen_extractors, list_extractors |
eb8a4433 | 48 | from .extractor.common import InfoExtractor |
1b6712ab | 49 | from .extractor.adobepass import MSO_INFO |
e9f4ccd1 | 50 | from .postprocessor import ( |
81a23040 | 51 | FFmpegExtractAudioPP, |
52 | FFmpegSubtitlesConvertorPP, | |
53 | FFmpegThumbnailsConvertorPP, | |
54 | FFmpegVideoConvertorPP, | |
55 | FFmpegVideoRemuxerPP, | |
e9f4ccd1 | 56 | MetadataFromFieldPP, |
57 | MetadataParserPP, | |
81a23040 | 58 | ) |
8222d8de | 59 | from .YoutubeDL import YoutubeDL |
a4fd0415 | 60 | |
235b3ba4 | 61 | |
b8ad4f02 | 62 | def _real_main(argv=None): |
0d94f247 PH |
63 | # Compatibility fixes for Windows |
64 | if sys.platform == 'win32': | |
067aa17e | 65 | # https://github.com/ytdl-org/youtube-dl/issues/820 |
0d94f247 PH |
66 | codecs.register(lambda name: codecs.lookup('utf-8') if name == 'cp65001' else None) |
67 | ||
e07e9313 PH |
68 | workaround_optparse_bug9161() |
69 | ||
7a5c1cfe | 70 | setproctitle('yt-dlp') |
e3946f98 | 71 | |
b8ad4f02 | 72 | parser, opts, args = parseOpts(argv) |
0d1bb027 | 73 | warnings = [] |
59ae15a5 | 74 | |
59ae15a5 PH |
75 | # Set user agent |
76 | if opts.user_agent is not None: | |
77 | std_headers['User-Agent'] = opts.user_agent | |
1865ed31 | 78 | |
28535652 BH |
79 | # Set referer |
80 | if opts.referer is not None: | |
81 | std_headers['Referer'] = opts.referer | |
59ae15a5 | 82 | |
410afb20 | 83 | # Custom HTTP headers |
45016689 | 84 | std_headers.update(opts.headers) |
410afb20 | 85 | |
59ae15a5 PH |
86 | # Dump user agent |
87 | if opts.dump_user_agent: | |
7b0d1c28 | 88 | write_string(std_headers['User-Agent'] + '\n', out=sys.stdout) |
59ae15a5 PH |
89 | sys.exit(0) |
90 | ||
91 | # Batch file verification | |
62e609ab | 92 | batch_urls = [] |
59ae15a5 PH |
93 | if opts.batchfile is not None: |
94 | try: | |
95 | if opts.batchfile == '-': | |
96 | batchfd = sys.stdin | |
97 | else: | |
e2eca6f6 | 98 | batchfd = io.open( |
590bc6f6 | 99 | expand_path(opts.batchfile), |
e2eca6f6 | 100 | 'r', encoding='utf-8', errors='ignore') |
62e609ab | 101 | batch_urls = read_batch_urls(batchfd) |
05afc96b | 102 | if opts.verbose: |
a4bc4336 | 103 | write_string('[debug] Batch file urls: ' + repr(batch_urls) + '\n') |
59ae15a5 | 104 | except IOError: |
826dcff9 | 105 | sys.exit('ERROR: batch file %s could not be read' % opts.batchfile) |
b2fc1c4f | 106 | all_urls = batch_urls + [url.strip() for url in args] # batch_urls are already striped in read_batch_urls |
c774b3c6 | 107 | _enc = preferredencoding() |
41292a38 | 108 | all_urls = [url.decode(_enc, 'ignore') if isinstance(url, bytes) else url for url in all_urls] |
59ae15a5 | 109 | |
59ae15a5 | 110 | if opts.list_extractors: |
05900629 | 111 | for ie in list_extractors(opts.age_limit): |
251ae04e | 112 | write_string(ie.IE_NAME + (' (CURRENTLY BROKEN)' if not ie.working() else '') + '\n', out=sys.stdout) |
1a2c3c0f | 113 | matchedUrls = [url for url in all_urls if ie.suitable(url)] |
59ae15a5 | 114 | for mu in matchedUrls: |
7b0d1c28 | 115 | write_string(' ' + mu + '\n', out=sys.stdout) |
59ae15a5 | 116 | sys.exit(0) |
0f818663 | 117 | if opts.list_extractor_descriptions: |
05900629 | 118 | for ie in list_extractors(opts.age_limit): |
251ae04e | 119 | if not ie.working(): |
0f818663 PH |
120 | continue |
121 | desc = getattr(ie, 'IE_DESC', ie.IE_NAME) | |
15870e90 PH |
122 | if desc is False: |
123 | continue | |
0f818663 | 124 | if hasattr(ie, 'SEARCH_KEY'): |
50a0f6df | 125 | _SEARCHES = ('cute kittens', 'slithering pythons', 'falling cat', 'angry poodle', 'purple fish', 'running tortoise', 'sleeping bunny', 'burping cow') |
a4bc4336 PH |
126 | _COUNTS = ('', '5', '10', 'all') |
127 | desc += ' (Example: "%s%s:%s" )' % (ie.SEARCH_KEY, random.choice(_COUNTS), random.choice(_SEARCHES)) | |
7b0d1c28 | 128 | write_string(desc + '\n', out=sys.stdout) |
0f818663 | 129 | sys.exit(0) |
87148bb7 | 130 | if opts.ap_list_mso: |
1b6712ab | 131 | table = [[mso_id, mso_info['name']] for mso_id, mso_info in MSO_INFO.items()] |
797c636b | 132 | write_string('Supported TV Providers:\n' + render_table(['mso', 'mso name'], table) + '\n', out=sys.stdout) |
1b6712ab | 133 | sys.exit(0) |
0f818663 | 134 | |
59ae15a5 PH |
135 | # Conflicting, missing and erroneous options |
136 | if opts.usenetrc and (opts.username is not None or opts.password is not None): | |
a4bc4336 | 137 | parser.error('using .netrc conflicts with giving username/password') |
59ae15a5 | 138 | if opts.password is not None and opts.username is None: |
a4bc4336 | 139 | parser.error('account username missing\n') |
1b6712ab RA |
140 | if opts.ap_password is not None and opts.ap_username is None: |
141 | parser.error('TV Provider account username missing\n') | |
1a241a2d S |
142 | if opts.autonumber_size is not None: |
143 | if opts.autonumber_size <= 0: | |
144 | parser.error('auto number size must be positive') | |
145 | if opts.autonumber_start is not None: | |
146 | if opts.autonumber_start < 0: | |
147 | parser.error('auto number start must be positive or 0') | |
59ae15a5 | 148 | if opts.username is not None and opts.password is None: |
a4bc4336 | 149 | opts.password = compat_getpass('Type account password and press [Return]: ') |
1b6712ab RA |
150 | if opts.ap_username is not None and opts.ap_password is None: |
151 | opts.ap_password = compat_getpass('Type TV provider account password and press [Return]: ') | |
59ae15a5 PH |
152 | if opts.ratelimit is not None: |
153 | numeric_limit = FileDownloader.parse_bytes(opts.ratelimit) | |
154 | if numeric_limit is None: | |
a4bc4336 | 155 | parser.error('invalid rate limit specified') |
59ae15a5 | 156 | opts.ratelimit = numeric_limit |
51d9739f | 157 | if opts.throttledratelimit is not None: |
158 | numeric_limit = FileDownloader.parse_bytes(opts.throttledratelimit) | |
159 | if numeric_limit is None: | |
160 | parser.error('invalid rate limit specified') | |
161 | opts.throttledratelimit = numeric_limit | |
9e982f9e JC |
162 | if opts.min_filesize is not None: |
163 | numeric_limit = FileDownloader.parse_bytes(opts.min_filesize) | |
164 | if numeric_limit is None: | |
a4bc4336 | 165 | parser.error('invalid min_filesize specified') |
9e982f9e JC |
166 | opts.min_filesize = numeric_limit |
167 | if opts.max_filesize is not None: | |
168 | numeric_limit = FileDownloader.parse_bytes(opts.max_filesize) | |
169 | if numeric_limit is None: | |
a4bc4336 | 170 | parser.error('invalid max_filesize specified') |
9e982f9e | 171 | opts.max_filesize = numeric_limit |
065bc354 | 172 | if opts.sleep_interval is not None: |
173 | if opts.sleep_interval < 0: | |
1ad6b891 S |
174 | parser.error('sleep interval must be positive or 0') |
175 | if opts.max_sleep_interval is not None: | |
176 | if opts.max_sleep_interval < 0: | |
177 | parser.error('max sleep interval must be positive or 0') | |
050afa60 JZ |
178 | if opts.sleep_interval is None: |
179 | parser.error('min sleep interval must be specified, use --min-sleep-interval') | |
1ad6b891 S |
180 | if opts.max_sleep_interval < opts.sleep_interval: |
181 | parser.error('max sleep interval must be greater than or equal to min sleep interval') | |
182 | else: | |
183 | opts.max_sleep_interval = opts.sleep_interval | |
1cf376f5 | 184 | if opts.sleep_interval_subtitles is not None: |
185 | if opts.sleep_interval_subtitles < 0: | |
186 | parser.error('subtitles sleep interval must be positive or 0') | |
187 | if opts.sleep_interval_requests is not None: | |
188 | if opts.sleep_interval_requests < 0: | |
189 | parser.error('requests sleep interval must be positive or 0') | |
797c636b | 190 | if opts.ap_mso and opts.ap_mso not in MSO_INFO: |
87148bb7 | 191 | parser.error('Unsupported TV Provider, use --ap-list-mso to get a list of supported TV Providers') |
486fb179 | 192 | if opts.overwrites: # --yes-overwrites implies --no-continue |
0c3d0f51 | 193 | opts.continue_dl = False |
4cf1e5d2 | 194 | if opts.concurrent_fragment_downloads <= 0: |
195 | raise ValueError('Concurrent fragments must be positive') | |
52bb437e | 196 | |
62bff2c1 | 197 | def parse_retries(retries, name=''): |
52bb437e S |
198 | if retries in ('inf', 'infinite'): |
199 | parsed_retries = float('inf') | |
baeaeffc PH |
200 | else: |
201 | try: | |
52bb437e | 202 | parsed_retries = int(retries) |
baeaeffc | 203 | except (TypeError, ValueError): |
62bff2c1 | 204 | parser.error('invalid %sretry count specified' % name) |
52bb437e S |
205 | return parsed_retries |
206 | if opts.retries is not None: | |
207 | opts.retries = parse_retries(opts.retries) | |
208 | if opts.fragment_retries is not None: | |
62bff2c1 | 209 | opts.fragment_retries = parse_retries(opts.fragment_retries, 'fragment ') |
210 | if opts.extractor_retries is not None: | |
211 | opts.extractor_retries = parse_retries(opts.extractor_retries, 'extractor ') | |
59ae15a5 PH |
212 | if opts.buffersize is not None: |
213 | numeric_buffersize = FileDownloader.parse_bytes(opts.buffersize) | |
214 | if numeric_buffersize is None: | |
a4bc4336 | 215 | parser.error('invalid buffer size specified') |
59ae15a5 | 216 | opts.buffersize = numeric_buffersize |
ba515388 S |
217 | if opts.http_chunk_size is not None: |
218 | numeric_chunksize = FileDownloader.parse_bytes(opts.http_chunk_size) | |
219 | if not numeric_chunksize: | |
220 | parser.error('invalid http chunk size specified') | |
221 | opts.http_chunk_size = numeric_chunksize | |
a19fd00c | 222 | if opts.playliststart <= 0: |
a4bc4336 | 223 | raise ValueError('Playlist start must be positive') |
a19fd00c | 224 | if opts.playlistend not in (-1, None) and opts.playlistend < opts.playliststart: |
a4bc4336 | 225 | raise ValueError('Playlist end must be greater than playlist start') |
59ae15a5 | 226 | if opts.extractaudio: |
81a23040 | 227 | if opts.audioformat not in ['best'] + list(FFmpegExtractAudioPP.SUPPORTED_EXTS): |
a4bc4336 | 228 | parser.error('invalid audio format specified') |
59ae15a5 PH |
229 | if opts.audioquality: |
230 | opts.audioquality = opts.audioquality.strip('k').strip('K') | |
231 | if not opts.audioquality.isdigit(): | |
a4bc4336 | 232 | parser.error('invalid audio quality specified') |
7851b379 | 233 | if opts.recodevideo is not None: |
81a23040 | 234 | opts.recodevideo = opts.recodevideo.replace(' ', '') |
235 | if not re.match(FFmpegVideoConvertorPP.FORMAT_RE, opts.recodevideo): | |
236 | parser.error('invalid video remux format specified') | |
17912249 | 237 | if opts.remuxvideo is not None: |
df692c5a | 238 | opts.remuxvideo = opts.remuxvideo.replace(' ', '') |
81a23040 | 239 | if not re.match(FFmpegVideoRemuxerPP.FORMAT_RE, opts.remuxvideo): |
17912249 | 240 | parser.error('invalid video remux format specified') |
e9fade72 | 241 | if opts.convertsubtitles is not None: |
81a23040 | 242 | if opts.convertsubtitles not in FFmpegSubtitlesConvertorPP.SUPPORTED_EXTS: |
e9fade72 | 243 | parser.error('invalid subtitle format specified') |
8fa43c73 | 244 | if opts.convertthumbnails is not None: |
81a23040 | 245 | if opts.convertthumbnails not in FFmpegThumbnailsConvertorPP.SUPPORTED_EXTS: |
8fa43c73 | 246 | parser.error('invalid thumbnail format specified') |
bd1a281e | 247 | |
982ee69a MB |
248 | if opts.cookiesfrombrowser is not None: |
249 | opts.cookiesfrombrowser = [ | |
250 | part.strip() or None for part in opts.cookiesfrombrowser.split(':', 1)] | |
ca46b941 | 251 | if opts.cookiesfrombrowser[0].lower() not in SUPPORTED_BROWSERS: |
982ee69a MB |
252 | parser.error('unsupported browser specified for cookies') |
253 | ||
bd558525 JMF |
254 | if opts.date is not None: |
255 | date = DateRange.day(opts.date) | |
256 | else: | |
257 | date = DateRange(opts.dateafter, opts.datebefore) | |
59ae15a5 | 258 | |
31654882 | 259 | compat_opts = opts.compat_opts |
53ed7066 | 260 | |
261 | def _unused_compat_opt(name): | |
262 | if name not in compat_opts: | |
263 | return False | |
264 | compat_opts.discard(name) | |
265 | compat_opts.update(['*%s' % name]) | |
266 | return True | |
267 | ||
e4f02757 | 268 | def set_default_compat(compat_name, opt_name, default=True, remove_compat=True): |
53ed7066 | 269 | attr = getattr(opts, opt_name) |
270 | if compat_name in compat_opts: | |
271 | if attr is None: | |
272 | setattr(opts, opt_name, not default) | |
273 | return True | |
274 | else: | |
275 | if remove_compat: | |
276 | _unused_compat_opt(compat_name) | |
277 | return False | |
278 | elif attr is None: | |
279 | setattr(opts, opt_name, default) | |
280 | return None | |
281 | ||
282 | set_default_compat('abort-on-error', 'ignoreerrors') | |
283 | set_default_compat('no-playlist-metafiles', 'allow_playlist_files') | |
e4f02757 | 284 | set_default_compat('no-clean-infojson', 'clean_infojson') |
53ed7066 | 285 | if 'format-sort' in compat_opts: |
286 | opts.format_sort.extend(InfoExtractor.FormatSort.ytdl_default) | |
287 | _video_multistreams_set = set_default_compat('multistreams', 'allow_multiple_video_streams', False, remove_compat=False) | |
288 | _audio_multistreams_set = set_default_compat('multistreams', 'allow_multiple_audio_streams', False, remove_compat=False) | |
289 | if _video_multistreams_set is False and _audio_multistreams_set is False: | |
290 | _unused_compat_opt('multistreams') | |
291 | outtmpl_default = opts.outtmpl.get('default') | |
292 | if 'filename' in compat_opts: | |
293 | if outtmpl_default is None: | |
9d65e7bd | 294 | outtmpl_default = '%(title)s-%(id)s.%(ext)s' |
53ed7066 | 295 | opts.outtmpl.update({'default': outtmpl_default}) |
296 | else: | |
297 | _unused_compat_opt('filename') | |
298 | ||
76a264ac | 299 | def validate_outtmpl(tmpl, msg): |
300 | err = YoutubeDL.validate_outtmpl(tmpl) | |
301 | if err: | |
302 | parser.error('invalid %s %r: %s' % (msg, tmpl, error_to_compat_str(err))) | |
303 | ||
304 | for k, tmpl in opts.outtmpl.items(): | |
305 | validate_outtmpl(tmpl, '%s output template' % k) | |
ad3dc496 | 306 | opts.forceprint = opts.forceprint or [] |
307 | for tmpl in opts.forceprint or []: | |
76a264ac | 308 | validate_outtmpl(tmpl, 'print template') |
7a340e0d | 309 | validate_outtmpl(opts.sponsorblock_chapter_title, 'SponsorBlock chapter title') |
76a264ac | 310 | |
de3ef3ed PH |
311 | if opts.extractaudio and not opts.keepvideo and opts.format is None: |
312 | opts.format = 'bestaudio/best' | |
313 | ||
de6000d9 | 314 | if outtmpl_default is not None and not os.path.splitext(outtmpl_default)[1] and opts.extractaudio: |
a4bc4336 PH |
315 | parser.error('Cannot download a video and extract audio into the same' |
316 | ' file! Use "{0}.%(ext)s" instead of "{0}" as the output' | |
de6000d9 | 317 | ' template'.format(outtmpl_default)) |
0202b52a | 318 | |
eb8a4433 | 319 | for f in opts.format_sort: |
320 | if re.match(InfoExtractor.FormatSort.regex, f) is None: | |
321 | parser.error('invalid format sort string "%s" specified' % f) | |
29c7a63d | 322 | |
e9f4ccd1 | 323 | def metadataparser_actions(f): |
324 | if isinstance(f, str): | |
325 | cmd = '--parse-metadata %s' % compat_shlex_quote(f) | |
326 | try: | |
327 | actions = [MetadataFromFieldPP.to_action(f)] | |
328 | except Exception as err: | |
329 | parser.error(f'{cmd} is invalid; {err}') | |
330 | else: | |
331 | cmd = '--replace-in-metadata %s' % ' '.join(map(compat_shlex_quote, f)) | |
332 | actions = ((MetadataParserPP.Actions.REPLACE, x, *f[1:]) for x in f[0].split(',')) | |
333 | ||
334 | for action in actions: | |
335 | try: | |
336 | MetadataParserPP.validate_action(*action) | |
337 | except Exception as err: | |
338 | parser.error(f'{cmd} is invalid; {err}') | |
339 | yield action | |
340 | ||
341 | if opts.parse_metadata is None: | |
342 | opts.parse_metadata = [] | |
5bfa4862 | 343 | if opts.metafromtitle is not None: |
e9f4ccd1 | 344 | opts.parse_metadata.append('title:%s' % opts.metafromtitle) |
345 | opts.parse_metadata = list(itertools.chain(*map(metadataparser_actions, opts.parse_metadata))) | |
5bfa4862 | 346 | |
d2a1fad9 | 347 | any_getting = opts.forceprint or opts.geturl or opts.gettitle or opts.getid or opts.getthumbnail or opts.getdescription or opts.getfilename or opts.getformat or opts.getduration or opts.dumpjson or opts.dump_single_json |
c0bdf32a | 348 | any_printing = opts.print_json |
590bc6f6 | 349 | download_archive_fn = expand_path(opts.download_archive) if opts.download_archive is not None else opts.download_archive |
525ef922 | 350 | |
f0884c8b | 351 | # If JSON is not printed anywhere, but comments are requested, save it to file |
352 | printing_json = opts.dumpjson or opts.print_json or opts.dump_single_json | |
353 | if opts.getcomments and not printing_json: | |
354 | opts.writeinfojson = True | |
355 | ||
7a340e0d NA |
356 | if opts.no_sponsorblock: |
357 | opts.sponsorblock_mark = set() | |
358 | opts.sponsorblock_remove = set() | |
359 | sponsorblock_query = opts.sponsorblock_mark | opts.sponsorblock_remove | |
360 | ||
361 | if (opts.addmetadata or opts.sponsorblock_mark) and opts.addchapters is None: | |
362 | opts.addchapters = True | |
363 | opts.remove_chapters = opts.remove_chapters or [] | |
364 | ||
63ad4d43 | 365 | def report_conflict(arg1, arg2): |
0d1bb027 | 366 | warnings.append('%s is ignored since %s was given' % (arg2, arg1)) |
72755351 | 367 | |
7a340e0d NA |
368 | if (opts.remove_chapters or sponsorblock_query) and opts.sponskrub is not False: |
369 | if opts.sponskrub: | |
370 | if opts.remove_chapters: | |
371 | report_conflict('--remove-chapters', '--sponskrub') | |
372 | if opts.sponsorblock_mark: | |
373 | report_conflict('--sponsorblock-mark', '--sponskrub') | |
374 | if opts.sponsorblock_remove: | |
375 | report_conflict('--sponsorblock-remove', '--sponskrub') | |
376 | opts.sponskrub = False | |
72755351 | 377 | if opts.sponskrub_cut and opts.split_chapters and opts.sponskrub is not False: |
378 | report_conflict('--split-chapter', '--sponskrub-cut') | |
379 | opts.sponskrub_cut = False | |
380 | ||
7a340e0d NA |
381 | if opts.remuxvideo and opts.recodevideo: |
382 | report_conflict('--recode-video', '--remux-video') | |
383 | opts.remuxvideo = False | |
384 | ||
63ad4d43 | 385 | if opts.allow_unplayable_formats: |
386 | if opts.extractaudio: | |
387 | report_conflict('--allow-unplayable-formats', '--extract-audio') | |
388 | opts.extractaudio = False | |
389 | if opts.remuxvideo: | |
390 | report_conflict('--allow-unplayable-formats', '--remux-video') | |
391 | opts.remuxvideo = False | |
392 | if opts.recodevideo: | |
393 | report_conflict('--allow-unplayable-formats', '--recode-video') | |
394 | opts.recodevideo = False | |
395 | if opts.addmetadata: | |
396 | report_conflict('--allow-unplayable-formats', '--add-metadata') | |
397 | opts.addmetadata = False | |
398 | if opts.embedsubtitles: | |
399 | report_conflict('--allow-unplayable-formats', '--embed-subs') | |
400 | opts.embedsubtitles = False | |
401 | if opts.embedthumbnail: | |
402 | report_conflict('--allow-unplayable-formats', '--embed-thumbnail') | |
403 | opts.embedthumbnail = False | |
404 | if opts.xattrs: | |
405 | report_conflict('--allow-unplayable-formats', '--xattrs') | |
406 | opts.xattrs = False | |
407 | if opts.fixup and opts.fixup.lower() not in ('never', 'ignore'): | |
408 | report_conflict('--allow-unplayable-formats', '--fixup') | |
409 | opts.fixup = 'never' | |
7a340e0d NA |
410 | if opts.remove_chapters: |
411 | report_conflict('--allow-unplayable-formats', '--remove-chapters') | |
412 | opts.remove_chapters = [] | |
413 | if opts.sponsorblock_remove: | |
414 | report_conflict('--allow-unplayable-formats', '--sponsorblock-remove') | |
415 | opts.sponsorblock_remove = set() | |
63ad4d43 | 416 | if opts.sponskrub: |
417 | report_conflict('--allow-unplayable-formats', '--sponskrub') | |
418 | opts.sponskrub = False | |
419 | ||
4f026faf PH |
420 | # PostProcessors |
421 | postprocessors = [] | |
7a340e0d NA |
422 | if sponsorblock_query: |
423 | postprocessors.append({ | |
424 | 'key': 'SponsorBlock', | |
425 | 'categories': sponsorblock_query, | |
426 | 'api': opts.sponsorblock_api, | |
427 | # Run this immediately after extraction is complete | |
428 | 'when': 'pre_process' | |
429 | }) | |
e9f4ccd1 | 430 | if opts.parse_metadata: |
e7db87f7 | 431 | postprocessors.append({ |
e9f4ccd1 | 432 | 'key': 'MetadataParser', |
433 | 'actions': opts.parse_metadata, | |
56d868db | 434 | # Run this immediately after extraction is complete |
435 | 'when': 'pre_process' | |
436 | }) | |
437 | if opts.convertsubtitles: | |
438 | postprocessors.append({ | |
439 | 'key': 'FFmpegSubtitlesConvertor', | |
440 | 'format': opts.convertsubtitles, | |
441 | # Run this before the actual video download | |
442 | 'when': 'before_dl' | |
e7db87f7 | 443 | }) |
8fa43c73 | 444 | if opts.convertthumbnails: |
445 | postprocessors.append({ | |
446 | 'key': 'FFmpegThumbnailsConvertor', | |
447 | 'format': opts.convertthumbnails, | |
448 | # Run this before the actual video download | |
449 | 'when': 'before_dl' | |
450 | }) | |
5520aa2d | 451 | # Must be after all other before_dl |
452 | if opts.exec_before_dl_cmd: | |
453 | postprocessors.append({ | |
ad3dc496 | 454 | 'key': 'Exec', |
5520aa2d | 455 | 'exec_cmd': opts.exec_before_dl_cmd, |
456 | 'when': 'before_dl' | |
457 | }) | |
4f026faf PH |
458 | if opts.extractaudio: |
459 | postprocessors.append({ | |
460 | 'key': 'FFmpegExtractAudio', | |
461 | 'preferredcodec': opts.audioformat, | |
462 | 'preferredquality': opts.audioquality, | |
463 | 'nopostoverwrites': opts.nopostoverwrites, | |
464 | }) | |
efe87a10 FS |
465 | if opts.remuxvideo: |
466 | postprocessors.append({ | |
467 | 'key': 'FFmpegVideoRemuxer', | |
468 | 'preferedformat': opts.remuxvideo, | |
469 | }) | |
4f026faf PH |
470 | if opts.recodevideo: |
471 | postprocessors.append({ | |
472 | 'key': 'FFmpegVideoConvertor', | |
473 | 'preferedformat': opts.recodevideo, | |
474 | }) | |
7a340e0d | 475 | # If ModifyChapters is going to remove chapters, subtitles must already be in the container. |
4f026faf | 476 | if opts.embedsubtitles: |
b51d2ae3 | 477 | already_have_subtitle = opts.writesubtitles and 'no-keep-subs' not in compat_opts |
4f026faf PH |
478 | postprocessors.append({ |
479 | 'key': 'FFmpegEmbedSubtitle', | |
56d868db | 480 | # already_have_subtitle = True prevents the file from being deleted after embedding |
cffab0ee | 481 | 'already_have_subtitle': already_have_subtitle |
4f026faf | 482 | }) |
b51d2ae3 | 483 | if not opts.writeautomaticsub and 'no-keep-subs' not in compat_opts: |
cffab0ee | 484 | opts.writesubtitles = True |
485 | # --all-sub automatically sets --write-sub if --write-auto-sub is not given | |
486 | # this was the old behaviour if only --all-sub was given. | |
487 | if opts.allsubtitles and not opts.writeautomaticsub: | |
488 | opts.writesubtitles = True | |
7a340e0d NA |
489 | # ModifyChapters must run before FFmpegMetadataPP |
490 | remove_chapters_patterns = [] | |
491 | for regex in opts.remove_chapters: | |
492 | try: | |
493 | remove_chapters_patterns.append(re.compile(regex)) | |
494 | except re.error as err: | |
495 | parser.error(f'invalid --remove-chapters regex {regex!r} - {err}') | |
496 | if opts.remove_chapters or sponsorblock_query: | |
497 | postprocessors.append({ | |
498 | 'key': 'ModifyChapters', | |
499 | 'remove_chapters_patterns': remove_chapters_patterns, | |
500 | 'remove_sponsor_segments': opts.sponsorblock_remove, | |
501 | 'sponsorblock_chapter_title': opts.sponsorblock_chapter_title, | |
502 | 'force_keyframes': opts.force_keyframes_at_cuts | |
503 | }) | |
504 | # FFmpegMetadataPP should be run after FFmpegVideoConvertorPP and | |
505 | # FFmpegExtractAudioPP as containers before conversion may not support | |
506 | # metadata (3gp, webm, etc.) | |
507 | # By default ffmpeg preserves metadata applicable for both | |
508 | # source and target containers. From this point the container won't change, | |
509 | # so metadata can be added here. | |
510 | if opts.addmetadata or opts.addchapters: | |
511 | postprocessors.append({ | |
512 | 'key': 'FFmpegMetadata', | |
513 | 'add_chapters': opts.addchapters, | |
514 | 'add_metadata': opts.addmetadata, | |
515 | }) | |
f4e4be19 | 516 | # This should be above EmbedThumbnail since sponskrub removes the thumbnail attachment |
517 | # but must be below EmbedSubtitle and FFmpegMetadata | |
518 | # See https://github.com/yt-dlp/yt-dlp/issues/204 , https://github.com/faissaloo/SponSkrub/issues/29 | |
a9e7f546 | 519 | # If opts.sponskrub is None, sponskrub is used, but it silently fails if the executable can't be found |
520 | if opts.sponskrub is not False: | |
521 | postprocessors.append({ | |
522 | 'key': 'SponSkrub', | |
523 | 'path': opts.sponskrub_path, | |
524 | 'args': opts.sponskrub_args, | |
525 | 'cut': opts.sponskrub_cut, | |
526 | 'force': opts.sponskrub_force, | |
527 | 'ignoreerror': opts.sponskrub is None, | |
528 | }) | |
f4e4be19 | 529 | if opts.embedthumbnail: |
530 | already_have_thumbnail = opts.writethumbnail or opts.write_all_thumbnails | |
531 | postprocessors.append({ | |
532 | 'key': 'EmbedThumbnail', | |
56d868db | 533 | # already_have_thumbnail = True prevents the file from being deleted after embedding |
f4e4be19 | 534 | 'already_have_thumbnail': already_have_thumbnail |
535 | }) | |
536 | if not already_have_thumbnail: | |
537 | opts.writethumbnail = True | |
72755351 | 538 | if opts.split_chapters: |
7a340e0d NA |
539 | postprocessors.append({ |
540 | 'key': 'FFmpegSplitChapters', | |
541 | 'force_keyframes': opts.force_keyframes_at_cuts, | |
542 | }) | |
72755351 | 543 | # XAttrMetadataPP should be run after post-processors that may change file contents |
544 | if opts.xattrs: | |
545 | postprocessors.append({'key': 'XAttrMetadata'}) | |
ad3dc496 | 546 | # Exec must be the last PP |
4f026faf PH |
547 | if opts.exec_cmd: |
548 | postprocessors.append({ | |
ad3dc496 | 549 | 'key': 'Exec', |
4f026faf | 550 | 'exec_cmd': opts.exec_cmd, |
56d868db | 551 | # Run this only after the files have been moved to their final locations |
552 | 'when': 'after_move' | |
4f026faf | 553 | }) |
1b77b347 | 554 | |
06869367 | 555 | def report_args_compat(arg, name): |
0d1bb027 | 556 | warnings.append('%s given without specifying name. The arguments will be given to all %s' % (arg, name)) |
557 | ||
b8f6bbe6 | 558 | if 'default' in opts.external_downloader_args: |
0d1bb027 | 559 | report_args_compat('--downloader-args', 'external downloaders') |
b8f6bbe6 | 560 | |
45016689 | 561 | if 'default-compat' in opts.postprocessor_args and 'default' not in opts.postprocessor_args: |
06869367 | 562 | report_args_compat('--post-processor-args', 'post-processors') |
45016689 | 563 | opts.postprocessor_args.setdefault('sponskrub', []) |
564 | opts.postprocessor_args['default'] = opts.postprocessor_args['default-compat'] | |
1b77b347 | 565 | |
df692c5a | 566 | final_ext = ( |
81a23040 | 567 | opts.recodevideo if opts.recodevideo in FFmpegVideoConvertorPP.SUPPORTED_EXTS |
568 | else opts.remuxvideo if opts.remuxvideo in FFmpegVideoRemuxerPP.SUPPORTED_EXTS | |
569 | else opts.audioformat if (opts.extractaudio and opts.audioformat != 'best') | |
570 | else None) | |
f6d7624f | 571 | |
347de493 PH |
572 | match_filter = ( |
573 | None if opts.match_filter is None | |
574 | else match_filter_func(opts.match_filter)) | |
4f026faf | 575 | |
bdde425c | 576 | ydl_opts = { |
59ae15a5 | 577 | 'usenetrc': opts.usenetrc, |
0001fcb5 | 578 | 'netrc_location': opts.netrc_location, |
59ae15a5 PH |
579 | 'username': opts.username, |
580 | 'password': opts.password, | |
83317f69 | 581 | 'twofactor': opts.twofactor, |
c6c19746 | 582 | 'videopassword': opts.videopassword, |
797c636b | 583 | 'ap_mso': opts.ap_mso, |
1b6712ab RA |
584 | 'ap_username': opts.ap_username, |
585 | 'ap_password': opts.ap_password, | |
c0bdf32a | 586 | 'quiet': (opts.quiet or any_getting or any_printing), |
ad8915b7 | 587 | 'no_warnings': opts.no_warnings, |
59ae15a5 PH |
588 | 'forceurl': opts.geturl, |
589 | 'forcetitle': opts.gettitle, | |
1a2adf3f | 590 | 'forceid': opts.getid, |
59ae15a5 PH |
591 | 'forcethumbnail': opts.getthumbnail, |
592 | 'forcedescription': opts.getdescription, | |
525ef922 | 593 | 'forceduration': opts.getduration, |
59ae15a5 PH |
594 | 'forcefilename': opts.getfilename, |
595 | 'forceformat': opts.getformat, | |
d2a1fad9 | 596 | 'forceprint': opts.forceprint, |
c0bdf32a | 597 | 'forcejson': opts.dumpjson or opts.print_json, |
63e0be34 | 598 | 'dump_single_json': opts.dump_single_json, |
2d30509f | 599 | 'force_write_download_archive': opts.force_write_download_archive, |
b7b04c78 | 600 | 'simulate': (any_getting or None) if opts.simulate is None else opts.simulate, |
1bdeb7be | 601 | 'skip_download': opts.skip_download, |
59ae15a5 | 602 | 'format': opts.format, |
63ad4d43 | 603 | 'allow_unplayable_formats': opts.allow_unplayable_formats, |
b7da73eb | 604 | 'ignore_no_formats_error': opts.ignore_no_formats_error, |
eb8a4433 | 605 | 'format_sort': opts.format_sort, |
606 | 'format_sort_force': opts.format_sort_force, | |
909d24dd | 607 | 'allow_multiple_video_streams': opts.allow_multiple_video_streams, |
608 | 'allow_multiple_audio_streams': opts.allow_multiple_audio_streams, | |
e8e73840 | 609 | 'check_formats': opts.check_formats, |
59ae15a5 | 610 | 'listformats': opts.listformats, |
76d321f6 | 611 | 'listformats_table': opts.listformats_table, |
486fb179 | 612 | 'outtmpl': opts.outtmpl, |
a820dc72 | 613 | 'outtmpl_na_placeholder': opts.outtmpl_na_placeholder, |
0202b52a | 614 | 'paths': opts.paths, |
213c31ae | 615 | 'autonumber_size': opts.autonumber_size, |
acbb2374 | 616 | 'autonumber_start': opts.autonumber_start, |
59ae15a5 | 617 | 'restrictfilenames': opts.restrictfilenames, |
c2934512 | 618 | 'windowsfilenames': opts.windowsfilenames, |
59ae15a5 | 619 | 'ignoreerrors': opts.ignoreerrors, |
d22dec74 | 620 | 'force_generic_extractor': opts.force_generic_extractor, |
59ae15a5 | 621 | 'ratelimit': opts.ratelimit, |
51d9739f | 622 | 'throttledratelimit': opts.throttledratelimit, |
0c3d0f51 | 623 | 'overwrites': opts.overwrites, |
52bb437e S |
624 | 'retries': opts.retries, |
625 | 'fragment_retries': opts.fragment_retries, | |
62bff2c1 | 626 | 'extractor_retries': opts.extractor_retries, |
9603b660 | 627 | 'skip_unavailable_fragments': opts.skip_unavailable_fragments, |
0eee52f3 | 628 | 'keep_fragments': opts.keep_fragments, |
4cf1e5d2 | 629 | 'concurrent_fragment_downloads': opts.concurrent_fragment_downloads, |
59ae15a5 PH |
630 | 'buffersize': opts.buffersize, |
631 | 'noresizebuffer': opts.noresizebuffer, | |
ba515388 | 632 | 'http_chunk_size': opts.http_chunk_size, |
59ae15a5 PH |
633 | 'continuedl': opts.continue_dl, |
634 | 'noprogress': opts.noprogress, | |
5717d91a | 635 | 'progress_with_newline': opts.progress_with_newline, |
59ae15a5 PH |
636 | 'playliststart': opts.playliststart, |
637 | 'playlistend': opts.playlistend, | |
ff815fe6 | 638 | 'playlistreverse': opts.playlist_reverse, |
75822ca7 | 639 | 'playlistrandom': opts.playlist_random, |
47192f92 | 640 | 'noplaylist': opts.noplaylist, |
de6000d9 | 641 | 'logtostderr': outtmpl_default == '-', |
59ae15a5 PH |
642 | 'consoletitle': opts.consoletitle, |
643 | 'nopart': opts.nopart, | |
644 | 'updatetime': opts.updatetime, | |
645 | 'writedescription': opts.writedescription, | |
1fb07d10 | 646 | 'writeannotations': opts.writeannotations, |
f0884c8b | 647 | 'writeinfojson': opts.writeinfojson, |
1ea24129 | 648 | 'allow_playlist_files': opts.allow_playlist_files, |
75d43ca0 | 649 | 'clean_infojson': opts.clean_infojson, |
06167fbb | 650 | 'getcomments': opts.getcomments, |
11d9224e | 651 | 'writethumbnail': opts.writethumbnail, |
ec82d85a | 652 | 'write_all_thumbnails': opts.write_all_thumbnails, |
732044af | 653 | 'writelink': opts.writelink, |
654 | 'writeurllink': opts.writeurllink, | |
655 | 'writewebloclink': opts.writewebloclink, | |
656 | 'writedesktoplink': opts.writedesktoplink, | |
59ae15a5 | 657 | 'writesubtitles': opts.writesubtitles, |
b004821f | 658 | 'writeautomaticsub': opts.writeautomaticsub, |
ae608b80 | 659 | 'allsubtitles': opts.allsubtitles, |
2a4093ea | 660 | 'listsubtitles': opts.listsubtitles, |
9e62bc44 | 661 | 'subtitlesformat': opts.subtitlesformat, |
d6e203b3 | 662 | 'subtitleslangs': opts.subtitleslangs, |
8271226a PH |
663 | 'matchtitle': decodeOption(opts.matchtitle), |
664 | 'rejecttitle': decodeOption(opts.rejecttitle), | |
59ae15a5 PH |
665 | 'max_downloads': opts.max_downloads, |
666 | 'prefer_free_formats': opts.prefer_free_formats, | |
bdc3fd2f | 667 | 'trim_file_name': opts.trim_file_name, |
59ae15a5 | 668 | 'verbose': opts.verbose, |
855703e5 | 669 | 'dump_intermediate_pages': opts.dump_intermediate_pages, |
d41e6efc | 670 | 'write_pages': opts.write_pages, |
8d5d3a5d | 671 | 'test': opts.test, |
7851b379 | 672 | 'keepvideo': opts.keepvideo, |
9e982f9e | 673 | 'min_filesize': opts.min_filesize, |
bd558525 | 674 | 'max_filesize': opts.max_filesize, |
5fe18bdb PH |
675 | 'min_views': opts.min_views, |
676 | 'max_views': opts.max_views, | |
11d9224e | 677 | 'daterange': date, |
7f747732 | 678 | 'cachedir': opts.cachedir, |
f8061589 | 679 | 'youtube_print_sig_code': opts.youtube_print_sig_code, |
8dbe9899 | 680 | 'age_limit': opts.age_limit, |
17093b83 | 681 | 'download_archive': download_archive_fn, |
ea6e0c2b | 682 | 'break_on_existing': opts.break_on_existing, |
8b0d7497 | 683 | 'break_on_reject': opts.break_on_reject, |
26e2805c | 684 | 'skip_playlist_after_errors': opts.skip_playlist_after_errors, |
dca08720 | 685 | 'cookiefile': opts.cookiefile, |
982ee69a | 686 | 'cookiesfrombrowser': opts.cookiesfrombrowser, |
dca08720 | 687 | 'nocheckcertificate': opts.no_check_certificate, |
7e8c0af0 | 688 | 'prefer_insecure': opts.prefer_insecure, |
c2e52508 | 689 | 'proxy': opts.proxy, |
6ad14cab | 690 | 'socket_timeout': opts.socket_timeout, |
0783b09b | 691 | 'bidi_workaround': opts.bidi_workaround, |
a0ddb8a2 | 692 | 'debug_printtraffic': opts.debug_printtraffic, |
76b1bd67 | 693 | 'prefer_ffmpeg': opts.prefer_ffmpeg, |
7b0817e8 | 694 | 'include_ads': opts.include_ads, |
04b4d394 | 695 | 'default_search': opts.default_search, |
78895bd3 | 696 | 'dynamic_mpd': opts.dynamic_mpd, |
5d3a0e79 | 697 | 'extractor_args': opts.extractor_args, |
4919603f | 698 | 'youtube_include_dash_manifest': opts.youtube_include_dash_manifest, |
78895bd3 | 699 | 'youtube_include_hls_manifest': opts.youtube_include_hls_manifest, |
62fec3b2 | 700 | 'encoding': opts.encoding, |
057a5206 | 701 | 'extract_flat': opts.extract_flat, |
d77ab8e2 | 702 | 'mark_watched': opts.mark_watched, |
34c781a2 | 703 | 'merge_output_format': opts.merge_output_format, |
df692c5a | 704 | 'final_ext': final_ext, |
4f026faf | 705 | 'postprocessors': postprocessors, |
6271f1ca | 706 | 'fixup': opts.fixup, |
be4a824d | 707 | 'source_address': opts.source_address, |
58b1f00d | 708 | 'call_home': opts.call_home, |
1cf376f5 | 709 | 'sleep_interval_requests': opts.sleep_interval_requests, |
5f0d813d | 710 | 'sleep_interval': opts.sleep_interval, |
065bc354 | 711 | 'max_sleep_interval': opts.max_sleep_interval, |
0c9df79e | 712 | 'sleep_interval_subtitles': opts.sleep_interval_subtitles, |
222516d9 | 713 | 'external_downloader': opts.external_downloader, |
cfb56d1a | 714 | 'list_thumbnails': opts.list_thumbnails, |
c14e88f0 | 715 | 'playlist_items': opts.playlist_items, |
881e6a1f | 716 | 'xattr_set_filesize': opts.xattr_set_filesize, |
347de493 | 717 | 'match_filter': match_filter, |
7e5db8c9 | 718 | 'no_color': opts.no_color, |
73fac4e9 | 719 | 'ffmpeg_location': opts.ffmpeg_location, |
85729c51 | 720 | 'hls_prefer_native': opts.hls_prefer_native, |
7d106a65 | 721 | 'hls_use_mpegts': opts.hls_use_mpegts, |
310c2ed2 | 722 | 'hls_split_discontinuity': opts.hls_split_discontinuity, |
46ee996e | 723 | 'external_downloader_args': opts.external_downloader_args, |
45016689 | 724 | 'postprocessor_args': opts.postprocessor_args, |
91410c9b | 725 | 'cn_verification_proxy': opts.cn_verification_proxy, |
38cce791 | 726 | 'geo_verification_proxy': opts.geo_verification_proxy, |
0a840f58 S |
727 | 'geo_bypass': opts.geo_bypass, |
728 | 'geo_bypass_country': opts.geo_bypass_country, | |
5f95927a | 729 | 'geo_bypass_ip_block': opts.geo_bypass_ip_block, |
0d1bb027 | 730 | 'warnings': warnings, |
53ed7066 | 731 | 'compat_opts': compat_opts, |
732 | # just for deprecation check | |
0d1bb027 | 733 | 'autonumber': opts.autonumber or None, |
734 | 'usetitle': opts.usetitle or None, | |
486fb179 | 735 | 'useid': opts.useid or None, |
bdde425c | 736 | } |
59ae15a5 | 737 | |
bdde425c | 738 | with YoutubeDL(ydl_opts) as ydl: |
e5813e53 | 739 | actual_use = len(all_urls) or opts.load_info_filename |
bdde425c | 740 | |
052421ff PH |
741 | # Remove cache dir |
742 | if opts.rm_cachedir: | |
a0e07d31 | 743 | ydl.cache.remove() |
052421ff | 744 | |
e5813e53 | 745 | # Update version |
746 | if opts.update_self: | |
747 | # If updater returns True, exit. Required for windows | |
c19bc311 | 748 | if run_update(ydl): |
e5813e53 | 749 | if actual_use: |
6b027907 | 750 | sys.exit('ERROR: The program must exit for the update to complete') |
e5813e53 | 751 | sys.exit() |
752 | ||
bdde425c | 753 | # Maybe do nothing |
e5813e53 | 754 | if not actual_use: |
7d4111ed | 755 | if opts.update_self or opts.rm_cachedir: |
bdde425c | 756 | sys.exit() |
59ae15a5 | 757 | |
7d4111ed | 758 | ydl.warn_if_short_id(sys.argv[1:] if argv is None else argv) |
adc0ae3c PH |
759 | parser.error( |
760 | 'You must provide at least one URL.\n' | |
7a5c1cfe | 761 | 'Type yt-dlp --help to see a list of all options.') |
7d4111ed | 762 | |
bdde425c | 763 | try: |
1dcc4c0c | 764 | if opts.load_info_filename is not None: |
590bc6f6 | 765 | retcode = ydl.download_with_info_file(expand_path(opts.load_info_filename)) |
1dcc4c0c JMF |
766 | else: |
767 | retcode = ydl.download(all_urls) | |
8b0d7497 | 768 | except (MaxDownloadsReached, ExistingVideoReached, RejectedVideoReached): |
769 | ydl.to_screen('Aborting remaining downloads') | |
bdde425c | 770 | retcode = 101 |
59ae15a5 | 771 | |
59ae15a5 | 772 | sys.exit(retcode) |
235b3ba4 | 773 | |
a27b9e8b | 774 | |
b8ad4f02 | 775 | def main(argv=None): |
59ae15a5 | 776 | try: |
b8ad4f02 | 777 | _real_main(argv) |
59ae15a5 PH |
778 | except DownloadError: |
779 | sys.exit(1) | |
780 | except SameFileError: | |
a4bc4336 | 781 | sys.exit('ERROR: fixed output name but more than one file to download') |
59ae15a5 | 782 | except KeyboardInterrupt: |
a4bc4336 | 783 | sys.exit('\nERROR: Interrupted by user') |
cc3fa8d3 | 784 | except BrokenPipeError: |
785 | # https://docs.python.org/3/library/signal.html#note-on-sigpipe | |
786 | devnull = os.open(os.devnull, os.O_WRONLY) | |
787 | os.dup2(devnull, sys.stdout.fileno()) | |
788 | sys.exit(r'\nERROR: {err}') | |
2bad0e5d | 789 | |
582be358 | 790 | |
2bad0e5d | 791 | __all__ = ['main', 'YoutubeDL', 'gen_extractors', 'list_extractors'] |