]> Raphaƫl G. Git Repositories - youtubedl/blob - README.txt
debian/copyright: Update my copyright years.
[youtubedl] / README.txt
1 youtube-dl - download videos from youtube.com or other video platforms
2
3 - INSTALLATION
4 - DESCRIPTION
5 - OPTIONS
6 - CONFIGURATION
7 - OUTPUT TEMPLATE
8 - VIDEO SELECTION
9 - FAQ
10 - DEVELOPER INSTRUCTIONS
11 - BUGS
12 - COPYRIGHT
13
14 INSTALLATION
15 ============
16
17 To install it right away for all UNIX users (Linux, OS X, etc.), type:
18
19 sudo curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl
20 sudo chmod a+x /usr/local/bin/youtube-dl
21
22 If you do not have curl, you can alternatively use a recent wget:
23
24 sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
25 sudo chmod a+x /usr/local/bin/youtube-dl
26
27 Windows users can download a .exe file and place it in their home
28 directory or any other location on their PATH.
29
30 OS X users can install youtube-dl with Homebrew.
31
32 brew install youtube-dl
33
34 You can also use pip:
35
36 sudo pip install youtube-dl
37
38 Alternatively, refer to the developer instructions below for how to
39 check out and work with the git repository. For further options,
40 including PGP signatures, see
41 https://rg3.github.io/youtube-dl/download.html .
42
43 DESCRIPTION
44 ===========
45
46 youtube-dl is a small command-line program to download videos from
47 YouTube.com and a few more sites. It requires the Python interpreter,
48 version 2.6, 2.7, or 3.2+, and it is not platform specific. It should
49 work on your Unix box, on Windows or on Mac OS X. It is released to the
50 public domain, which means you can modify it, redistribute it or use it
51 however you like.
52
53 youtube-dl [OPTIONS] URL [URL...]
54
55 OPTIONS
56 =======
57
58 -h, --help print this help text and exit
59 --version print program version and exit
60 -U, --update update this program to latest version. Make
61 sure that you have sufficient permissions
62 (run with sudo if needed)
63 -i, --ignore-errors continue on download errors, for example to
64 skip unavailable videos in a playlist
65 --abort-on-error Abort downloading of further videos (in the
66 playlist or the command line) if an error
67 occurs
68 --dump-user-agent display the current browser identification
69 --list-extractors List all supported extractors and the URLs
70 they would handle
71 --extractor-descriptions Output descriptions of all supported
72 extractors
73 --default-search PREFIX Use this prefix for unqualified URLs. For
74 example "gvsearch2:" downloads two videos
75 from google videos for youtube-dl "large
76 apple". Use the value "auto" to let
77 youtube-dl guess ("auto_warning" to emit a
78 warning when guessing). "error" just throws
79 an error. The default value "fixup_error"
80 repairs broken URLs, but emits an error if
81 this is not possible instead of searching.
82 --ignore-config Do not read configuration files. When given
83 in the global configuration file /etc
84 /youtube-dl.conf: Do not read the user
85 configuration in ~/.config/youtube-
86 dl/config (%APPDATA%/youtube-dl/config.txt
87 on Windows)
88 --flat-playlist Do not extract the videos of a playlist,
89 only list them.
90 --no-color Do not emit color codes in output.
91
92 Network Options:
93 ----------------
94
95 --proxy URL Use the specified HTTP/HTTPS proxy. Pass in
96 an empty string (--proxy "") for direct
97 connection
98 --socket-timeout SECONDS Time to wait before giving up, in seconds
99 --source-address IP Client-side IP address to bind to
100 (experimental)
101 -4, --force-ipv4 Make all connections via IPv4
102 (experimental)
103 -6, --force-ipv6 Make all connections via IPv6
104 (experimental)
105
106 Video Selection:
107 ----------------
108
109 --playlist-start NUMBER playlist video to start at (default is 1)
110 --playlist-end NUMBER playlist video to end at (default is last)
111 --playlist-items ITEM_SPEC playlist video items to download. Specify
112 indices of the videos in the playlist
113 seperated by commas like: "--playlist-items
114 1,2,5,8" if you want to download videos
115 indexed 1, 2, 5, 8 in the playlist. You can
116 specify range: "--playlist-items
117 1-3,7,10-13", it will download the videos
118 at index 1, 2, 3, 7, 10, 11, 12 and 13.
119 --match-title REGEX download only matching titles (regex or
120 caseless sub-string)
121 --reject-title REGEX skip download for matching titles (regex or
122 caseless sub-string)
123 --max-downloads NUMBER Abort after downloading NUMBER files
124 --min-filesize SIZE Do not download any videos smaller than
125 SIZE (e.g. 50k or 44.6m)
126 --max-filesize SIZE Do not download any videos larger than SIZE
127 (e.g. 50k or 44.6m)
128 --date DATE download only videos uploaded in this date
129 --datebefore DATE download only videos uploaded on or before
130 this date (i.e. inclusive)
131 --dateafter DATE download only videos uploaded on or after
132 this date (i.e. inclusive)
133 --min-views COUNT Do not download any videos with less than
134 COUNT views
135 --max-views COUNT Do not download any videos with more than
136 COUNT views
137 --match-filter FILTER (Experimental) Generic video filter.
138 Specify any key (see help for -o for a list
139 of available keys) to match if the key is
140 present, !key to check if the key is not
141 present,key > NUMBER (like "comment_count >
142 12", also works with >=, <, <=, !=, =) to
143 compare against a number, and & to require
144 multiple matches. Values which are not
145 known are excluded unless you put a
146 question mark (?) after the operator.For
147 example, to only match videos that have
148 been liked more than 100 times and disliked
149 less than 50 times (or the dislike
150 functionality is not available at the given
151 service), but who also have a description,
152 use --match-filter "like_count > 100 &
153 dislike_count <? 50 & description" .
154 --no-playlist If the URL refers to a video and a
155 playlist, download only the video.
156 --yes-playlist If the URL refers to a video and a
157 playlist, download the playlist.
158 --age-limit YEARS download only videos suitable for the given
159 age
160 --download-archive FILE Download only videos not listed in the
161 archive file. Record the IDs of all
162 downloaded videos in it.
163 --include-ads Download advertisements as well
164 (experimental)
165
166 Download Options:
167 -----------------
168
169 -r, --rate-limit LIMIT maximum download rate in bytes per second
170 (e.g. 50K or 4.2M)
171 -R, --retries RETRIES number of retries (default is 10), or
172 "infinite".
173 --buffer-size SIZE size of download buffer (e.g. 1024 or 16K)
174 (default is 1024)
175 --no-resize-buffer do not automatically adjust the buffer
176 size. By default, the buffer size is
177 automatically resized from an initial value
178 of SIZE.
179 --playlist-reverse Download playlist videos in reverse order
180 --xattr-set-filesize (experimental) set file xattribute
181 ytdl.filesize with expected filesize
182 --hls-prefer-native (experimental) Use the native HLS
183 downloader instead of ffmpeg.
184 --external-downloader COMMAND (experimental) Use the specified external
185 downloader. Currently supports
186 aria2c,curl,wget
187
188 Filesystem Options:
189 -------------------
190
191 -a, --batch-file FILE file containing URLs to download ('-' for
192 stdin)
193 --id use only video ID in file name
194 -o, --output TEMPLATE output filename template. Use %(title)s to
195 get the title, %(uploader)s for the
196 uploader name, %(uploader_id)s for the
197 uploader nickname if different,
198 %(autonumber)s to get an automatically
199 incremented number, %(ext)s for the
200 filename extension, %(format)s for the
201 format description (like "22 - 1280x720" or
202 "HD"), %(format_id)s for the unique id of
203 the format (like Youtube's itags: "137"),
204 %(upload_date)s for the upload date
205 (YYYYMMDD), %(extractor)s for the provider
206 (youtube, metacafe, etc), %(id)s for the
207 video id, %(playlist_title)s,
208 %(playlist_id)s, or %(playlist)s (=title if
209 present, ID otherwise) for the playlist the
210 video is in, %(playlist_index)s for the
211 position in the playlist. %(height)s and
212 %(width)s for the width and height of the
213 video format. %(resolution)s for a textual
214 description of the resolution of the video
215 format. %% for a literal percent. Use - to
216 output to stdout. Can also be used to
217 download to a different directory, for
218 example with -o '/my/downloads/%(uploader)s
219 /%(title)s-%(id)s.%(ext)s' .
220 --autonumber-size NUMBER Specifies the number of digits in
221 %(autonumber)s when it is present in output
222 filename template or --auto-number option
223 is given
224 --restrict-filenames Restrict filenames to only ASCII
225 characters, and avoid "&" and spaces in
226 filenames
227 -A, --auto-number [deprecated; use -o
228 "%(autonumber)s-%(title)s.%(ext)s" ] number
229 downloaded files starting from 00000
230 -t, --title [deprecated] use title in file name
231 (default)
232 -l, --literal [deprecated] alias of --title
233 -w, --no-overwrites do not overwrite files
234 -c, --continue force resume of partially downloaded files.
235 By default, youtube-dl will resume
236 downloads if possible.
237 --no-continue do not resume partially downloaded files
238 (restart from beginning)
239 --no-part do not use .part files - write directly
240 into output file
241 --no-mtime do not use the Last-modified header to set
242 the file modification time
243 --write-description write video description to a .description
244 file
245 --write-info-json write video metadata to a .info.json file
246 --write-annotations write video annotations to a .annotation
247 file
248 --load-info FILE json file containing the video information
249 (created with the "--write-json" option)
250 --cookies FILE file to read cookies from and dump cookie
251 jar in
252 --cache-dir DIR Location in the filesystem where youtube-dl
253 can store some downloaded information
254 permanently. By default $XDG_CACHE_HOME
255 /youtube-dl or ~/.cache/youtube-dl . At the
256 moment, only YouTube player files (for
257 videos with obfuscated signatures) are
258 cached, but that may change.
259 --no-cache-dir Disable filesystem caching
260 --rm-cache-dir Delete all filesystem cache files
261
262 Thumbnail images:
263 -----------------
264
265 --write-thumbnail write thumbnail image to disk
266 --write-all-thumbnails write all thumbnail image formats to disk
267 --list-thumbnails Simulate and list all available thumbnail
268 formats
269
270 Verbosity / Simulation Options:
271 -------------------------------
272
273 -q, --quiet activates quiet mode
274 --no-warnings Ignore warnings
275 -s, --simulate do not download the video and do not write
276 anything to disk
277 --skip-download do not download the video
278 -g, --get-url simulate, quiet but print URL
279 -e, --get-title simulate, quiet but print title
280 --get-id simulate, quiet but print id
281 --get-thumbnail simulate, quiet but print thumbnail URL
282 --get-description simulate, quiet but print video description
283 --get-duration simulate, quiet but print video length
284 --get-filename simulate, quiet but print output filename
285 --get-format simulate, quiet but print output format
286 -j, --dump-json simulate, quiet but print JSON information.
287 See --output for a description of available
288 keys.
289 -J, --dump-single-json simulate, quiet but print JSON information
290 for each command-line argument. If the URL
291 refers to a playlist, dump the whole
292 playlist information in a single line.
293 --print-json Be quiet and print the video information as
294 JSON (video is still being downloaded).
295 --newline output progress bar as new lines
296 --no-progress do not print progress bar
297 --console-title display progress in console titlebar
298 -v, --verbose print various debugging information
299 --dump-intermediate-pages print downloaded pages to debug problems
300 (very verbose)
301 --write-pages Write downloaded intermediary pages to
302 files in the current directory to debug
303 problems
304 --print-traffic Display sent and read HTTP traffic
305 -C, --call-home Contact the youtube-dl server for
306 debugging.
307 --no-call-home Do NOT contact the youtube-dl server for
308 debugging.
309
310 Workarounds:
311 ------------
312
313 --encoding ENCODING Force the specified encoding (experimental)
314 --no-check-certificate Suppress HTTPS certificate validation.
315 --prefer-insecure Use an unencrypted connection to retrieve
316 information about the video. (Currently
317 supported only for YouTube)
318 --user-agent UA specify a custom user agent
319 --referer URL specify a custom referer, use if the video
320 access is restricted to one domain
321 --add-header FIELD:VALUE specify a custom HTTP header and its value,
322 separated by a colon ':'. You can use this
323 option multiple times
324 --bidi-workaround Work around terminals that lack
325 bidirectional text support. Requires bidiv
326 or fribidi executable in PATH
327 --sleep-interval SECONDS Number of seconds to sleep before each
328 download.
329
330 Video Format Options:
331 ---------------------
332
333 -f, --format FORMAT video format code, specify the order of
334 preference using slashes, as in -f 22/17/18
335 . Instead of format codes, you can select
336 by extension for the extensions aac, m4a,
337 mp3, mp4, ogg, wav, webm. You can also use
338 the special names "best", "bestvideo",
339 "bestaudio", "worst". You can filter the
340 video results by putting a condition in
341 brackets, as in -f "best[height=720]" (or
342 -f "[filesize>10M]"). This works for
343 filesize, height, width, tbr, abr, vbr,
344 asr, and fps and the comparisons <, <=, >,
345 >=, =, != and for ext, acodec, vcodec,
346 container, and protocol and the comparisons
347 =, != . Formats for which the value is not
348 known are excluded unless you put a
349 question mark (?) after the operator. You
350 can combine format filters, so -f "[height
351 <=? 720][tbr>500]" selects up to 720p
352 videos (or videos where the height is not
353 known) with a bitrate of at least 500
354 KBit/s. By default, youtube-dl will pick
355 the best quality. Use commas to download
356 multiple audio formats, such as -f
357 136/137/mp4/bestvideo,140/m4a/bestaudio.
358 You can merge the video and audio of two
359 formats into a single file using -f <video-
360 format>+<audio-format> (requires ffmpeg or
361 avconv), for example -f
362 bestvideo+bestaudio.
363 --all-formats download all available video formats
364 --prefer-free-formats prefer free video formats unless a specific
365 one is requested
366 --max-quality FORMAT highest quality format to download
367 -F, --list-formats list all available formats
368 --youtube-skip-dash-manifest Do not download the DASH manifest on
369 YouTube videos
370 --merge-output-format FORMAT If a merge is required (e.g.
371 bestvideo+bestaudio), output to given
372 container format. One of mkv, mp4, ogg,
373 webm, flv.Ignored if no merge is required
374
375 Subtitle Options:
376 -----------------
377
378 --write-sub write subtitle file
379 --write-auto-sub write automatic subtitle file (youtube
380 only)
381 --all-subs downloads all the available subtitles of
382 the video
383 --list-subs lists all available subtitles for the video
384 --sub-format FORMAT subtitle format, accepts formats
385 preference, for example: "ass/srt/best"
386 --sub-lang LANGS languages of the subtitles to download
387 (optional) separated by commas, use IETF
388 language tags like 'en,pt'
389
390 Authentication Options:
391 -----------------------
392
393 -u, --username USERNAME login with this account ID
394 -p, --password PASSWORD account password. If this option is left
395 out, youtube-dl will ask interactively.
396 -2, --twofactor TWOFACTOR two-factor auth code
397 -n, --netrc use .netrc authentication data
398 --video-password PASSWORD video password (vimeo, smotri)
399
400 Post-processing Options:
401 ------------------------
402
403 -x, --extract-audio convert video files to audio-only files
404 (requires ffmpeg or avconv and ffprobe or
405 avprobe)
406 --audio-format FORMAT "best", "aac", "vorbis", "mp3", "m4a",
407 "opus", or "wav"; "best" by default
408 --audio-quality QUALITY ffmpeg/avconv audio quality specification,
409 insert a value between 0 (better) and 9
410 (worse) for VBR or a specific bitrate like
411 128K (default 5)
412 --recode-video FORMAT Encode the video to another format if
413 necessary (currently supported:
414 mp4|flv|ogg|webm|mkv)
415 -k, --keep-video keeps the video file on disk after the
416 post-processing; the video is erased by
417 default
418 --no-post-overwrites do not overwrite post-processed files; the
419 post-processed files are overwritten by
420 default
421 --embed-subs embed subtitles in the video (only for mp4
422 videos)
423 --embed-thumbnail embed thumbnail in the audio as cover art
424 --add-metadata write metadata to the video file
425 --xattrs write metadata to the video file's xattrs
426 (using dublin core and xdg standards)
427 --fixup POLICY Automatically correct known faults of the
428 file. One of never (do nothing), warn (only
429 emit a warning), detect_or_warn(the
430 default; fix file if we can, warn
431 otherwise)
432 --prefer-avconv Prefer avconv over ffmpeg for running the
433 postprocessors (default)
434 --prefer-ffmpeg Prefer ffmpeg over avconv for running the
435 postprocessors
436 --ffmpeg-location PATH Location of the ffmpeg/avconv binary;
437 either the path to the binary or its
438 containing directory.
439 --exec CMD Execute a command on the file after
440 downloading, similar to find's -exec
441 syntax. Example: --exec 'adb push {}
442 /sdcard/Music/ && rm {}'
443 --convert-subtitles FORMAT Convert the subtitles to other format
444 (currently supported: srt|ass|vtt)
445
446 CONFIGURATION
447 =============
448
449 You can configure youtube-dl by placing default arguments (such as
450 --extract-audio --no-mtime to always extract the audio and not copy the
451 mtime) into /etc/youtube-dl.conf and/or ~/.config/youtube-dl/config. On
452 Windows, the configuration file locations are
453 %APPDATA%\youtube-dl\config.txt and
454 C:\Users\<user name>\youtube-dl.conf.
455
456 OUTPUT TEMPLATE
457 ===============
458
459 The -o option allows users to indicate a template for the output file
460 names. The basic usage is not to set any template arguments when
461 downloading a single file, like in
462 youtube-dl -o funny_video.flv "http://some/video". However, it may
463 contain special sequences that will be replaced when downloading each
464 video. The special sequences have the format %(NAME)s. To clarify, that
465 is a percent symbol followed by a name in parenthesis, followed by a
466 lowercase S. Allowed names are:
467
468 - id: The sequence will be replaced by the video identifier.
469 - url: The sequence will be replaced by the video URL.
470 - uploader: The sequence will be replaced by the nickname of the
471 person who uploaded the video.
472 - upload_date: The sequence will be replaced by the upload date in
473 YYYYMMDD format.
474 - title: The sequence will be replaced by the video title.
475 - ext: The sequence will be replaced by the appropriate extension
476 (like flv or mp4).
477 - epoch: The sequence will be replaced by the Unix epoch when creating
478 the file.
479 - autonumber: The sequence will be replaced by a five-digit number
480 that will be increased with each download, starting at zero.
481 - playlist: The name or the id of the playlist that contains the
482 video.
483 - playlist_index: The index of the video in the playlist, a five-digit
484 number.
485
486 The current default template is %(title)s-%(id)s.%(ext)s.
487
488 In some cases, you don't want special characters such as äø­, spaces, or
489 &, such as when transferring the downloaded filename to a Windows system
490 or the filename through an 8bit-unsafe channel. In these cases, add the
491 --restrict-filenames flag to get a shorter title:
492
493 ``` {.bash}
494 $ youtube-dl --get-filename -o "%(title)s.%(ext)s" BaW_jenozKc
495 youtube-dl test video ''_Ƥā†­š•.mp4 # All kinds of weird characters
496 $ youtube-dl --get-filename -o "%(title)s.%(ext)s" BaW_jenozKc --restrict-filenames
497 youtube-dl_test_video_.mp4 # A simple file name
498 ```
499
500 VIDEO SELECTION
501 ===============
502
503 Videos can be filtered by their upload date using the options --date,
504 --datebefore or --dateafter, they accept dates in two formats:
505
506 - Absolute dates: Dates in the format YYYYMMDD.
507 - Relative dates: Dates in the format
508 (now|today)[+-][0-9](day|week|month|year)(s)?
509
510 Examples:
511
512 ``` {.bash}
513 # Download only the videos uploaded in the last 6 months
514 $ youtube-dl --dateafter now-6months
515
516 # Download only the videos uploaded on January 1, 1970
517 $ youtube-dl --date 19700101
518
519 $ # will only download the videos uploaded in the 200x decade
520 $ youtube-dl --dateafter 20000101 --datebefore 20091231
521 ```
522
523 FAQ
524 ===
525
526 How do I update youtube-dl?
527
528 If you've followed our manual installation instructions, you can simply
529 run youtube-dl -U (or, on Linux, sudo youtube-dl -U).
530
531 If you have used pip, a simple sudo pip install -U youtube-dl is
532 sufficient to update.
533
534 If you have installed youtube-dl using a package manager like apt-get or
535 yum, use the standard system update mechanism to update. Note that
536 distribution packages are often outdated. As a rule of thumb, youtube-dl
537 releases at least once a month, and often weekly or even daily. Simply
538 go to http://yt-dl.org/ to find out the current version. Unfortunately,
539 there is nothing we youtube-dl developers can do if your distributions
540 serves a really outdated version. You can (and should) complain to your
541 distribution in their bugtracker or support forum.
542
543 As a last resort, you can also uninstall the version installed by your
544 package manager and follow our manual installation instructions. For
545 that, remove the distribution's package, with a line like
546
547 sudo apt-get remove -y youtube-dl
548
549 Afterwards, simply follow our manual installation instructions:
550
551 sudo wget https://yt-dl.org/latest/youtube-dl -O /usr/local/bin/youtube-dl
552 sudo chmod a+x /usr/local/bin/youtube-dl
553 hash -r
554
555 Again, from then on you'll be able to update with sudo youtube-dl -U.
556
557 I'm getting an error Unable to extract OpenGraph title on YouTube playlists
558
559 YouTube changed their playlist format in March 2014 and later on, so
560 you'll need at least youtube-dl 2014.07.25 to download all YouTube
561 videos.
562
563 If you have installed youtube-dl with a package manager, pip, setup.py
564 or a tarball, please use that to update. Note that Ubuntu packages do
565 not seem to get updated anymore. Since we are not affiliated with
566 Ubuntu, there is little we can do. Feel free to report bugs to the
567 Ubuntu packaging guys - all they have to do is update the package to a
568 somewhat recent version. See above for a way to update.
569
570 Do I always have to pass in --max-quality FORMAT, or -citw?
571
572 By default, youtube-dl intends to have the best options (incidentally,
573 if you have a convincing case that these should be different, please
574 file an issue where you explain that). Therefore, it is unnecessary and
575 sometimes harmful to copy long option strings from webpages. In
576 particular, --max-quality limits the video quality (so if you want the
577 best quality, do NOT pass it in), and the only option out of -citw that
578 is regularly useful is -i.
579
580 Can you please put the -b option back?
581
582 Most people asking this question are not aware that youtube-dl now
583 defaults to downloading the highest available quality as reported by
584 YouTube, which will be 1080p or 720p in some cases, so you no longer
585 need the -b option. For some specific videos, maybe YouTube does not
586 report them to be available in a specific high quality format you're
587 interested in. In that case, simply request it with the -f option and
588 youtube-dl will try to download it.
589
590 I get HTTP error 402 when trying to download a video. What's this?
591
592 Apparently YouTube requires you to pass a CAPTCHA test if you download
593 too much. We're considering to provide a way to let you solve the
594 CAPTCHA, but at the moment, your best course of action is pointing a
595 webbrowser to the youtube URL, solving the CAPTCHA, and restart
596 youtube-dl.
597
598 I have downloaded a video but how can I play it?
599
600 Once the video is fully downloaded, use any video player, such as vlc or
601 mplayer.
602
603 I extracted a video URL with -g, but it does not play on another machine / in my webbrowser.
604
605 It depends a lot on the service. In many cases, requests for the video
606 (to download/play it) must come from the same IP address and with the
607 same cookies. Use the --cookies option to write the required cookies
608 into a file, and advise your downloader to read cookies from that file.
609 Some sites also require a common user agent to be used, use
610 --dump-user-agent to see the one in use by youtube-dl.
611
612 It may be beneficial to use IPv6; in some cases, the restrictions are
613 only applied to IPv4. Some services (sometimes only for a subset of
614 videos) do not restrict the video URL by IP address, cookie, or
615 user-agent, but these are the exception rather than the rule.
616
617 Please bear in mind that some URL protocols are not supported by
618 browsers out of the box, including RTMP. If you are using -g, your own
619 downloader must support these as well.
620
621 If you want to play the video on a machine that is not running
622 youtube-dl, you can relay the video content from the machine that runs
623 youtube-dl. You can use -o - to let youtube-dl stream a video to stdout,
624 or simply allow the player to download the files written by youtube-dl
625 in turn.
626
627 ERROR: no fmt_url_map or conn information found in video info
628
629 YouTube has switched to a new video info format in July 2011 which is
630 not supported by old versions of youtube-dl. See above for how to update
631 youtube-dl.
632
633 ERROR: unable to download video
634
635 YouTube requires an additional signature since September 2012 which is
636 not supported by old versions of youtube-dl. See above for how to update
637 youtube-dl.
638
639 ExtractorError: Could not find JS function u'OF'
640
641 In February 2015, the new YouTube player contained a character sequence
642 in a string that was misinterpreted by old versions of youtube-dl. See
643 above for how to update youtube-dl.
644
645 SyntaxError: Non-ASCII character
646
647 The error
648
649 File "youtube-dl", line 2
650 SyntaxError: Non-ASCII character '\x93' ...
651
652 means you're using an outdated version of Python. Please update to
653 Python 2.6 or 2.7.
654
655 What is this binary file? Where has the code gone?
656
657 Since June 2012 (#342) youtube-dl is packed as an executable zipfile,
658 simply unzip it (might need renaming to youtube-dl.zip first on some
659 systems) or clone the git repository, as laid out above. If you modify
660 the code, you can run it by executing the __main__.py file. To recompile
661 the executable, run make youtube-dl.
662
663 The exe throws a Runtime error from Visual C++
664
665 To run the exe you need to install first the Microsoft Visual C++ 2008
666 Redistributable Package.
667
668 On Windows, how should I set up ffmpeg and youtube-dl? Where should I put the exe files?
669
670 If you put youtube-dl and ffmpeg in the same directory that you're
671 running the command from, it will work, but that's rather cumbersome.
672
673 To make a different directory work - either for ffmpeg, or for
674 youtube-dl, or for both - simply create the directory (say, C:\bin, or
675 C:\Users\<User name>\bin), put all the executables directly in there,
676 and then set your PATH environment variable to include that directory.
677
678 From then on, after restarting your shell, you will be able to access
679 both youtube-dl and ffmpeg (and youtube-dl will be able to find ffmpeg)
680 by simply typing youtube-dl or ffmpeg, no matter what directory you're
681 in.
682
683 How do I put downloads into a specific folder?
684
685 Use the -o to specify an output template, for example
686 -o "/home/user/videos/%(title)s-%(id)s.%(ext)s". If you want this for
687 all of your downloads, put the option into your configuration file.
688
689 How do I download a video starting with a - ?
690
691 Either prepend http://www.youtube.com/watch?v= or separate the ID from
692 the options with --:
693
694 youtube-dl -- -wNyEUrxzFU
695 youtube-dl "http://www.youtube.com/watch?v=-wNyEUrxzFU"
696
697 Can you add support for this anime video site, or site which shows current movies for free?
698
699 As a matter of policy (as well as legality), youtube-dl does not include
700 support for services that specialize in infringing copyright. As a rule
701 of thumb, if you cannot easily find a video that the service is quite
702 obviously allowed to distribute (i.e. that has been uploaded by the
703 creator, the creator's distributor, or is published under a free
704 license), the service is probably unfit for inclusion to youtube-dl.
705
706 A note on the service that they don't host the infringing content, but
707 just link to those who do, is evidence that the service should not be
708 included into youtube-dl. The same goes for any DMCA note when the whole
709 front page of the service is filled with videos they are not allowed to
710 distribute. A "fair use" note is equally unconvincing if the service
711 shows copyright-protected videos in full without authorization.
712
713 Support requests for services that do purchase the rights to distribute
714 their content are perfectly fine though. If in doubt, you can simply
715 include a source that mentions the legitimate purchase of content.
716
717 How can I detect whether a given URL is supported by youtube-dl?
718
719 For one, have a look at the list of supported sites. Note that it can
720 sometimes happen that the site changes its URL scheme (say, from
721 http://example.com/video/1234567 to http://example.com/v/1234567 ) and
722 youtube-dl reports an URL of a service in that list as unsupported. In
723 that case, simply report a bug.
724
725 It is not possible to detect whether a URL is supported or not. That's
726 because youtube-dl contains a generic extractor which matches all URLs.
727 You may be tempted to disable, exclude, or remove the generic extractor,
728 but the generic extractor not only allows users to extract videos from
729 lots of websites that embed a video from another service, but may also
730 be used to extract video from a service that it's hosting itself.
731 Therefore, we neither recommend nor support disabling, excluding, or
732 removing the generic extractor.
733
734 If you want to find out whether a given URL is supported, simply call
735 youtube-dl with it. If you get no videos back, chances are the URL is
736 either not referring to a video or unsupported. You can find out which
737 by examining the output (if you run youtube-dl on the console) or
738 catching an UnsupportedError exception if you run it from a Python
739 program.
740
741 DEVELOPER INSTRUCTIONS
742 ======================
743
744 Most users do not need to build youtube-dl and can download the builds
745 or get them from their distribution.
746
747 To run youtube-dl as a developer, you don't need to build anything
748 either. Simply execute
749
750 python -m youtube_dl
751
752 To run the test, simply invoke your favorite test runner, or execute a
753 test file directly; any of the following work:
754
755 python -m unittest discover
756 python test/test_download.py
757 nosetests
758
759 If you want to create a build of youtube-dl yourself, you'll need
760
761 - python
762 - make
763 - pandoc
764 - zip
765 - nosetests
766
767 Adding support for a new site
768
769 If you want to add support for a new site, you can follow this quick
770 list (assuming your service is called yourextractor):
771
772 1. Fork this repository
773 2. Check out the source code with
774 git clone git@github.com:YOUR_GITHUB_USERNAME/youtube-dl.git
775 3. Start a new git branch with
776 cd youtube-dl; git checkout -b yourextractor
777 4. Start with this simple template and save it to
778 youtube_dl/extractor/yourextractor.py:
779
780 ``` {.python}
781 # coding: utf-8
782 from __future__ import unicode_literals
783
784 from .common import InfoExtractor
785
786
787 class YourExtractorIE(InfoExtractor):
788 _VALID_URL = r'https?://(?:www\.)?yourextractor\.com/watch/(?P<id>[0-9]+)'
789 _TEST = {
790 'url': 'http://yourextractor.com/watch/42',
791 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)',
792 'info_dict': {
793 'id': '42',
794 'ext': 'mp4',
795 'title': 'Video title goes here',
796 'thumbnail': 're:^https?://.*\.jpg$',
797 # TODO more properties, either as:
798 # * A value
799 # * MD5 checksum; start the string with md5:
800 # * A regular expression; start the string with re:
801 # * Any Python type (for example int or float)
802 }
803 }
804
805 def _real_extract(self, url):
806 video_id = self._match_id(url)
807 webpage = self._download_webpage(url, video_id)
808
809 # TODO more code goes here, for example ...
810 title = self._html_search_regex(r'<h1>(.*?)</h1>', webpage, 'title')
811
812 return {
813 'id': video_id,
814 'title': title,
815 'description': self._og_search_description(webpage),
816 # TODO more properties (see youtube_dl/extractor/common.py)
817 }
818 ```
819
820 5. Add an import in youtube_dl/extractor/__init__.py.
821 6. Run python test/test_download.py TestDownload.test_YourExtractor.
822 This should fail at first, but you can continually re-run it until
823 you're done. If you decide to add more than one test, then rename
824 _TEST to _TESTS and make it into a list of dictionaries. The tests
825 will be then be named TestDownload.test_YourExtractor,
826 TestDownload.test_YourExtractor_1,
827 TestDownload.test_YourExtractor_2, etc.
828 7. Have a look at youtube_dl/common/extractor/common.py for possible
829 helper methods and a detailed description of what your extractor
830 should return. Add tests and code for as many as you want.
831 8. If you can, check the code with flake8.
832 9. When the tests pass, add the new files and commit them and push the
833 result, like this:
834
835 $ git add youtube_dl/extractor/__init__.py
836 $ git add youtube_dl/extractor/yourextractor.py
837 $ git commit -m '[yourextractor] Add new extractor'
838 $ git push origin yourextractor
839
840 10. Finally, create a pull request. We'll then review and merge it.
841
842 In any case, thank you very much for your contributions!
843
844 EMBEDDING YOUTUBE-DL
845 ====================
846
847 youtube-dl makes the best effort to be a good command-line program, and
848 thus should be callable from any programming language. If you encounter
849 any problems parsing its output, feel free to create a report.
850
851 From a Python program, you can embed youtube-dl in a more powerful
852 fashion, like this:
853
854 ``` {.python}
855 import youtube_dl
856
857 ydl_opts = {}
858 with youtube_dl.YoutubeDL(ydl_opts) as ydl:
859 ydl.download(['http://www.youtube.com/watch?v=BaW_jenozKc'])
860 ```
861
862 Most likely, you'll want to use various options. For a list of what can
863 be done, have a look at youtube_dl/YoutubeDL.py. For a start, if you
864 want to intercept youtube-dl's output, set a logger object.
865
866 Here's a more complete example of a program that outputs only errors
867 (and a short message after the download is finished), and
868 downloads/converts the video to an mp3 file:
869
870 ``` {.python}
871 import youtube_dl
872
873
874 class MyLogger(object):
875 def debug(self, msg):
876 pass
877
878 def warning(self, msg):
879 pass
880
881 def error(self, msg):
882 print(msg)
883
884
885 def my_hook(d):
886 if d['status'] == 'finished':
887 print('Done downloading, now converting ...')
888
889
890 ydl_opts = {
891 'format': 'bestaudio/best',
892 'postprocessors': [{
893 'key': 'FFmpegExtractAudio',
894 'preferredcodec': 'mp3',
895 'preferredquality': '192',
896 }],
897 'logger': MyLogger(),
898 'progress_hooks': [my_hook],
899 }
900 with youtube_dl.YoutubeDL(ydl_opts) as ydl:
901 ydl.download(['http://www.youtube.com/watch?v=BaW_jenozKc'])
902 ```
903
904 BUGS
905 ====
906
907 Bugs and suggestions should be reported at:
908 https://github.com/rg3/youtube-dl/issues . Unless you were prompted so
909 or there is another pertinent reason (e.g. GitHub fails to accept the
910 bug report), please do not send bug reports via personal email. For
911 discussions, join us in the irc channel #youtube-dl on freenode.
912
913 Please include the full output of youtube-dl when run with -v.
914
915 The output (including the first lines) contain important debugging
916 information. Issues without the full output are often not reproducible
917 and therefore do not get solved in short order, if ever.
918
919 Please re-read your issue once again to avoid a couple of common
920 mistakes (you can and should use this as a checklist):
921
922 Is the description of the issue itself sufficient?
923
924 We often get issue reports that we cannot really decipher. While in most
925 cases we eventually get the required information after asking back
926 multiple times, this poses an unnecessary drain on our resources. Many
927 contributors, including myself, are also not native speakers, so we may
928 misread some parts.
929
930 So please elaborate on what feature you are requesting, or what bug you
931 want to be fixed. Make sure that it's obvious
932
933 - What the problem is
934 - How it could be fixed
935 - How your proposed solution would look like
936
937 If your report is shorter than two lines, it is almost certainly missing
938 some of these, which makes it hard for us to respond to it. We're often
939 too polite to close the issue outright, but the missing info makes
940 misinterpretation likely. As a commiter myself, I often get frustrated
941 by these issues, since the only possible way for me to move forward on
942 them is to ask for clarification over and over.
943
944 For bug reports, this means that your report should contain the complete
945 output of youtube-dl when called with the -v flag. The error message you
946 get for (most) bugs even says so, but you would not believe how many of
947 our bug reports do not contain this information.
948
949 Site support requests must contain an example URL. An example URL is a
950 URL you might want to download, like
951 http://www.youtube.com/watch?v=BaW_jenozKc . There should be an obvious
952 video present. Except under very special circumstances, the main page of
953 a video service (e.g. http://www.youtube.com/ ) is not an example URL.
954
955 Are you using the latest version?
956
957 Before reporting any issue, type youtube-dl -U. This should report that
958 you're up-to-date. About 20% of the reports we receive are already
959 fixed, but people are using outdated versions. This goes for feature
960 requests as well.
961
962 Is the issue already documented?
963
964 Make sure that someone has not already opened the issue you're trying to
965 open. Search at the top of the window or at
966 https://github.com/rg3/youtube-dl/search?type=Issues . If there is an
967 issue, feel free to write something along the lines of "This affects me
968 as well, with version 2015.01.01. Here is some more information on the
969 issue: ...". While some issues may be old, a new post into them often
970 spurs rapid activity.
971
972 Why are existing options not enough?
973
974 Before requesting a new feature, please have a quick peek at the list of
975 supported options. Many feature requests are for features that actually
976 exist already! Please, absolutely do show off your work in the issue
977 report and detail how the existing similar options do not solve your
978 problem.
979
980 Is there enough context in your bug report?
981
982 People want to solve problems, and often think they do us a favor by
983 breaking down their larger problems (e.g. wanting to skip already
984 downloaded files) to a specific request (e.g. requesting us to look
985 whether the file exists before downloading the info page). However, what
986 often happens is that they break down the problem into two steps: One
987 simple, and one impossible (or extremely complicated one).
988
989 We are then presented with a very complicated request when the original
990 problem could be solved far easier, e.g. by recording the downloaded
991 video IDs in a separate file. To avoid this, you must include the
992 greater context where it is non-obvious. In particular, every feature
993 request that does not consist of adding support for a new site should
994 contain a use case scenario that explains in what situation the missing
995 feature would be useful.
996
997 Does the issue involve one problem, and one problem only?
998
999 Some of our users seem to think there is a limit of issues they can or
1000 should open. There is no limit of issues they can or should open. While
1001 it may seem appealing to be able to dump all your issues into one
1002 ticket, that means that someone who solves one of your issues cannot
1003 mark the issue as closed. Typically, reporting a bunch of issues leads
1004 to the ticket lingering since nobody wants to attack that behemoth,
1005 until someone mercifully splits the issue into multiple ones.
1006
1007 In particular, every site support request issue should only pertain to
1008 services at one site (generally under a common domain, but always using
1009 the same backend technology). Do not request support for vimeo user
1010 videos, Whitehouse podcasts, and Google Plus pages in the same issue.
1011 Also, make sure that you don't post bug reports alongside feature
1012 requests. As a rule of thumb, a feature request does not include outputs
1013 of youtube-dl that are not immediately related to the feature at hand.
1014 Do not post reports of a network error alongside the request for a new
1015 video service.
1016
1017 Is anyone going to need the feature?
1018
1019 Only post features that you (or an incapacitated friend you can
1020 personally talk to) require. Do not post features because they seem like
1021 a good idea. If they are really useful, they will be requested by
1022 someone who requires them.
1023
1024 Is your question about youtube-dl?
1025
1026 It may sound strange, but some bug reports we receive are completely
1027 unrelated to youtube-dl and relate to a different or even the reporter's
1028 own application. Please make sure that you are actually using
1029 youtube-dl. If you are using a UI for youtube-dl, report the bug to the
1030 maintainer of the actual application providing the UI. On the other
1031 hand, if your UI for youtube-dl fails in some way you believe is related
1032 to youtube-dl, by all means, go ahead and report the bug.
1033
1034 COPYRIGHT
1035 =========
1036
1037 youtube-dl is released into the public domain by the copyright holders.
1038
1039 This README file was originally written by Daniel Bolton
1040 (https://github.com/dbbolton) and is likewise released into the public
1041 domain.
1042