]> jfr.im git - yt-dlp.git/blame - README.md
Merge branch 'RedpointsBots-feature_subscriber_count'
[yt-dlp.git] / README.md
CommitLineData
424dc7be 1[![PyPi](https://img.shields.io/pypi/v/youtube-dlc.svg)](https://pypi.org/project/youtube-dlc)
c8598bbe 2[![Build Status](https://travis-ci.com/blackjack4494/youtube-dlc.svg?branch=master)](https://travis-ci.com/blackjack4494/youtube-dlc)
a90d4f7e 3[![Downloads](https://pepy.tech/badge/youtube-dlc)](https://pepy.tech/project/youtube-dlc)
5c0e5bc4 4
1c547dc8
TOH
5[![Gitter chat](https://badges.gitter.im/youtube-dlc/gitter.png)](https://gitter.im/youtube-dlc)
6[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](https://github.com/blackjack4494/youtube-dlc/blob/master/LICENSE)
7
8a92dee7
JT
8youtube-dlc - download videos from youtube.com or other video platforms.
9
10youtube-dlc is a fork of youtube-dl with the intention of getting features tested by the community merged in the tool faster, since youtube-dl's development seems to be slowing down. (https://github.com/ytdl-org/youtube-dl/issues/26462)
6bcd846b 11
b50e3bc6
PH
12- [INSTALLATION](#installation)
13- [DESCRIPTION](#description)
14- [OPTIONS](#options)
78895bd3
U
15 - [Network Options:](#network-options)
16 - [Geo Restriction:](#geo-restriction)
17 - [Video Selection:](#video-selection)
18 - [Download Options:](#download-options)
19 - [Filesystem Options:](#filesystem-options)
20 - [Thumbnail images:](#thumbnail-images)
21 - [Verbosity / Simulation Options:](#verbosity--simulation-options)
22 - [Workarounds:](#workarounds)
23 - [Video Format Options:](#video-format-options)
24 - [Subtitle Options:](#subtitle-options)
25 - [Authentication Options:](#authentication-options)
26 - [Adobe Pass Options:](#adobe-pass-options)
27 - [Post-processing Options:](#post-processing-options)
28 - [Extractor Options:](#extractor-options)
cfcec693 29
d19bb9c0
PH
30# INSTALLATION
31
5f326cf5
TOH
32**All Platforms**
33Preferred way using pip:
9ab41610 34You may want to use `python3` instead of `python`
d19bb9c0 35
9ab41610 36 python -m pip install --upgrade youtube-dlc
d19bb9c0 37
5f326cf5
TOH
38**UNIX** (Linux, macOS, etc.)
39Using wget:
40
41 sudo wget https://github.com/blackjack4494/youtube-dlc/releases/latest/download/youtube-dlc -O /usr/local/bin/youtube-dlc
42 sudo chmod a+rx /usr/local/bin/youtube-dlc
43
44Using curl:
45
46 sudo curl -L https://github.com/blackjack4494/youtube-dlc/releases/latest/download/youtube-dlc -o /usr/local/bin/youtube-dlc
47 sudo chmod a+rx /usr/local/bin/youtube-dlc
48
49
50**Windows** users can download [youtube-dlc.exe](https://github.com/blackjack4494/youtube-dlc/releases/latest/download/youtube-dlc.exe) (**do not** put in `C:\Windows\System32`!).
51
52**Compile**
b96a939b 53To build the Windows executable yourself (without version info!)
d19bb9c0 54
9ab41610 55 python -m pip install --upgrade pyinstaller
cefecac1 56 pyinstaller.exe youtube_dlc\__main__.py --onefile --name youtube-dlc
8f1aaa97 57
9ab41610 58Or simply execute the `make_win.bat` if pyinstaller is installed.
5f326cf5
TOH
59There will be a `youtube-dlc.exe` in `/dist`
60
b96a939b
TOH
61New way to build Windows is to use `python pyinst.py` (please use python3 64Bit)
62For 32Bit Version use a 32Bit Version of python (3 preferred here as well) and run `python pyinst32.py`
63
5f326cf5
TOH
64For Unix:
65You will need the required build tools
66python, make (GNU), pandoc, zip, nosetests
67Then simply type this
68
69 make
70
d19bb9c0 71
cfcec693 72# DESCRIPTION
9ab41610 73**youtube-dlc** is a command-line program to download videos from YouTube.com and a few more sites. It requires the Python interpreter, version 2.6, 2.7, or 3.2+, and it is not platform specific. It should work on your Unix box, on Windows or on macOS. It is released to the public domain, which means you can modify it, redistribute it or use it however you like.
6bcd846b 74
9ab41610 75 youtube-dlc [OPTIONS] URL [URL...]
b50e3bc6 76
cfcec693 77# OPTIONS
1dc2726f
PH
78 -h, --help Print this help text and exit
79 --version Print program version and exit
c4af7684
PH
80 -U, --update Update this program to latest version. Make
81 sure that you have sufficient permissions
82 (run with sudo if needed)
83 -i, --ignore-errors Continue on download errors, for example to
84 skip unavailable videos in a playlist
85 --abort-on-error Abort downloading of further videos (in the
86 playlist or the command line) if an error
87 occurs
1dc2726f 88 --dump-user-agent Display the current browser identification
4b9f9010 89 --list-extractors List all supported extractors
c4af7684
PH
90 --extractor-descriptions Output descriptions of all supported
91 extractors
92 --force-generic-extractor Force extraction to use the generic
93 extractor
94 --default-search PREFIX Use this prefix for unqualified URLs. For
95 example "gvsearch2:" downloads two videos
cefecac1 96 from google videos for youtube-dlc "large
c4af7684 97 apple". Use the value "auto" to let
cefecac1 98 youtube-dlc guess ("auto_warning" to emit a
c4af7684
PH
99 warning when guessing). "error" just throws
100 an error. The default value "fixup_error"
101 repairs broken URLs, but emits an error if
102 this is not possible instead of searching.
103 --ignore-config Do not read configuration files. When given
82674236 104 in the global configuration file
cefecac1 105 /etc/youtube-dlc.conf: Do not read the user
c4af7684 106 configuration in ~/.config/youtube-
e3671279
U
107 dlc/config (%APPDATA%/youtube-
108 dlc/config.txt on Windows)
dc48a354
S
109 --config-location PATH Location of the configuration file; either
110 the path to the config or its containing
111 directory.
c4af7684
PH
112 --flat-playlist Do not extract the videos of a playlist,
113 only list them.
bdf7f139
PH
114 --mark-watched Mark videos watched (YouTube only)
115 --no-mark-watched Do not mark videos watched (YouTube only)
1dc2726f 116 --no-color Do not emit color codes in output
08c1d0d3 117
149f05c7 118## Network Options:
28b4f736 119 --proxy URL Use the specified HTTP/HTTPS/SOCKS proxy.
0934c9d4
S
120 To enable SOCKS proxy, specify a proper
121 scheme. For example
28b4f736
PH
122 socks5://127.0.0.1:1080/. Pass in an empty
123 string (--proxy "") for direct connection
149f05c7 124 --socket-timeout SECONDS Time to wait before giving up, in seconds
c4af7684 125 --source-address IP Client-side IP address to bind to
c4af7684 126 -4, --force-ipv4 Make all connections via IPv4
c4af7684 127 -6, --force-ipv6 Make all connections via IPv6
8c6c88c7
S
128
129## Geo Restriction:
c25f1a9b
S
130 --geo-verification-proxy URL Use this proxy to verify the IP address for
131 some geo-restricted sites. The default
132 proxy specified by --proxy (or none, if the
7550ea50 133 option is not present) is used for the
4d2fdb07 134 actual downloading.
8c6c88c7 135 --geo-bypass Bypass geographic restriction via faking
0934c9d4 136 X-Forwarded-For HTTP header
8c6c88c7
S
137 --no-geo-bypass Do not bypass geographic restriction via
138 faking X-Forwarded-For HTTP header
8c6c88c7
S
139 --geo-bypass-country CODE Force bypass geographic restriction with
140 explicitly provided two-letter ISO 3166-2
0934c9d4 141 country code
9e18bb4c
S
142 --geo-bypass-ip-block IP_BLOCK Force bypass geographic restriction with
143 explicitly provided IP block in CIDR
0934c9d4 144 notation
149f05c7 145
cfcec693 146## Video Selection:
1dc2726f
PH
147 --playlist-start NUMBER Playlist video to start at (default is 1)
148 --playlist-end NUMBER Playlist video to end at (default is last)
c4af7684
PH
149 --playlist-items ITEM_SPEC Playlist video items to download. Specify
150 indices of the videos in the playlist
151 separated by commas like: "--playlist-items
152 1,2,5,8" if you want to download videos
153 indexed 1, 2, 5, 8 in the playlist. You can
154 specify range: "--playlist-items
155 1-3,7,10-13", it will download the videos
156 at index 1, 2, 3, 7, 10, 11, 12 and 13.
157 --match-title REGEX Download only matching titles (regex or
158 caseless sub-string)
159 --reject-title REGEX Skip download for matching titles (regex or
160 caseless sub-string)
780083db 161 --max-downloads NUMBER Abort after downloading NUMBER files
c4af7684
PH
162 --min-filesize SIZE Do not download any videos smaller than
163 SIZE (e.g. 50k or 44.6m)
164 --max-filesize SIZE Do not download any videos larger than SIZE
165 (e.g. 50k or 44.6m)
1dc2726f 166 --date DATE Download only videos uploaded in this date
c4af7684
PH
167 --datebefore DATE Download only videos uploaded on or before
168 this date (i.e. inclusive)
169 --dateafter DATE Download only videos uploaded on or after
170 this date (i.e. inclusive)
171 --min-views COUNT Do not download any videos with less than
172 COUNT views
173 --max-views COUNT Do not download any videos with more than
174 COUNT views
4d2fdb07 175 --match-filter FILTER Generic video filter. Specify any key (see
cb1e6d89
S
176 the "OUTPUT TEMPLATE" for a list of
177 available keys) to match if the key is
178 present, !key to check if the key is not
179 present, key > NUMBER (like "comment_count
180 > 12", also works with >=, <, <=, !=, =) to
181 compare against a number, key = 'LITERAL'
182 (like "uploader = 'Mike Smith'", also works
183 with !=) to match against a string literal
184 and & to require multiple matches. Values
185 which are not known are excluded unless you
186 put a question mark (?) after the operator.
187 For example, to only match videos that have
8c6c88c7
S
188 been liked more than 100 times and disliked
189 less than 50 times (or the dislike
190 functionality is not available at the given
191 service), but who also have a description,
192 use --match-filter "like_count > 100 &
193 dislike_count <? 50 & description" .
c4af7684
PH
194 --no-playlist Download only the video, if the URL refers
195 to a video and a playlist.
196 --yes-playlist Download the playlist, if the URL refers to
197 a video and a playlist.
198 --age-limit YEARS Download only videos suitable for the given
199 age
200 --download-archive FILE Download only videos not listed in the
201 archive file. Record the IDs of all
202 downloaded videos in it.
203 --include-ads Download advertisements as well
204 (experimental)
6bcd846b 205
d5a62e4f 206## Download Options:
5e3856a2 207 -r, --limit-rate RATE Maximum download rate in bytes per second
c4af7684
PH
208 (e.g. 50K or 4.2M)
209 -R, --retries RETRIES Number of retries (default is 10), or
210 "infinite".
0be8314d 211 --fragment-retries RETRIES Number of retries for a fragment (default
b56e41a7
S
212 is 10), or "infinite" (DASH, hlsnative and
213 ISM)
214 --skip-unavailable-fragments Skip unavailable fragments (DASH, hlsnative
215 and ISM)
4d2fdb07
S
216 --abort-on-unavailable-fragment Abort downloading when some fragment is not
217 available
a82f4184
S
218 --keep-fragments Keep downloaded fragments on disk after
219 downloading is finished; fragments are
220 erased by default
c4af7684
PH
221 --buffer-size SIZE Size of download buffer (e.g. 1024 or 16K)
222 (default is 1024)
223 --no-resize-buffer Do not automatically adjust the buffer
224 size. By default, the buffer size is
225 automatically resized from an initial value
226 of SIZE.
db157d2a
S
227 --http-chunk-size SIZE Size of a chunk for chunk-based HTTP
228 downloading (e.g. 10485760 or 10M) (default
229 is disabled). May be useful for bypassing
230 bandwidth throttling imposed by a webserver
231 (experimental)
2101f5d4 232 --playlist-reverse Download playlist videos in reverse order
31487eb9 233 --playlist-random Download playlist videos in random order
c4af7684 234 --xattr-set-filesize Set file xattribute ytdl.filesize with
0934c9d4 235 expected file size
c4af7684 236 --hls-prefer-native Use the native HLS downloader instead of
8b38f2ac
PH
237 ffmpeg
238 --hls-prefer-ffmpeg Use ffmpeg instead of the native HLS
239 downloader
a69bee47
PH
240 --hls-use-mpegts Use the mpegts container for HLS videos,
241 allowing to play the video while
242 downloading (some players may not be able
243 to play it)
c4af7684
PH
244 --external-downloader COMMAND Use the specified external downloader.
245 Currently supports
6bb26669 246 aria2c,avconv,axel,curl,ffmpeg,httpie,wget
c4af7684
PH
247 --external-downloader-args ARGS Give these arguments to the external
248 downloader
d5a62e4f 249
cfcec693 250## Filesystem Options:
c4af7684 251 -a, --batch-file FILE File containing URLs to download ('-' for
e8dfecb3
S
252 stdin), one URL per line. Lines starting
253 with '#', ';' or ']' are considered as
254 comments and ignored.
1dc2726f 255 --id Use only video ID in file name
bd1bcd3e
S
256 -o, --output TEMPLATE Output filename template, see the "OUTPUT
257 TEMPLATE" for all the info
4d2fdb07
S
258 --autonumber-start NUMBER Specify the start value for %(autonumber)s
259 (default is 1)
c4af7684
PH
260 --restrict-filenames Restrict filenames to only ASCII
261 characters, and avoid "&" and spaces in
262 filenames
1dc2726f 263 -w, --no-overwrites Do not overwrite files
c4af7684 264 -c, --continue Force resume of partially downloaded files.
cefecac1 265 By default, youtube-dlc will resume
c4af7684
PH
266 downloads if possible.
267 --no-continue Do not resume partially downloaded files
268 (restart from beginning)
269 --no-part Do not use .part files - write directly
270 into output file
271 --no-mtime Do not use the Last-modified header to set
272 the file modification time
273 --write-description Write video description to a .description
274 file
1dc2726f 275 --write-info-json Write video metadata to a .info.json file
c4af7684
PH
276 --write-annotations Write video annotations to a
277 .annotations.xml file
d845622b 278 --load-info-json FILE JSON file containing the video information
c4af7684
PH
279 (created with the "--write-info-json"
280 option)
281 --cookies FILE File to read cookies from and dump cookie
282 jar in
e3671279
U
283 --cache-dir DIR Location in the filesystem where youtube-
284 dlc can store some downloaded information
82674236 285 permanently. By default
cefecac1
U
286 $XDG_CACHE_HOME/youtube-dlc or
287 ~/.cache/youtube-dlc . At the moment, only
82674236
S
288 YouTube player files (for videos with
289 obfuscated signatures) are cached, but that
290 may change.
36f35428
PH
291 --no-cache-dir Disable filesystem caching
292 --rm-cache-dir Delete all filesystem cache files
6bcd846b 293
2b1bd292 294## Thumbnail images:
1dc2726f
PH
295 --write-thumbnail Write thumbnail image to disk
296 --write-all-thumbnails Write all thumbnail image formats to disk
c4af7684
PH
297 --list-thumbnails Simulate and list all available thumbnail
298 formats
2b1bd292 299
cfcec693 300## Verbosity / Simulation Options:
1dc2726f 301 -q, --quiet Activate quiet mode
6c072e7d 302 --no-warnings Ignore warnings
c4af7684
PH
303 -s, --simulate Do not download the video and do not write
304 anything to disk
1dc2726f
PH
305 --skip-download Do not download the video
306 -g, --get-url Simulate, quiet but print URL
307 -e, --get-title Simulate, quiet but print title
308 --get-id Simulate, quiet but print id
309 --get-thumbnail Simulate, quiet but print thumbnail URL
310 --get-description Simulate, quiet but print video description
311 --get-duration Simulate, quiet but print video length
312 --get-filename Simulate, quiet but print output filename
313 --get-format Simulate, quiet but print output format
c4af7684 314 -j, --dump-json Simulate, quiet but print JSON information.
cb1e6d89
S
315 See the "OUTPUT TEMPLATE" for a description
316 of available keys.
c4af7684
PH
317 -J, --dump-single-json Simulate, quiet but print JSON information
318 for each command-line argument. If the URL
319 refers to a playlist, dump the whole
320 playlist information in a single line.
321 --print-json Be quiet and print the video information as
322 JSON (video is still being downloaded).
1dc2726f
PH
323 --newline Output progress bar as new lines
324 --no-progress Do not print progress bar
325 --console-title Display progress in console titlebar
326 -v, --verbose Print various debugging information
c4af7684
PH
327 --dump-pages Print downloaded pages encoded using base64
328 to debug problems (very verbose)
329 --write-pages Write downloaded intermediary pages to
330 files in the current directory to debug
331 problems
780083db 332 --print-traffic Display sent and read HTTP traffic
e3671279
U
333 -C, --call-home Contact the youtube-dlc server for
334 debugging
cefecac1 335 --no-call-home Do NOT contact the youtube-dlc server for
c4af7684 336 debugging
6bcd846b 337
36f35428
PH
338## Workarounds:
339 --encoding ENCODING Force the specified encoding (experimental)
1dc2726f 340 --no-check-certificate Suppress HTTPS certificate validation
c4af7684 341 --prefer-insecure Use an unencrypted connection to retrieve
05a7ffb1
S
342 information about the video. (Currently
343 supported only for YouTube)
1dc2726f 344 --user-agent UA Specify a custom user agent
c4af7684
PH
345 --referer URL Specify a custom referer, use if the video
346 access is restricted to one domain
347 --add-header FIELD:VALUE Specify a custom HTTP header and its value,
348 separated by a colon ':'. You can use this
349 option multiple times
350 --bidi-workaround Work around terminals that lack
351 bidirectional text support. Requires bidiv
352 or fribidi executable in PATH
353 --sleep-interval SECONDS Number of seconds to sleep before each
b1ce2ba1
S
354 download when used alone or a lower bound
355 of a range for randomized sleep before each
356 download (minimum possible number of
357 seconds to sleep) when used along with
358 --max-sleep-interval.
359 --max-sleep-interval SECONDS Upper bound of a range for randomized sleep
360 before each download (maximum possible
361 number of seconds to sleep). Must only be
362 used along with --min-sleep-interval.
36f35428 363
cfcec693 364## Video Format Options:
c4af7684
PH
365 -f, --format FORMAT Video format code, see the "FORMAT
366 SELECTION" for all the info
1dc2726f 367 --all-formats Download all available video formats
c4af7684
PH
368 --prefer-free-formats Prefer free video formats unless a specific
369 one is requested
535d7b68 370 -F, --list-formats List all available formats of requested
bb6ac836 371 videos
c4af7684
PH
372 --youtube-skip-dash-manifest Do not download the DASH manifests and
373 related data on YouTube videos
78895bd3
U
374 --youtube-skip-hls-manifest Do not download the HLS manifests and
375 related data on YouTube videos
c4af7684
PH
376 --merge-output-format FORMAT If a merge is required (e.g.
377 bestvideo+bestaudio), output to given
378 container format. One of mkv, mp4, ogg,
379 webm, flv. Ignored if no merge is required
8ae7be3e
PH
380
381## Subtitle Options:
1dc2726f 382 --write-sub Write subtitle file
741dd8ea
RB
383 --write-auto-sub Write automatically generated subtitle file
384 (YouTube only)
c4af7684
PH
385 --all-subs Download all the available subtitles of the
386 video
1dc2726f 387 --list-subs List all available subtitles for the video
c4af7684
PH
388 --sub-format FORMAT Subtitle format, accepts formats
389 preference, for example: "srt" or
390 "ass/srt/best"
391 --sub-lang LANGS Languages of the subtitles to download
f733b053
PH
392 (optional) separated by commas, use --list-
393 subs for available language tags
6bcd846b 394
cfcec693 395## Authentication Options:
1dc2726f 396 -u, --username USERNAME Login with this account ID
c4af7684 397 -p, --password PASSWORD Account password. If this option is left
cefecac1 398 out, youtube-dlc will ask interactively.
dc48a354 399 -2, --twofactor TWOFACTOR Two-factor authentication code
1dc2726f 400 -n, --netrc Use .netrc authentication data
804c343a 401 --video-password PASSWORD Video password (vimeo, smotri, youku)
6bcd846b 402
f5e008d1
S
403## Adobe Pass Options:
404 --ap-mso MSO Adobe Pass multiple-system operator (TV
405 provider) identifier, use --ap-list-mso for
406 a list of available MSOs
407 --ap-username USERNAME Multiple-system operator account login
408 --ap-password PASSWORD Multiple-system operator account password.
e3671279
U
409 If this option is left out, youtube-dlc
410 will ask interactively.
f5e008d1
S
411 --ap-list-mso List all supported multiple-system
412 operators
413
cfcec693 414## Post-processing Options:
c4af7684
PH
415 -x, --extract-audio Convert video files to audio-only files
416 (requires ffmpeg or avconv and ffprobe or
417 avprobe)
418 --audio-format FORMAT Specify audio format: "best", "aac",
7d539ee1
S
419 "flac", "mp3", "m4a", "opus", "vorbis", or
420 "wav"; "best" by default; No effect without
421 -x
c4af7684
PH
422 --audio-quality QUALITY Specify ffmpeg/avconv audio quality, insert
423 a value between 0 (better) and 9 (worse)
424 for VBR or a specific bitrate like 128K
425 (default 5)
efe87a10
FS
426 --remux-video FORMAT Remux the video to another container format
427 if necessary (currently supported: mp4|mkv,
428 target container format must support video
429 / audio encoding, remuxing may fail)
c4af7684
PH
430 --recode-video FORMAT Encode the video to another format if
431 necessary (currently supported:
432 mp4|flv|ogg|webm|mkv|avi)
f72b0a60 433 --postprocessor-args ARGS Give these arguments to the postprocessor
c4af7684
PH
434 -k, --keep-video Keep the video file on disk after the post-
435 processing; the video is erased by default
436 --no-post-overwrites Do not overwrite post-processed files; the
437 post-processed files are overwritten by
438 default
0be8314d
PH
439 --embed-subs Embed subtitles in the video (only for mp4,
440 webm and mkv videos)
1dc2726f
PH
441 --embed-thumbnail Embed thumbnail in the audio as cover art
442 --add-metadata Write metadata to the video file
c4af7684
PH
443 --metadata-from-title FORMAT Parse additional metadata like song title /
444 artist from the video title. The format
6f3c632c
S
445 syntax is the same as --output. Regular
446 expression with named capture groups may
447 also be used. The parsed parameters replace
448 existing values. Example: --metadata-from-
449 title "%(artist)s - %(title)s" matches a
450 title like "Coldplay - Paradise". Example
451 (regex): --metadata-from-title
452 "(?P<artist>.+?) - (?P<title>.+)"
c4af7684
PH
453 --xattrs Write metadata to the video file's xattrs
454 (using dublin core and xdg standards)
455 --fixup POLICY Automatically correct known faults of the
456 file. One of never (do nothing), warn (only
457 emit a warning), detect_or_warn (the
458 default; fix file if we can, warn
459 otherwise)
460 --prefer-avconv Prefer avconv over ffmpeg for running the
c4af7684 461 postprocessors
689af496
S
462 --prefer-ffmpeg Prefer ffmpeg over avconv for running the
463 postprocessors (default)
c4af7684
PH
464 --ffmpeg-location PATH Location of the ffmpeg/avconv binary;
465 either the path to the binary or its
466 containing directory.
467 --exec CMD Execute a command on the file after
00a41ca4
S
468 downloading and post-processing, similar to
469 find's -exec syntax. Example: --exec 'adb
470 push {} /sdcard/Music/ && rm {}'
7de81fcc 471 --convert-subs FORMAT Convert the subtitles to other format
9fc41bcb 472 (currently supported: srt|ass|vtt|lrc)
6bcd846b 473
78895bd3 474## Extractor Options:
17cb02d0
U
475 --ignore-dynamic-mpd Do not process dynamic DASH manifests
476