1 .TH "YOUTUBE\-DL" "1" "" "" ""
4 youtube\-dl \- download videos from youtube.com or other video platforms
7 \f[B]youtube\-dl\f[] [OPTIONS] URL [URL...]
10 \f[B]youtube\-dl\f[] is a small command\-line program to download videos
11 from YouTube.com and a few more sites.
12 It requires the Python interpreter, version 2.6, 2.7, or 3.2+, and it is
13 not platform specific.
14 It should work on your Unix box, on Windows or on Mac OS X.
15 It is released to the public domain, which means you can modify it,
16 redistribute it or use it however you like.
20 Print this help text and exit
25 Print program version and exit
30 Update this program to latest version.
31 Make sure that you have sufficient permissions (run with sudo if needed)
35 .B \-i, \-\-ignore\-errors
36 Continue on download errors, for example to skip unavailable videos in a
41 .B \-\-abort\-on\-error
42 Abort downloading of further videos (in the playlist or the command
43 line) if an error occurs
47 .B \-\-dump\-user\-agent
48 Display the current browser identification
52 .B \-\-list\-extractors
53 List all supported extractors
57 .B \-\-extractor\-descriptions
58 Output descriptions of all supported extractors
62 .B \-\-force\-generic\-extractor
63 Force extraction to use the generic extractor
67 .B \-\-default\-search \f[I]PREFIX\f[]
68 Use this prefix for unqualified URLs.
69 For example "gvsearch2:" downloads two videos from google videos for
70 youtube\-dl "large apple".
71 Use the value "auto" to let youtube\-dl guess ("auto_warning" to emit a
72 warning when guessing).
73 "error" just throws an error.
74 The default value "fixup_error" repairs broken URLs, but emits an error
75 if this is not possible instead of searching.
80 Do not read configuration files.
81 When given in the global configuration file /etc /youtube\-dl.conf: Do
82 not read the user configuration in ~/.config/youtube\- dl/config
83 (%APPDATA%/youtube\-dl/config.txt on Windows)
88 Do not extract the videos of a playlist, only list them.
93 Do not emit color codes in output
98 .B \-\-proxy \f[I]URL\f[]
99 Use the specified HTTP/HTTPS proxy.
100 Pass in an empty string (\-\-proxy "") for direct connection
104 .B \-\-socket\-timeout \f[I]SECONDS\f[]
105 Time to wait before giving up, in seconds
109 .B \-\-source\-address \f[I]IP\f[]
110 Client\-side IP address to bind to (experimental)
114 .B \-4, \-\-force\-ipv4
115 Make all connections via IPv4 (experimental)
119 .B \-6, \-\-force\-ipv6
120 Make all connections via IPv6 (experimental)
124 .B \-\-cn\-verification\-proxy \f[I]URL\f[]
125 Use this proxy to verify the IP address for some Chinese sites.
126 The default proxy specified by \-\-proxy (or none, if the options is not
127 present) is used for the actual downloading.
133 .B \-\-playlist\-start \f[I]NUMBER\f[]
134 Playlist video to start at (default is 1)
138 .B \-\-playlist\-end \f[I]NUMBER\f[]
139 Playlist video to end at (default is last)
143 .B \-\-playlist\-items \f[I]ITEM_SPEC\f[]
144 Playlist video items to download.
145 Specify indices of the videos in the playlist separated by commas like:
146 "\-\-playlist\-items 1,2,5,8" if you want to download videos indexed 1,
147 2, 5, 8 in the playlist.
148 You can specify range: "\-\-playlist\-items 1\-3,7,10\-13", it will
149 download the videos at index 1, 2, 3, 7, 10, 11, 12 and 13.
153 .B \-\-match\-title \f[I]REGEX\f[]
154 Download only matching titles (regex or caseless sub\-string)
158 .B \-\-reject\-title \f[I]REGEX\f[]
159 Skip download for matching titles (regex or caseless sub\-string)
163 .B \-\-max\-downloads \f[I]NUMBER\f[]
164 Abort after downloading NUMBER files
168 .B \-\-min\-filesize \f[I]SIZE\f[]
169 Do not download any videos smaller than SIZE (e.g.
174 .B \-\-max\-filesize \f[I]SIZE\f[]
175 Do not download any videos larger than SIZE (e.g.
180 .B \-\-date \f[I]DATE\f[]
181 Download only videos uploaded in this date
185 .B \-\-datebefore \f[I]DATE\f[]
186 Download only videos uploaded on or before this date (i.e.
191 .B \-\-dateafter \f[I]DATE\f[]
192 Download only videos uploaded on or after this date (i.e.
197 .B \-\-min\-views \f[I]COUNT\f[]
198 Do not download any videos with less than COUNT views
202 .B \-\-max\-views \f[I]COUNT\f[]
203 Do not download any videos with more than COUNT views
207 .B \-\-match\-filter \f[I]FILTER\f[]
208 Generic video filter (experimental).
209 Specify any key (see help for \-o for a list of available keys) to match
210 if the key is present, !key to check if the key is not present,key >
211 NUMBER (like "comment_count > 12", also works with >=, <, <=, !=, =) to
212 compare against a number, and & to require multiple matches.
213 Values which are not known are excluded unless you put a question mark
214 (?) after the operator.For example, to only match videos that have been
215 liked more than 100 times and disliked less than 50 times (or the
216 dislike functionality is not available at the given service), but who
217 also have a description, use \-\-match\-filter "like_count > 100 &
224 Download only the video, if the URL refers to a video and a playlist.
229 Download the playlist, if the URL refers to a video and a playlist.
233 .B \-\-age\-limit \f[I]YEARS\f[]
234 Download only videos suitable for the given age
238 .B \-\-download\-archive \f[I]FILE\f[]
239 Download only videos not listed in the archive file.
240 Record the IDs of all downloaded videos in it.
245 Download advertisements as well (experimental)
248 .SS Download Options:
250 .B \-r, \-\-rate\-limit \f[I]LIMIT\f[]
251 Maximum download rate in bytes per second (e.g.
256 .B \-R, \-\-retries \f[I]RETRIES\f[]
257 Number of retries (default is 10), or "infinite".
261 .B \-\-buffer\-size \f[I]SIZE\f[]
262 Size of download buffer (e.g.
263 1024 or 16K) (default is 1024)
267 .B \-\-no\-resize\-buffer
268 Do not automatically adjust the buffer size.
269 By default, the buffer size is automatically resized from an initial
274 .B \-\-playlist\-reverse
275 Download playlist videos in reverse order
279 .B \-\-xattr\-set\-filesize
280 Set file xattribute ytdl.filesize with expected filesize (experimental)
284 .B \-\-hls\-prefer\-native
285 Use the native HLS downloader instead of ffmpeg (experimental)
289 .B \-\-external\-downloader \f[I]COMMAND\f[]
290 Use the specified external downloader.
291 Currently supports aria2c,axel,curl,httpie,wget
295 .B \-\-external\-downloader\-args \f[I]ARGS\f[]
296 Give these arguments to the external downloader
299 .SS Filesystem Options:
301 .B \-a, \-\-batch\-file \f[I]FILE\f[]
302 File containing URLs to download (\[aq]\-\[aq] for stdin)
307 Use only video ID in file name
311 .B \-o, \-\-output \f[I]TEMPLATE\f[]
312 Output filename template.
313 Use %(title)s to get the title, %(uploader)s for the uploader name,
314 %(uploader_id)s for the uploader nickname if different, %(autonumber)s
315 to get an automatically incremented number, %(ext)s for the filename
316 extension, %(format)s for the format description (like "22 \- 1280x720"
317 or "HD"), %(format_id)s for the unique id of the format (like
318 YouTube\[aq]s itags: "137"), %(upload_date)s for the upload date
319 (YYYYMMDD), %(extractor)s for the provider (youtube, metacafe, etc),
320 %(id)s for the video id, %(playlist_title)s, %(playlist_id)s, or
321 %(playlist)s (=title if present, ID otherwise) for the playlist the
322 video is in, %(playlist_index)s for the position in the playlist.
323 %(height)s and %(width)s for the width and height of the video format.
324 %(resolution)s for a textual description of the resolution of the video
326 %% for a literal percent.
327 Use \- to output to stdout.
328 Can also be used to download to a different directory, for example with
329 \-o \[aq]/my/downloads/%(uploader)s /%(title)s\-%(id)s.%(ext)s\[aq] .
333 .B \-\-autonumber\-size \f[I]NUMBER\f[]
334 Specify the number of digits in %(autonumber)s when it is present in
335 output filename template or \-\-auto\-number option is given
339 .B \-\-restrict\-filenames
340 Restrict filenames to only ASCII characters, and avoid "&" and spaces in
345 .B \-A, \-\-auto\-number
346 [deprecated; use \-o "%(autonumber)s\-%(title)s.%(ext)s" ] Number
347 downloaded files starting from 00000
352 [deprecated] Use title in file name (default)
357 [deprecated] Alias of \-\-title
361 .B \-w, \-\-no\-overwrites
362 Do not overwrite files
367 Force resume of partially downloaded files.
368 By default, youtube\-dl will resume downloads if possible.
373 Do not resume partially downloaded files (restart from beginning)
378 Do not use .part files \- write directly into output file
383 Do not use the Last\-modified header to set the file modification time
387 .B \-\-write\-description
388 Write video description to a .description file
392 .B \-\-write\-info\-json
393 Write video metadata to a .info.json file
397 .B \-\-write\-annotations
398 Write video annotations to a .annotations.xml file
402 .B \-\-load\-info \f[I]FILE\f[]
403 JSON file containing the video information (created with the
404 "\-\-write\-info\-json" option)
408 .B \-\-cookies \f[I]FILE\f[]
409 File to read cookies from and dump cookie jar in
413 .B \-\-cache\-dir \f[I]DIR\f[]
414 Location in the filesystem where youtube\-dl can store some downloaded
415 information permanently.
416 By default $XDG_CACHE_HOME /youtube\-dl or ~/.cache/youtube\-dl .
417 At the moment, only YouTube player files (for videos with obfuscated
418 signatures) are cached, but that may change.
422 .B \-\-no\-cache\-dir
423 Disable filesystem caching
427 .B \-\-rm\-cache\-dir
428 Delete all filesystem cache files
431 .SS Thumbnail images:
433 .B \-\-write\-thumbnail
434 Write thumbnail image to disk
438 .B \-\-write\-all\-thumbnails
439 Write all thumbnail image formats to disk
443 .B \-\-list\-thumbnails
444 Simulate and list all available thumbnail formats
447 .SS Verbosity / Simulation Options:
460 Do not download the video and do not write anything to disk
464 .B \-\-skip\-download
465 Do not download the video
470 Simulate, quiet but print URL
474 .B \-e, \-\-get\-title
475 Simulate, quiet but print title
480 Simulate, quiet but print id
484 .B \-\-get\-thumbnail
485 Simulate, quiet but print thumbnail URL
489 .B \-\-get\-description
490 Simulate, quiet but print video description
495 Simulate, quiet but print video length
500 Simulate, quiet but print output filename
505 Simulate, quiet but print output format
509 .B \-j, \-\-dump\-json
510 Simulate, quiet but print JSON information.
511 See \-\-output for a description of available keys.
515 .B \-J, \-\-dump\-single\-json
516 Simulate, quiet but print JSON information for each command\-line
518 If the URL refers to a playlist, dump the whole playlist information in
524 Be quiet and print the video information as JSON (video is still being
530 Output progress bar as new lines
535 Do not print progress bar
539 .B \-\-console\-title
540 Display progress in console titlebar
545 Print various debugging information
550 Print downloaded pages encoded using base64 to debug problems (very
556 Write downloaded intermediary pages to files in the current directory to
561 .B \-\-print\-traffic
562 Display sent and read HTTP traffic
566 .B \-C, \-\-call\-home
567 Contact the youtube\-dl server for debugging
571 .B \-\-no\-call\-home
572 Do NOT contact the youtube\-dl server for debugging
577 .B \-\-encoding \f[I]ENCODING\f[]
578 Force the specified encoding (experimental)
582 .B \-\-no\-check\-certificate
583 Suppress HTTPS certificate validation
587 .B \-\-prefer\-insecure
588 Use an unencrypted connection to retrieve information about the video.
589 (Currently supported only for YouTube)
593 .B \-\-user\-agent \f[I]UA\f[]
594 Specify a custom user agent
598 .B \-\-referer \f[I]URL\f[]
599 Specify a custom referer, use if the video access is restricted to one
604 .B \-\-add\-header \f[I]FIELD:VALUE\f[]
605 Specify a custom HTTP header and its value, separated by a colon
607 You can use this option multiple times
611 .B \-\-bidi\-workaround
612 Work around terminals that lack bidirectional text support.
613 Requires bidiv or fribidi executable in PATH
617 .B \-\-sleep\-interval \f[I]SECONDS\f[]
618 Number of seconds to sleep before each download.
621 .SS Video Format Options:
623 .B \-f, \-\-format \f[I]FORMAT\f[]
624 Video format code, see the "FORMAT SELECTION" for all the info
629 Download all available video formats
633 .B \-\-prefer\-free\-formats
634 Prefer free video formats unless a specific one is requested
638 .B \-F, \-\-list\-formats
639 List all available formats of specified videos
643 .B \-\-youtube\-skip\-dash\-manifest
644 Do not download the DASH manifests and related data on YouTube videos
648 .B \-\-merge\-output\-format \f[I]FORMAT\f[]
649 If a merge is required (e.g.
650 bestvideo+bestaudio), output to given container format.
651 One of mkv, mp4, ogg, webm, flv.
652 Ignored if no merge is required
655 .SS Subtitle Options:
662 .B \-\-write\-auto\-sub
663 Write automatically generated subtitle file (YouTube only)
668 Download all the available subtitles of the video
673 List all available subtitles for the video
677 .B \-\-sub\-format \f[I]FORMAT\f[]
678 Subtitle format, accepts formats preference, for example: "srt" or
683 .B \-\-sub\-lang \f[I]LANGS\f[]
684 Languages of the subtitles to download (optional) separated by commas,
685 use IETF language tags like \[aq]en,pt\[aq]
688 .SS Authentication Options:
690 .B \-u, \-\-username \f[I]USERNAME\f[]
691 Login with this account ID
695 .B \-p, \-\-password \f[I]PASSWORD\f[]
697 If this option is left out, youtube\-dl will ask interactively.
701 .B \-2, \-\-twofactor \f[I]TWOFACTOR\f[]
702 Two\-factor auth code
707 Use .netrc authentication data
711 .B \-\-video\-password \f[I]PASSWORD\f[]
712 Video password (vimeo, smotri, youku)
715 .SS Post\-processing Options:
717 .B \-x, \-\-extract\-audio
718 Convert video files to audio\-only files (requires ffmpeg or avconv and
723 .B \-\-audio\-format \f[I]FORMAT\f[]
724 Specify audio format: "best", "aac", "vorbis", "mp3", "m4a", "opus", or
725 "wav"; "best" by default
729 .B \-\-audio\-quality \f[I]QUALITY\f[]
730 Specify ffmpeg/avconv audio quality, insert a value between 0 (better)
731 and 9 (worse) for VBR or a specific bitrate like 128K (default 5)
735 .B \-\-recode\-video \f[I]FORMAT\f[]
736 Encode the video to another format if necessary (currently supported:
737 mp4|flv|ogg|webm|mkv|avi)
741 .B \-\-postprocessor\-args \f[I]ARGS\f[]
742 Give these arguments to the postprocessor
746 .B \-k, \-\-keep\-video
747 Keep the video file on disk after the post\- processing; the video is
752 .B \-\-no\-post\-overwrites
753 Do not overwrite post\-processed files; the post\-processed files are
754 overwritten by default
759 Embed subtitles in the video (only for mkv and mp4 videos)
763 .B \-\-embed\-thumbnail
764 Embed thumbnail in the audio as cover art
769 Write metadata to the video file
773 .B \-\-metadata\-from\-title \f[I]FORMAT\f[]
774 Parse additional metadata like song title / artist from the video title.
775 The format syntax is the same as \-\-output, the parsed parameters
776 replace existing values.
777 Additional templates: %(album)s, %(artist)s.
778 Example: \-\-metadata\-from\-title "%(artist)s \- %(title)s" matches a
779 title like "Coldplay \- Paradise"
784 Write metadata to the video file\[aq]s xattrs (using dublin core and xdg
789 .B \-\-fixup \f[I]POLICY\f[]
790 Automatically correct known faults of the file.
791 One of never (do nothing), warn (only emit a warning), detect_or_warn
792 (the default; fix file if we can, warn otherwise)
796 .B \-\-prefer\-avconv
797 Prefer avconv over ffmpeg for running the postprocessors (default)
801 .B \-\-prefer\-ffmpeg
802 Prefer ffmpeg over avconv for running the postprocessors
806 .B \-\-ffmpeg\-location \f[I]PATH\f[]
807 Location of the ffmpeg/avconv binary; either the path to the binary or
808 its containing directory.
812 .B \-\-exec \f[I]CMD\f[]
813 Execute a command on the file after downloading, similar to find\[aq]s
815 Example: \-\-exec \[aq]adb push {} /sdcard/Music/ && rm {}\[aq]
819 .B \-\-convert\-subtitles \f[I]FORMAT\f[]
820 Convert the subtitles to other format (currently supported: srt|ass|vtt)
825 You can configure youtube\-dl by placing any supported command line
826 option to a configuration file.
827 On Linux, the system wide configuration file is located at
828 \f[C]/etc/youtube\-dl.conf\f[] and the user wide configuration file at
829 \f[C]~/.config/youtube\-dl/config\f[].
830 On Windows, the user wide configuration file locations are
831 \f[C]%APPDATA%\\youtube\-dl\\config.txt\f[] or
832 \f[C]C:\\Users\\<user\ name>\\youtube\-dl.conf\f[].
833 For example, with the following configuration file youtube\-dl will
834 always extract the audio, not copy the mtime and use a proxy:
840 \-\-proxy\ 127.0.0.1:3128
844 You can use \f[C]\-\-ignore\-config\f[] if you want to disable the
845 configuration file for a particular youtube\-dl run.
846 .SS Authentication with \f[C]\&.netrc\f[] file
848 You may also want to configure automatic credentials storage for
849 extractors that support authentication (by providing login and password
850 with \f[C]\-\-username\f[] and \f[C]\-\-password\f[]) in order not to
851 pass credentials as command line arguments on every youtube\-dl
852 execution and prevent tracking plain text passwords in the shell command
854 You can achieve this using a \f[C]\&.netrc\f[]
855 file (http://stackoverflow.com/tags/.netrc/info) on per extractor basis.
856 For that you will need to create a\f[C]\&.netrc\f[] file in your
857 \f[C]$HOME\f[] and restrict permissions to read/write by you only:
862 chmod\ a\-rwx,u+rw\ $HOME/.netrc
866 After that you can add credentials for extractor in the following
867 format, where \f[I]extractor\f[] is the name of extractor in lowercase:
871 machine\ <extractor>\ login\ <login>\ password\ <password>
879 machine\ youtube\ login\ myaccount\@gmail.com\ password\ my_youtube_password
880 machine\ twitch\ login\ my_twitch_account_name\ password\ my_twitch_password
884 To activate authentication with the \f[C]\&.netrc\f[] file you should
885 pass \f[C]\-\-netrc\f[] to youtube\-dl or place it in the configuration
886 file (#configuration).
888 On Windows you may also need to setup the \f[C]%HOME%\f[] environment
892 The \f[C]\-o\f[] option allows users to indicate a template for the
894 The basic usage is not to set any template arguments when downloading a
896 \f[C]youtube\-dl\ \-o\ funny_video.flv\ "http://some/video"\f[].
897 However, it may contain special sequences that will be replaced when
898 downloading each video.
899 The special sequences have the format \f[C]%(NAME)s\f[].
900 To clarify, that is a percent symbol followed by a name in parentheses,
901 followed by a lowercase S.
904 \f[C]id\f[]: The sequence will be replaced by the video identifier.
906 \f[C]url\f[]: The sequence will be replaced by the video URL.
908 \f[C]uploader\f[]: The sequence will be replaced by the nickname of the
909 person who uploaded the video.
911 \f[C]upload_date\f[]: The sequence will be replaced by the upload date
914 \f[C]title\f[]: The sequence will be replaced by the video title.
916 \f[C]ext\f[]: The sequence will be replaced by the appropriate extension
919 \f[C]epoch\f[]: The sequence will be replaced by the Unix epoch when
922 \f[C]autonumber\f[]: The sequence will be replaced by a five\-digit
923 number that will be increased with each download, starting at zero.
925 \f[C]playlist\f[]: The sequence will be replaced by the name or the id
926 of the playlist that contains the video.
928 \f[C]playlist_index\f[]: The sequence will be replaced by the index of
929 the video in the playlist padded with leading zeros according to the
930 total length of the playlist.
932 \f[C]format_id\f[]: The sequence will be replaced by the format code
933 specified by \f[C]\-\-format\f[].
935 \f[C]duration\f[]: The sequence will be replaced by the length of the
938 The current default template is \f[C]%(title)s\-%(id)s.%(ext)s\f[].
940 In some cases, you don\[aq]t want special characters such as äø, spaces,
941 or &, such as when transferring the downloaded filename to a Windows
942 system or the filename through an 8bit\-unsafe channel.
943 In these cases, add the \f[C]\-\-restrict\-filenames\f[] flag to get a
948 $\ youtube\-dl\ \-\-get\-filename\ \-o\ "%(title)s.%(ext)s"\ BaW_jenozKc
949 youtube\-dl\ test\ video\ \[aq]\[aq]_Ƥāš.mp4\ \ \ \ #\ All\ kinds\ of\ weird\ characters
950 $\ youtube\-dl\ \-\-get\-filename\ \-o\ "%(title)s.%(ext)s"\ BaW_jenozKc\ \-\-restrict\-filenames
951 youtube\-dl_test_video_.mp4\ \ \ \ \ \ \ \ \ \ #\ A\ simple\ file\ name
956 By default youtube\-dl tries to download the best quality, but sometimes
957 you may want to download in a different format.
958 The simplest case is requesting a specific format, for example
960 You can get the list of available formats using
961 \f[C]\-\-list\-formats\f[], you can also use a file extension (currently
962 it supports aac, m4a, mp3, mp4, ogg, wav, webm) or the special names
963 \f[C]best\f[], \f[C]bestvideo\f[], \f[C]bestaudio\f[] and
966 If you want to download multiple videos and they don\[aq]t have the same
967 formats available, you can specify the order of preference using
968 slashes, as in \f[C]\-f\ 22/17/18\f[].
969 You can also filter the video results by putting a condition in
970 brackets, as in \f[C]\-f\ "best[height=720]"\f[] (or
971 \f[C]\-f\ "[filesize>10M]"\f[]).
972 This works for filesize, height, width, tbr, abr, vbr, asr, and fps and
973 the comparisons <, <=, >, >=, =, != and for ext, acodec, vcodec,
974 container, and protocol and the comparisons =, != .
975 Formats for which the value is not known are excluded unless you put a
976 question mark (?) after the operator.
977 You can combine format filters, so
978 \f[C]\-f\ "[height\ <=?\ 720][tbr>500]"\f[] selects up to 720p videos
979 (or videos where the height is not known) with a bitrate of at least 500
981 Use commas to download multiple formats, such as
982 \f[C]\-f\ 136/137/mp4/bestvideo,140/m4a/bestaudio\f[].
983 You can merge the video and audio of two formats into a single file
984 using \f[C]\-f\ <video\-format>+<audio\-format>\f[] (requires ffmpeg or
985 avconv), for example \f[C]\-f\ bestvideo+bestaudio\f[].
986 Format selectors can also be grouped using parentheses, for example if
987 you want to download the best mp4 and webm formats with a height lower
988 than 480 you can use \f[C]\-f\ \[aq](mp4,webm)[height<480]\[aq]\f[].
990 Since the end of April 2015 and version 2015.04.26 youtube\-dl uses
991 \f[C]\-f\ bestvideo+bestaudio/best\f[] as default format selection (see
993 If ffmpeg or avconv are installed this results in downloading
994 \f[C]bestvideo\f[] and \f[C]bestaudio\f[] separately and muxing them
995 together into a single file giving the best overall quality available.
996 Otherwise it falls back to \f[C]best\f[] and results in downloading the
997 best available quality served as a single file.
998 \f[C]best\f[] is also needed for videos that don\[aq]t come from YouTube
999 because they don\[aq]t provide the audio and video in two different
1001 If you want to only download some dash formats (for example if you are
1002 not interested in getting videos with a resolution higher than 1080p),
1003 you can add \f[C]\-f\ bestvideo[height<=?1080]+bestaudio/best\f[] to
1004 your configuration file.
1005 Note that if you use youtube\-dl to stream to \f[C]stdout\f[] (and most
1006 likely to pipe it to your media player then), i.e.
1007 you explicitly specify output template as \f[C]\-o\ \-\f[], youtube\-dl
1008 still uses \f[C]\-f\ best\f[] format selection in order to start content
1009 delivery immediately to your player and not to wait until
1010 \f[C]bestvideo\f[] and \f[C]bestaudio\f[] are downloaded and muxed.
1012 If you want to preserve the old format selection behavior (prior to
1013 youtube\-dl 2015.04.26), i.e.
1014 you want to download the best available quality media served as a single
1015 file, you should explicitly specify your choice with \f[C]\-f\ best\f[].
1016 You may want to add it to the configuration file (#configuration) in
1017 order not to type it every time you run youtube\-dl.
1020 Videos can be filtered by their upload date using the options
1021 \f[C]\-\-date\f[], \f[C]\-\-datebefore\f[] or \f[C]\-\-dateafter\f[].
1022 They accept dates in two formats:
1024 Absolute dates: Dates in the format \f[C]YYYYMMDD\f[].
1026 Relative dates: Dates in the format
1027 \f[C](now|today)[+\-][0\-9](day|week|month|year)(s)?\f[]
1033 #\ Download\ only\ the\ videos\ uploaded\ in\ the\ last\ 6\ months
1034 $\ youtube\-dl\ \-\-dateafter\ now\-6months
1036 #\ Download\ only\ the\ videos\ uploaded\ on\ January\ 1,\ 1970
1037 $\ youtube\-dl\ \-\-date\ 19700101
1039 $\ #\ Download\ only\ the\ videos\ uploaded\ in\ the\ 200x\ decade
1040 $\ youtube\-dl\ \-\-dateafter\ 20000101\ \-\-datebefore\ 20091231
1044 .SS How do I update youtube\-dl?
1046 If you\[aq]ve followed our manual installation
1047 instructions (http://rg3.github.io/youtube-dl/download.html), you can
1048 simply run \f[C]youtube\-dl\ \-U\f[] (or, on Linux,
1049 \f[C]sudo\ youtube\-dl\ \-U\f[]).
1051 If you have used pip, a simple
1052 \f[C]sudo\ pip\ install\ \-U\ youtube\-dl\f[] is sufficient to update.
1054 If you have installed youtube\-dl using a package manager like
1055 \f[I]apt\-get\f[] or \f[I]yum\f[], use the standard system update
1056 mechanism to update.
1057 Note that distribution packages are often outdated.
1058 As a rule of thumb, youtube\-dl releases at least once a month, and
1059 often weekly or even daily.
1060 Simply go to http://yt\-dl.org/ to find out the current version.
1061 Unfortunately, there is nothing we youtube\-dl developers can do if your
1062 distribution serves a really outdated version.
1063 You can (and should) complain to your distribution in their bugtracker
1066 As a last resort, you can also uninstall the version installed by your
1067 package manager and follow our manual installation instructions.
1068 For that, remove the distribution\[aq]s package, with a line like
1072 sudo\ apt\-get\ remove\ \-y\ youtube\-dl
1076 Afterwards, simply follow our manual installation
1077 instructions (http://rg3.github.io/youtube-dl/download.html):
1081 sudo\ wget\ https://yt\-dl.org/latest/youtube\-dl\ \-O\ /usr/local/bin/youtube\-dl
1082 sudo\ chmod\ a+x\ /usr/local/bin/youtube\-dl
1087 Again, from then on you\[aq]ll be able to update with
1088 \f[C]sudo\ youtube\-dl\ \-U\f[].
1089 .SS I\[aq]m getting an error
1090 \f[C]Unable\ to\ extract\ OpenGraph\ title\f[] on YouTube playlists
1092 YouTube changed their playlist format in March 2014 and later on, so
1093 you\[aq]ll need at least youtube\-dl 2014.07.25 to download all YouTube
1096 If you have installed youtube\-dl with a package manager, pip, setup.py
1097 or a tarball, please use that to update.
1098 Note that Ubuntu packages do not seem to get updated anymore.
1099 Since we are not affiliated with Ubuntu, there is little we can do.
1101 bugs (https://bugs.launchpad.net/ubuntu/+source/youtube-dl/+filebug) to
1102 the Ubuntu packaging
1103 guys (mailto:ubuntu-motu@lists.ubuntu.com?subject=outdated%20version%20of%20youtube-dl)
1104 \- all they have to do is update the package to a somewhat recent
1106 See above for a way to update.
1107 .SS Do I always have to pass \f[C]\-citw\f[]?
1109 By default, youtube\-dl intends to have the best options (incidentally,
1110 if you have a convincing case that these should be different, please
1111 file an issue where you explain that (https://yt-dl.org/bug)).
1112 Therefore, it is unnecessary and sometimes harmful to copy long option
1113 strings from webpages.
1114 In particular, the only option out of \f[C]\-citw\f[] that is regularly
1115 useful is \f[C]\-i\f[].
1116 .SS Can you please put the \f[C]\-b\f[] option back?
1118 Most people asking this question are not aware that youtube\-dl now
1119 defaults to downloading the highest available quality as reported by
1120 YouTube, which will be 1080p or 720p in some cases, so you no longer
1121 need the \f[C]\-b\f[] option.
1122 For some specific videos, maybe YouTube does not report them to be
1123 available in a specific high quality format you\[aq]re interested in.
1124 In that case, simply request it with the \f[C]\-f\f[] option and
1125 youtube\-dl will try to download it.
1126 .SS I get HTTP error 402 when trying to download a video. What\[aq]s
1129 Apparently YouTube requires you to pass a CAPTCHA test if you download
1131 We\[aq]re considering to provide a way to let you solve the
1132 CAPTCHA (https://github.com/rg3/youtube-dl/issues/154), but at the
1133 moment, your best course of action is pointing a webbrowser to the
1134 youtube URL, solving the CAPTCHA, and restart youtube\-dl.
1135 .SS Do I need any other programs?
1137 youtube\-dl works fine on its own on most sites.
1138 However, if you want to convert video/audio, you\[aq]ll need
1139 avconv (https://libav.org/) or ffmpeg (https://www.ffmpeg.org/).
1140 On some sites \- most notably YouTube \- videos can be retrieved in a
1141 higher quality format without sound.
1142 youtube\-dl will detect whether avconv/ffmpeg is present and
1143 automatically pick the best option.
1145 Videos or video formats streamed via RTMP protocol can only be
1146 downloaded when rtmpdump (https://rtmpdump.mplayerhq.hu/) is installed.
1147 Downloading MMS and RTSP videos requires either
1148 mplayer (http://mplayerhq.hu/) or mpv (https://mpv.io/) to be installed.
1149 .SS I have downloaded a video but how can I play it?
1151 Once the video is fully downloaded, use any video player, such as
1152 vlc (http://www.videolan.org) or mplayer (http://www.mplayerhq.hu/).
1153 .SS I extracted a video URL with \f[C]\-g\f[], but it does not play on
1154 another machine / in my webbrowser.
1156 It depends a lot on the service.
1157 In many cases, requests for the video (to download/play it) must come
1158 from the same IP address and with the same cookies.
1159 Use the \f[C]\-\-cookies\f[] option to write the required cookies into a
1160 file, and advise your downloader to read cookies from that file.
1161 Some sites also require a common user agent to be used, use
1162 \f[C]\-\-dump\-user\-agent\f[] to see the one in use by youtube\-dl.
1164 It may be beneficial to use IPv6; in some cases, the restrictions are
1165 only applied to IPv4.
1166 Some services (sometimes only for a subset of videos) do not restrict
1167 the video URL by IP address, cookie, or user\-agent, but these are the
1168 exception rather than the rule.
1170 Please bear in mind that some URL protocols are \f[B]not\f[] supported
1171 by browsers out of the box, including RTMP.
1172 If you are using \f[C]\-g\f[], your own downloader must support these as
1175 If you want to play the video on a machine that is not running
1176 youtube\-dl, you can relay the video content from the machine that runs
1178 You can use \f[C]\-o\ \-\f[] to let youtube\-dl stream a video to
1179 stdout, or simply allow the player to download the files written by
1180 youtube\-dl in turn.
1181 .SS ERROR: no fmt_url_map or conn information found in video info
1183 YouTube has switched to a new video info format in July 2011 which is
1184 not supported by old versions of youtube\-dl.
1185 See above (#how-do-i-update-youtube-dl) for how to update youtube\-dl.
1186 .SS ERROR: unable to download video
1188 YouTube requires an additional signature since September 2012 which is
1189 not supported by old versions of youtube\-dl.
1190 See above (#how-do-i-update-youtube-dl) for how to update youtube\-dl.
1191 .SS Video URL contains an ampersand and I\[aq]m getting some strange
1192 output \f[C][1]\ 2839\f[] or
1193 \f[C]\[aq]v\[aq]\ is\ not\ recognized\ as\ an\ internal\ or\ external\ command\f[]
1195 That\[aq]s actually the output from your shell.
1196 Since ampersand is one of the special shell characters it\[aq]s
1197 interpreted by the shell preventing you from passing the whole URL to
1199 To disable your shell from interpreting the ampersands (or any other
1200 special characters) you have to either put the whole URL in quotes or
1201 escape them with a backslash (which approach will work depends on your
1204 For example if your URL is
1205 https://www.youtube.com/watch?t=4&v=BaW_jenozKc you should end up with
1208 \f[C]youtube\-dl\ \[aq]https://www.youtube.com/watch?t=4&v=BaW_jenozKc\[aq]\f[]
1212 \f[C]youtube\-dl\ https://www.youtube.com/watch?t=4\\&v=BaW_jenozKc\f[]
1214 For Windows you have to use the double quotes:
1216 \f[C]youtube\-dl\ "https://www.youtube.com/watch?t=4&v=BaW_jenozKc"\f[]
1217 .SS ExtractorError: Could not find JS function u\[aq]OF\[aq]
1219 In February 2015, the new YouTube player contained a character sequence
1220 in a string that was misinterpreted by old versions of youtube\-dl.
1221 See above (#how-do-i-update-youtube-dl) for how to update youtube\-dl.
1222 .SS HTTP Error 429: Too Many Requests or 402: Payment Required
1224 These two error codes indicate that the service is blocking your IP
1225 address because of overuse.
1226 Contact the service and ask them to unblock your IP address, or \- if
1227 you have acquired a whitelisted IP address already \- use the
1228 \f[C]\-\-proxy\f[] or \f[C]\-\-source\-address\f[]
1229 options (#network-options) to select another IP address.
1230 .SS SyntaxError: Non\-ASCII character
1236 File\ "youtube\-dl",\ line\ 2
1237 SyntaxError:\ Non\-ASCII\ character\ \[aq]\\x93\[aq]\ ...
1241 means you\[aq]re using an outdated version of Python.
1242 Please update to Python 2.6 or 2.7.
1243 .SS What is this binary file? Where has the code gone?
1245 Since June 2012 (#342) youtube\-dl is packed as an executable zipfile,
1246 simply unzip it (might need renaming to \f[C]youtube\-dl.zip\f[] first
1247 on some systems) or clone the git repository, as laid out above.
1248 If you modify the code, you can run it by executing the
1249 \f[C]__main__.py\f[] file.
1250 To recompile the executable, run \f[C]make\ youtube\-dl\f[].
1251 .SS The exe throws a \f[I]Runtime error from Visual C++\f[]
1253 To run the exe you need to install first the Microsoft Visual C++ 2008
1255 Package (http://www.microsoft.com/en-us/download/details.aspx?id=29).
1256 .SS On Windows, how should I set up ffmpeg and youtube\-dl? Where should
1257 I put the exe files?
1259 If you put youtube\-dl and ffmpeg in the same directory that you\[aq]re
1260 running the command from, it will work, but that\[aq]s rather
1263 To make a different directory work \- either for ffmpeg, or for
1264 youtube\-dl, or for both \- simply create the directory (say,
1265 \f[C]C:\\bin\f[], or \f[C]C:\\Users\\<User\ name>\\bin\f[]), put all the
1266 executables directly in there, and then set your PATH environment
1267 variable (https://www.java.com/en/download/help/path.xml) to include
1270 From then on, after restarting your shell, you will be able to access
1271 both youtube\-dl and ffmpeg (and youtube\-dl will be able to find
1272 ffmpeg) by simply typing \f[C]youtube\-dl\f[] or \f[C]ffmpeg\f[], no
1273 matter what directory you\[aq]re in.
1274 .SS How do I put downloads into a specific folder?
1276 Use the \f[C]\-o\f[] to specify an output template (#output-template),
1277 for example \f[C]\-o\ "/home/user/videos/%(title)s\-%(id)s.%(ext)s"\f[].
1278 If you want this for all of your downloads, put the option into your
1279 configuration file (#configuration).
1280 .SS How do I download a video starting with a \f[C]\-\f[] ?
1282 Either prepend \f[C]http://www.youtube.com/watch?v=\f[] or separate the
1283 ID from the options with \f[C]\-\-\f[]:
1287 youtube\-dl\ \-\-\ \-wNyEUrxzFU
1288 youtube\-dl\ "http://www.youtube.com/watch?v=\-wNyEUrxzFU"
1291 .SS How do I pass cookies to youtube\-dl?
1293 Use the \f[C]\-\-cookies\f[] option, for example
1294 \f[C]\-\-cookies\ /path/to/cookies/file.txt\f[].
1295 Note that the cookies file must be in Mozilla/Netscape format and the
1296 first line of the cookies file must be either
1297 \f[C]#\ HTTP\ Cookie\ File\f[] or
1298 \f[C]#\ Netscape\ HTTP\ Cookie\ File\f[].
1299 Make sure you have correct newline
1300 format (https://en.wikipedia.org/wiki/Newline) in the cookies file and
1301 convert newlines if necessary to correspond with your OS, namely
1302 \f[C]CRLF\f[] (\f[C]\\r\\n\f[]) for Windows, \f[C]LF\f[] (\f[C]\\n\f[])
1303 for Linux and \f[C]CR\f[] (\f[C]\\r\f[]) for Mac OS.
1304 \f[C]HTTP\ Error\ 400:\ Bad\ Request\f[] when using \f[C]\-\-cookies\f[]
1305 is a good sign of invalid newline format.
1307 Passing cookies to youtube\-dl is a good way to workaround login when a
1308 particular extractor does not implement it explicitly.
1309 .SS Can you add support for this anime video site, or site which shows
1310 current movies for free?
1312 As a matter of policy (as well as legality), youtube\-dl does not
1313 include support for services that specialize in infringing copyright.
1314 As a rule of thumb, if you cannot easily find a video that the service
1315 is quite obviously allowed to distribute (i.e.
1316 that has been uploaded by the creator, the creator\[aq]s distributor, or
1317 is published under a free license), the service is probably unfit for
1318 inclusion to youtube\-dl.
1320 A note on the service that they don\[aq]t host the infringing content,
1321 but just link to those who do, is evidence that the service should
1322 \f[B]not\f[] be included into youtube\-dl.
1323 The same goes for any DMCA note when the whole front page of the service
1324 is filled with videos they are not allowed to distribute.
1325 A "fair use" note is equally unconvincing if the service shows
1326 copyright\-protected videos in full without authorization.
1328 Support requests for services that \f[B]do\f[] purchase the rights to
1329 distribute their content are perfectly fine though.
1330 If in doubt, you can simply include a source that mentions the
1331 legitimate purchase of content.
1332 .SS How can I speed up work on my issue?
1334 (Also known as: Help, my important issue not being solved!) The
1335 youtube\-dl core developer team is quite small.
1336 While we do our best to solve as many issues as possible, sometimes that
1337 can take quite a while.
1338 To speed up your issue, here\[aq]s what you can do:
1340 First of all, please do report the issue at our issue
1341 tracker (https://yt-dl.org/bugs).
1342 That allows us to coordinate all efforts by users and developers, and
1343 serves as a unified point.
1344 Unfortunately, the youtube\-dl project has grown too large to use
1345 personal email as an effective communication channel.
1347 Please read the bug reporting instructions (#bugs) below.
1348 A lot of bugs lack all the necessary information.
1349 If you can, offer proxy, VPN, or shell access to the youtube\-dl
1351 If you are able to, test the issue from multiple computers in multiple
1352 countries to exclude local censorship or misconfiguration issues.
1354 If nobody is interested in solving your issue, you are welcome to take
1355 matters into your own hands and submit a pull request (or coerce/pay
1356 somebody else to do so).
1358 Feel free to bump the issue from time to time by writing a small comment
1359 ("Issue is still present in youtube\-dl version ...from France, but
1360 fixed from Belgium"), but please not more than once a month.
1361 Please do not declare your issue as \f[C]important\f[] or
1363 .SS How can I detect whether a given URL is supported by youtube\-dl?
1365 For one, have a look at the list of supported
1366 sites (docs/supportedsites.md).
1367 Note that it can sometimes happen that the site changes its URL scheme
1368 (say, from http://example.com/video/1234567 to
1369 http://example.com/v/1234567 ) and youtube\-dl reports an URL of a
1370 service in that list as unsupported.
1371 In that case, simply report a bug.
1373 It is \f[I]not\f[] possible to detect whether a URL is supported or not.
1374 That\[aq]s because youtube\-dl contains a generic extractor which
1375 matches \f[B]all\f[] URLs.
1376 You may be tempted to disable, exclude, or remove the generic extractor,
1377 but the generic extractor not only allows users to extract videos from
1378 lots of websites that embed a video from another service, but may also
1379 be used to extract video from a service that it\[aq]s hosting itself.
1380 Therefore, we neither recommend nor support disabling, excluding, or
1381 removing the generic extractor.
1383 If you want to find out whether a given URL is supported, simply call
1384 youtube\-dl with it.
1385 If you get no videos back, chances are the URL is either not referring
1386 to a video or unsupported.
1387 You can find out which by examining the output (if you run youtube\-dl
1388 on the console) or catching an \f[C]UnsupportedError\f[] exception if
1389 you run it from a Python program.
1390 .SH DEVELOPER INSTRUCTIONS
1392 Most users do not need to build youtube\-dl and can download the
1393 builds (http://rg3.github.io/youtube-dl/download.html) or get them from
1396 To run youtube\-dl as a developer, you don\[aq]t need to build anything
1402 python\ \-m\ youtube_dl
1406 To run the test, simply invoke your favorite test runner, or execute a
1407 test file directly; any of the following work:
1411 python\ \-m\ unittest\ discover
1412 python\ test/test_download.py
1417 If you want to create a build of youtube\-dl yourself, you\[aq]ll need
1428 .SS Adding support for a new site
1430 If you want to add support for a new site, you can follow this quick
1431 list (assuming your service is called \f[C]yourextractor\f[]):
1433 Fork this repository (https://github.com/rg3/youtube-dl/fork)
1435 Check out the source code with
1436 \f[C]git\ clone\ git\@github.com:YOUR_GITHUB_USERNAME/youtube\-dl.git\f[]
1438 Start a new git branch with
1439 \f[C]cd\ youtube\-dl;\ git\ checkout\ \-b\ yourextractor\f[]
1441 Start with this simple template and save it to
1442 \f[C]youtube_dl/extractor/yourextractor.py\f[]:
1448 from\ __future__\ import\ unicode_literals
1450 from\ .common\ import\ InfoExtractor
1453 class\ YourExtractorIE(InfoExtractor):
1454 \ \ \ \ _VALID_URL\ =\ r\[aq]https?://(?:www\\.)?yourextractor\\.com/watch/(?P<id>[0\-9]+)\[aq]
1456 \ \ \ \ \ \ \ \ \[aq]url\[aq]:\ \[aq]http://yourextractor.com/watch/42\[aq],
1457 \ \ \ \ \ \ \ \ \[aq]md5\[aq]:\ \[aq]TODO:\ md5\ sum\ of\ the\ first\ 10241\ bytes\ of\ the\ video\ file\ (use\ \-\-test)\[aq],
1458 \ \ \ \ \ \ \ \ \[aq]info_dict\[aq]:\ {
1459 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]id\[aq]:\ \[aq]42\[aq],
1460 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]ext\[aq]:\ \[aq]mp4\[aq],
1461 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]title\[aq]:\ \[aq]Video\ title\ goes\ here\[aq],
1462 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]thumbnail\[aq]:\ \[aq]re:^https?://.*\\.jpg$\[aq],
1463 \ \ \ \ \ \ \ \ \ \ \ \ #\ TODO\ more\ properties,\ either\ as:
1464 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ A\ value
1465 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ MD5\ checksum;\ start\ the\ string\ with\ md5:
1466 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ A\ regular\ expression;\ start\ the\ string\ with\ re:
1467 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ Any\ Python\ type\ (for\ example\ int\ or\ float)
1471 \ \ \ \ def\ _real_extract(self,\ url):
1472 \ \ \ \ \ \ \ \ video_id\ =\ self._match_id(url)
1473 \ \ \ \ \ \ \ \ webpage\ =\ self._download_webpage(url,\ video_id)
1475 \ \ \ \ \ \ \ \ #\ TODO\ more\ code\ goes\ here,\ for\ example\ ...
1476 \ \ \ \ \ \ \ \ title\ =\ self._html_search_regex(r\[aq]<h1>(.+?)</h1>\[aq],\ webpage,\ \[aq]title\[aq])
1478 \ \ \ \ \ \ \ \ return\ {
1479 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]id\[aq]:\ video_id,
1480 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]title\[aq]:\ title,
1481 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]description\[aq]:\ self._og_search_description(webpage),
1482 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]uploader\[aq]:\ self._search_regex(r\[aq]<div[^>]+id="uploader"[^>]*>([^<]+)<\[aq],\ webpage,\ \[aq]uploader\[aq],\ fatal=False),
1483 \ \ \ \ \ \ \ \ \ \ \ \ #\ TODO\ more\ properties\ (see\ youtube_dl/extractor/common.py)
1490 \f[C]youtube_dl/extractor/__init__.py\f[] (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/__init__.py).
1493 \f[C]python\ test/test_download.py\ TestDownload.test_YourExtractor\f[].
1494 This \f[I]should fail\f[] at first, but you can continually re\-run it
1495 until you\[aq]re done.
1496 If you decide to add more than one test, then rename \f[C]_TEST\f[] to
1497 \f[C]_TESTS\f[] and make it into a list of dictionaries.
1498 The tests will then be named \f[C]TestDownload.test_YourExtractor\f[],
1499 \f[C]TestDownload.test_YourExtractor_1\f[],
1500 \f[C]TestDownload.test_YourExtractor_2\f[], etc.
1503 \f[C]youtube_dl/extractor/common.py\f[] (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py)
1504 for possible helper methods and a detailed description of what your
1505 extractor should and may
1506 return (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L62-L200).
1507 Add tests and code for as many as you want.
1509 If you can, check the code with
1510 flake8 (https://pypi.python.org/pypi/flake8).
1512 When the tests pass, add (http://git-scm.com/docs/git-add) the new files
1513 and commit (http://git-scm.com/docs/git-commit) them and
1514 push (http://git-scm.com/docs/git-push) the result, like this:
1519 $\ git\ add\ youtube_dl/extractor/__init__.py
1520 $\ git\ add\ youtube_dl/extractor/yourextractor.py
1521 $\ git\ commit\ \-m\ \[aq][yourextractor]\ Add\ new\ extractor\[aq]
1522 $\ git\ push\ origin\ yourextractor
1527 Finally, create a pull
1528 request (https://help.github.com/articles/creating-a-pull-request).
1529 We\[aq]ll then review and merge it.
1531 In any case, thank you very much for your contributions!
1532 .SH EMBEDDING YOUTUBE\-DL
1534 youtube\-dl makes the best effort to be a good command\-line program,
1535 and thus should be callable from any programming language.
1536 If you encounter any problems parsing its output, feel free to create a
1537 report (https://github.com/rg3/youtube-dl/issues/new).
1539 From a Python program, you can embed youtube\-dl in a more powerful
1544 from\ __future__\ import\ unicode_literals
1548 with\ youtube_dl.YoutubeDL(ydl_opts)\ as\ ydl:
1549 \ \ \ \ ydl.download([\[aq]http://www.youtube.com/watch?v=BaW_jenozKc\[aq]])
1553 Most likely, you\[aq]ll want to use various options.
1554 For a list of what can be done, have a look at
1555 youtube_dl/YoutubeDL.py (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L117-L265).
1556 For a start, if you want to intercept youtube\-dl\[aq]s output, set a
1557 \f[C]logger\f[] object.
1559 Here\[aq]s a more complete example of a program that outputs only errors
1560 (and a short message after the download is finished), and
1561 downloads/converts the video to an mp3 file:
1565 from\ __future__\ import\ unicode_literals
1569 class\ MyLogger(object):
1570 \ \ \ \ def\ debug(self,\ msg):
1571 \ \ \ \ \ \ \ \ pass
1573 \ \ \ \ def\ warning(self,\ msg):
1574 \ \ \ \ \ \ \ \ pass
1576 \ \ \ \ def\ error(self,\ msg):
1577 \ \ \ \ \ \ \ \ print(msg)
1581 \ \ \ \ if\ d[\[aq]status\[aq]]\ ==\ \[aq]finished\[aq]:
1582 \ \ \ \ \ \ \ \ print(\[aq]Done\ downloading,\ now\ converting\ ...\[aq])
1586 \ \ \ \ \[aq]format\[aq]:\ \[aq]bestaudio/best\[aq],
1587 \ \ \ \ \[aq]postprocessors\[aq]:\ [{
1588 \ \ \ \ \ \ \ \ \[aq]key\[aq]:\ \[aq]FFmpegExtractAudio\[aq],
1589 \ \ \ \ \ \ \ \ \[aq]preferredcodec\[aq]:\ \[aq]mp3\[aq],
1590 \ \ \ \ \ \ \ \ \[aq]preferredquality\[aq]:\ \[aq]192\[aq],
1592 \ \ \ \ \[aq]logger\[aq]:\ MyLogger(),
1593 \ \ \ \ \[aq]progress_hooks\[aq]:\ [my_hook],
1595 with\ youtube_dl.YoutubeDL(ydl_opts)\ as\ ydl:
1596 \ \ \ \ ydl.download([\[aq]http://www.youtube.com/watch?v=BaW_jenozKc\[aq]])
1601 Bugs and suggestions should be reported at:
1602 <https://github.com/rg3/youtube-dl/issues> .
1603 Unless you were prompted so or there is another pertinent reason (e.g.
1604 GitHub fails to accept the bug report), please do not send bug reports
1606 For discussions, join us in the irc channel #youtube\-dl on freenode.
1608 \f[B]Please include the full output of youtube\-dl when run with
1611 The output (including the first lines) contains important debugging
1613 Issues without the full output are often not reproducible and therefore
1614 do not get solved in short order, if ever.
1616 Please re\-read your issue once again to avoid a couple of common
1617 mistakes (you can and should use this as a checklist):
1618 .SS Is the description of the issue itself sufficient?
1620 We often get issue reports that we cannot really decipher.
1621 While in most cases we eventually get the required information after
1622 asking back multiple times, this poses an unnecessary drain on our
1624 Many contributors, including myself, are also not native speakers, so we
1625 may misread some parts.
1627 So please elaborate on what feature you are requesting, or what bug you
1629 Make sure that it\[aq]s obvious
1633 How it could be fixed
1635 How your proposed solution would look like
1637 If your report is shorter than two lines, it is almost certainly missing
1638 some of these, which makes it hard for us to respond to it.
1639 We\[aq]re often too polite to close the issue outright, but the missing
1640 info makes misinterpretation likely.
1641 As a commiter myself, I often get frustrated by these issues, since the
1642 only possible way for me to move forward on them is to ask for
1643 clarification over and over.
1645 For bug reports, this means that your report should contain the
1646 \f[I]complete\f[] output of youtube\-dl when called with the
1648 The error message you get for (most) bugs even says so, but you would
1649 not believe how many of our bug reports do not contain this information.
1651 If your server has multiple IPs or you suspect censorship, adding
1652 \f[C]\-\-call\-home\f[] may be a good idea to get more diagnostics.
1653 If the error is \f[C]ERROR:\ Unable\ to\ extract\ ...\f[] and you cannot
1654 reproduce it from multiple countries, add \f[C]\-\-dump\-pages\f[]
1655 (warning: this will yield a rather large output, redirect it to the file
1656 \f[C]log.txt\f[] by adding \f[C]>log.txt\ 2>&1\f[] to your
1657 command\-line) or upload the \f[C]\&.dump\f[] files you get when you add
1658 \f[C]\-\-write\-pages\f[] somewhere (https://gist.github.com/).
1660 \f[B]Site support requests must contain an example URL\f[].
1661 An example URL is a URL you might want to download, like
1662 http://www.youtube.com/watch?v=BaW_jenozKc .
1663 There should be an obvious video present.
1664 Except under very special circumstances, the main page of a video
1666 http://www.youtube.com/ ) is \f[I]not\f[] an example URL.
1667 .SS Are you using the latest version?
1669 Before reporting any issue, type \f[C]youtube\-dl\ \-U\f[].
1670 This should report that you\[aq]re up\-to\-date.
1671 About 20% of the reports we receive are already fixed, but people are
1672 using outdated versions.
1673 This goes for feature requests as well.
1674 .SS Is the issue already documented?
1676 Make sure that someone has not already opened the issue you\[aq]re
1678 Search at the top of the window or at
1679 https://github.com/rg3/youtube\-dl/search?type=Issues .
1680 If there is an issue, feel free to write something along the lines of
1681 "This affects me as well, with version 2015.01.01.
1682 Here is some more information on the issue: ...".
1683 While some issues may be old, a new post into them often spurs rapid
1685 .SS Why are existing options not enough?
1687 Before requesting a new feature, please have a quick peek at the list of
1689 options (https://github.com/rg3/youtube-dl/blob/master/README.md#synopsis).
1690 Many feature requests are for features that actually exist already!
1691 Please, absolutely do show off your work in the issue report and detail
1692 how the existing similar options do \f[I]not\f[] solve your problem.
1693 .SS Is there enough context in your bug report?
1695 People want to solve problems, and often think they do us a favor by
1696 breaking down their larger problems (e.g.
1697 wanting to skip already downloaded files) to a specific request (e.g.
1698 requesting us to look whether the file exists before downloading the
1700 However, what often happens is that they break down the problem into two
1701 steps: One simple, and one impossible (or extremely complicated one).
1703 We are then presented with a very complicated request when the original
1704 problem could be solved far easier, e.g.
1705 by recording the downloaded video IDs in a separate file.
1706 To avoid this, you must include the greater context where it is
1708 In particular, every feature request that does not consist of adding
1709 support for a new site should contain a use case scenario that explains
1710 in what situation the missing feature would be useful.
1711 .SS Does the issue involve one problem, and one problem only?
1713 Some of our users seem to think there is a limit of issues they can or
1715 There is no limit of issues they can or should open.
1716 While it may seem appealing to be able to dump all your issues into one
1717 ticket, that means that someone who solves one of your issues cannot
1718 mark the issue as closed.
1719 Typically, reporting a bunch of issues leads to the ticket lingering
1720 since nobody wants to attack that behemoth, until someone mercifully
1721 splits the issue into multiple ones.
1723 In particular, every site support request issue should only pertain to
1724 services at one site (generally under a common domain, but always using
1725 the same backend technology).
1726 Do not request support for vimeo user videos, Whitehouse podcasts, and
1727 Google Plus pages in the same issue.
1728 Also, make sure that you don\[aq]t post bug reports alongside feature
1730 As a rule of thumb, a feature request does not include outputs of
1731 youtube\-dl that are not immediately related to the feature at hand.
1732 Do not post reports of a network error alongside the request for a new
1734 .SS Is anyone going to need the feature?
1736 Only post features that you (or an incapacitated friend you can
1737 personally talk to) require.
1738 Do not post features because they seem like a good idea.
1739 If they are really useful, they will be requested by someone who
1741 .SS Is your question about youtube\-dl?
1743 It may sound strange, but some bug reports we receive are completely
1744 unrelated to youtube\-dl and relate to a different or even the
1745 reporter\[aq]s own application.
1746 Please make sure that you are actually using youtube\-dl.
1747 If you are using a UI for youtube\-dl, report the bug to the maintainer
1748 of the actual application providing the UI.
1749 On the other hand, if your UI for youtube\-dl fails in some way you
1750 believe is related to youtube\-dl, by all means, go ahead and report the
1754 youtube\-dl is released into the public domain by the copyright holders.
1756 This README file was originally written by Daniel Bolton
1757 (<https://github.com/dbbolton>) and is likewise released into the public