]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube-dl.1
Add note about mplayer2 and backporters.
[youtubedl] / youtube-dl.1
1 .TH "YOUTUBE\-DL" "1" "" "" ""
2 .SH NAME
3 .PP
4 youtube\-dl \- download videos from youtube.com or other video platforms
5 .SH SYNOPSIS
6 .PP
7 \f[B]youtube\-dl\f[] [OPTIONS] URL [URL...]
8 .SH DESCRIPTION
9 .PP
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.
17 .SH OPTIONS
18 .TP
19 .B \-h, \-\-help
20 Print this help text and exit
21 .RS
22 .RE
23 .TP
24 .B \-\-version
25 Print program version and exit
26 .RS
27 .RE
28 .TP
29 .B \-U, \-\-update
30 Update this program to latest version.
31 Make sure that you have sufficient permissions (run with sudo if needed)
32 .RS
33 .RE
34 .TP
35 .B \-i, \-\-ignore\-errors
36 Continue on download errors, for example to skip unavailable videos in a
37 playlist
38 .RS
39 .RE
40 .TP
41 .B \-\-abort\-on\-error
42 Abort downloading of further videos (in the playlist or the command
43 line) if an error occurs
44 .RS
45 .RE
46 .TP
47 .B \-\-dump\-user\-agent
48 Display the current browser identification
49 .RS
50 .RE
51 .TP
52 .B \-\-list\-extractors
53 List all supported extractors
54 .RS
55 .RE
56 .TP
57 .B \-\-extractor\-descriptions
58 Output descriptions of all supported extractors
59 .RS
60 .RE
61 .TP
62 .B \-\-force\-generic\-extractor
63 Force extraction to use the generic extractor
64 .RS
65 .RE
66 .TP
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.
76 .RS
77 .RE
78 .TP
79 .B \-\-ignore\-config
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)
84 .RS
85 .RE
86 .TP
87 .B \-\-flat\-playlist
88 Do not extract the videos of a playlist, only list them.
89 .RS
90 .RE
91 .TP
92 .B \-\-no\-color
93 Do not emit color codes in output
94 .RS
95 .RE
96 .SS Network Options:
97 .TP
98 .B \-\-proxy \f[I]URL\f[]
99 Use the specified HTTP/HTTPS proxy.
100 Pass in an empty string (\-\-proxy "") for direct connection
101 .RS
102 .RE
103 .TP
104 .B \-\-socket\-timeout \f[I]SECONDS\f[]
105 Time to wait before giving up, in seconds
106 .RS
107 .RE
108 .TP
109 .B \-\-source\-address \f[I]IP\f[]
110 Client\-side IP address to bind to (experimental)
111 .RS
112 .RE
113 .TP
114 .B \-4, \-\-force\-ipv4
115 Make all connections via IPv4 (experimental)
116 .RS
117 .RE
118 .TP
119 .B \-6, \-\-force\-ipv6
120 Make all connections via IPv6 (experimental)
121 .RS
122 .RE
123 .TP
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.
128 (experimental)
129 .RS
130 .RE
131 .SS Video Selection:
132 .TP
133 .B \-\-playlist\-start \f[I]NUMBER\f[]
134 Playlist video to start at (default is 1)
135 .RS
136 .RE
137 .TP
138 .B \-\-playlist\-end \f[I]NUMBER\f[]
139 Playlist video to end at (default is last)
140 .RS
141 .RE
142 .TP
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.
150 .RS
151 .RE
152 .TP
153 .B \-\-match\-title \f[I]REGEX\f[]
154 Download only matching titles (regex or caseless sub\-string)
155 .RS
156 .RE
157 .TP
158 .B \-\-reject\-title \f[I]REGEX\f[]
159 Skip download for matching titles (regex or caseless sub\-string)
160 .RS
161 .RE
162 .TP
163 .B \-\-max\-downloads \f[I]NUMBER\f[]
164 Abort after downloading NUMBER files
165 .RS
166 .RE
167 .TP
168 .B \-\-min\-filesize \f[I]SIZE\f[]
169 Do not download any videos smaller than SIZE (e.g.
170 50k or 44.6m)
171 .RS
172 .RE
173 .TP
174 .B \-\-max\-filesize \f[I]SIZE\f[]
175 Do not download any videos larger than SIZE (e.g.
176 50k or 44.6m)
177 .RS
178 .RE
179 .TP
180 .B \-\-date \f[I]DATE\f[]
181 Download only videos uploaded in this date
182 .RS
183 .RE
184 .TP
185 .B \-\-datebefore \f[I]DATE\f[]
186 Download only videos uploaded on or before this date (i.e.
187 inclusive)
188 .RS
189 .RE
190 .TP
191 .B \-\-dateafter \f[I]DATE\f[]
192 Download only videos uploaded on or after this date (i.e.
193 inclusive)
194 .RS
195 .RE
196 .TP
197 .B \-\-min\-views \f[I]COUNT\f[]
198 Do not download any videos with less than COUNT views
199 .RS
200 .RE
201 .TP
202 .B \-\-max\-views \f[I]COUNT\f[]
203 Do not download any videos with more than COUNT views
204 .RS
205 .RE
206 .TP
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 &
218 dislike_count <?
219 50 & description" .
220 .RS
221 .RE
222 .TP
223 .B \-\-no\-playlist
224 Download only the video, if the URL refers to a video and a playlist.
225 .RS
226 .RE
227 .TP
228 .B \-\-yes\-playlist
229 Download the playlist, if the URL refers to a video and a playlist.
230 .RS
231 .RE
232 .TP
233 .B \-\-age\-limit \f[I]YEARS\f[]
234 Download only videos suitable for the given age
235 .RS
236 .RE
237 .TP
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.
241 .RS
242 .RE
243 .TP
244 .B \-\-include\-ads
245 Download advertisements as well (experimental)
246 .RS
247 .RE
248 .SS Download Options:
249 .TP
250 .B \-r, \-\-rate\-limit \f[I]LIMIT\f[]
251 Maximum download rate in bytes per second (e.g.
252 50K or 4.2M)
253 .RS
254 .RE
255 .TP
256 .B \-R, \-\-retries \f[I]RETRIES\f[]
257 Number of retries (default is 10), or "infinite".
258 .RS
259 .RE
260 .TP
261 .B \-\-buffer\-size \f[I]SIZE\f[]
262 Size of download buffer (e.g.
263 1024 or 16K) (default is 1024)
264 .RS
265 .RE
266 .TP
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
270 value of SIZE.
271 .RS
272 .RE
273 .TP
274 .B \-\-playlist\-reverse
275 Download playlist videos in reverse order
276 .RS
277 .RE
278 .TP
279 .B \-\-xattr\-set\-filesize
280 Set file xattribute ytdl.filesize with expected filesize (experimental)
281 .RS
282 .RE
283 .TP
284 .B \-\-hls\-prefer\-native
285 Use the native HLS downloader instead of ffmpeg (experimental)
286 .RS
287 .RE
288 .TP
289 .B \-\-external\-downloader \f[I]COMMAND\f[]
290 Use the specified external downloader.
291 Currently supports aria2c,axel,curl,httpie,wget
292 .RS
293 .RE
294 .TP
295 .B \-\-external\-downloader\-args \f[I]ARGS\f[]
296 Give these arguments to the external downloader
297 .RS
298 .RE
299 .SS Filesystem Options:
300 .TP
301 .B \-a, \-\-batch\-file \f[I]FILE\f[]
302 File containing URLs to download (\[aq]\-\[aq] for stdin)
303 .RS
304 .RE
305 .TP
306 .B \-\-id
307 Use only video ID in file name
308 .RS
309 .RE
310 .TP
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
325 format.
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] .
330 .RS
331 .RE
332 .TP
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
336 .RS
337 .RE
338 .TP
339 .B \-\-restrict\-filenames
340 Restrict filenames to only ASCII characters, and avoid "&" and spaces in
341 filenames
342 .RS
343 .RE
344 .TP
345 .B \-A, \-\-auto\-number
346 [deprecated; use \-o "%(autonumber)s\-%(title)s.%(ext)s" ] Number
347 downloaded files starting from 00000
348 .RS
349 .RE
350 .TP
351 .B \-t, \-\-title
352 [deprecated] Use title in file name (default)
353 .RS
354 .RE
355 .TP
356 .B \-l, \-\-literal
357 [deprecated] Alias of \-\-title
358 .RS
359 .RE
360 .TP
361 .B \-w, \-\-no\-overwrites
362 Do not overwrite files
363 .RS
364 .RE
365 .TP
366 .B \-c, \-\-continue
367 Force resume of partially downloaded files.
368 By default, youtube\-dl will resume downloads if possible.
369 .RS
370 .RE
371 .TP
372 .B \-\-no\-continue
373 Do not resume partially downloaded files (restart from beginning)
374 .RS
375 .RE
376 .TP
377 .B \-\-no\-part
378 Do not use .part files \- write directly into output file
379 .RS
380 .RE
381 .TP
382 .B \-\-no\-mtime
383 Do not use the Last\-modified header to set the file modification time
384 .RS
385 .RE
386 .TP
387 .B \-\-write\-description
388 Write video description to a .description file
389 .RS
390 .RE
391 .TP
392 .B \-\-write\-info\-json
393 Write video metadata to a .info.json file
394 .RS
395 .RE
396 .TP
397 .B \-\-write\-annotations
398 Write video annotations to a .annotations.xml file
399 .RS
400 .RE
401 .TP
402 .B \-\-load\-info \f[I]FILE\f[]
403 JSON file containing the video information (created with the
404 "\-\-write\-info\-json" option)
405 .RS
406 .RE
407 .TP
408 .B \-\-cookies \f[I]FILE\f[]
409 File to read cookies from and dump cookie jar in
410 .RS
411 .RE
412 .TP
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.
419 .RS
420 .RE
421 .TP
422 .B \-\-no\-cache\-dir
423 Disable filesystem caching
424 .RS
425 .RE
426 .TP
427 .B \-\-rm\-cache\-dir
428 Delete all filesystem cache files
429 .RS
430 .RE
431 .SS Thumbnail images:
432 .TP
433 .B \-\-write\-thumbnail
434 Write thumbnail image to disk
435 .RS
436 .RE
437 .TP
438 .B \-\-write\-all\-thumbnails
439 Write all thumbnail image formats to disk
440 .RS
441 .RE
442 .TP
443 .B \-\-list\-thumbnails
444 Simulate and list all available thumbnail formats
445 .RS
446 .RE
447 .SS Verbosity / Simulation Options:
448 .TP
449 .B \-q, \-\-quiet
450 Activate quiet mode
451 .RS
452 .RE
453 .TP
454 .B \-\-no\-warnings
455 Ignore warnings
456 .RS
457 .RE
458 .TP
459 .B \-s, \-\-simulate
460 Do not download the video and do not write anything to disk
461 .RS
462 .RE
463 .TP
464 .B \-\-skip\-download
465 Do not download the video
466 .RS
467 .RE
468 .TP
469 .B \-g, \-\-get\-url
470 Simulate, quiet but print URL
471 .RS
472 .RE
473 .TP
474 .B \-e, \-\-get\-title
475 Simulate, quiet but print title
476 .RS
477 .RE
478 .TP
479 .B \-\-get\-id
480 Simulate, quiet but print id
481 .RS
482 .RE
483 .TP
484 .B \-\-get\-thumbnail
485 Simulate, quiet but print thumbnail URL
486 .RS
487 .RE
488 .TP
489 .B \-\-get\-description
490 Simulate, quiet but print video description
491 .RS
492 .RE
493 .TP
494 .B \-\-get\-duration
495 Simulate, quiet but print video length
496 .RS
497 .RE
498 .TP
499 .B \-\-get\-filename
500 Simulate, quiet but print output filename
501 .RS
502 .RE
503 .TP
504 .B \-\-get\-format
505 Simulate, quiet but print output format
506 .RS
507 .RE
508 .TP
509 .B \-j, \-\-dump\-json
510 Simulate, quiet but print JSON information.
511 See \-\-output for a description of available keys.
512 .RS
513 .RE
514 .TP
515 .B \-J, \-\-dump\-single\-json
516 Simulate, quiet but print JSON information for each command\-line
517 argument.
518 If the URL refers to a playlist, dump the whole playlist information in
519 a single line.
520 .RS
521 .RE
522 .TP
523 .B \-\-print\-json
524 Be quiet and print the video information as JSON (video is still being
525 downloaded).
526 .RS
527 .RE
528 .TP
529 .B \-\-newline
530 Output progress bar as new lines
531 .RS
532 .RE
533 .TP
534 .B \-\-no\-progress
535 Do not print progress bar
536 .RS
537 .RE
538 .TP
539 .B \-\-console\-title
540 Display progress in console titlebar
541 .RS
542 .RE
543 .TP
544 .B \-v, \-\-verbose
545 Print various debugging information
546 .RS
547 .RE
548 .TP
549 .B \-\-dump\-pages
550 Print downloaded pages encoded using base64 to debug problems (very
551 verbose)
552 .RS
553 .RE
554 .TP
555 .B \-\-write\-pages
556 Write downloaded intermediary pages to files in the current directory to
557 debug problems
558 .RS
559 .RE
560 .TP
561 .B \-\-print\-traffic
562 Display sent and read HTTP traffic
563 .RS
564 .RE
565 .TP
566 .B \-C, \-\-call\-home
567 Contact the youtube\-dl server for debugging
568 .RS
569 .RE
570 .TP
571 .B \-\-no\-call\-home
572 Do NOT contact the youtube\-dl server for debugging
573 .RS
574 .RE
575 .SS Workarounds:
576 .TP
577 .B \-\-encoding \f[I]ENCODING\f[]
578 Force the specified encoding (experimental)
579 .RS
580 .RE
581 .TP
582 .B \-\-no\-check\-certificate
583 Suppress HTTPS certificate validation
584 .RS
585 .RE
586 .TP
587 .B \-\-prefer\-insecure
588 Use an unencrypted connection to retrieve information about the video.
589 (Currently supported only for YouTube)
590 .RS
591 .RE
592 .TP
593 .B \-\-user\-agent \f[I]UA\f[]
594 Specify a custom user agent
595 .RS
596 .RE
597 .TP
598 .B \-\-referer \f[I]URL\f[]
599 Specify a custom referer, use if the video access is restricted to one
600 domain
601 .RS
602 .RE
603 .TP
604 .B \-\-add\-header \f[I]FIELD:VALUE\f[]
605 Specify a custom HTTP header and its value, separated by a colon
606 \[aq]:\[aq].
607 You can use this option multiple times
608 .RS
609 .RE
610 .TP
611 .B \-\-bidi\-workaround
612 Work around terminals that lack bidirectional text support.
613 Requires bidiv or fribidi executable in PATH
614 .RS
615 .RE
616 .TP
617 .B \-\-sleep\-interval \f[I]SECONDS\f[]
618 Number of seconds to sleep before each download.
619 .RS
620 .RE
621 .SS Video Format Options:
622 .TP
623 .B \-f, \-\-format \f[I]FORMAT\f[]
624 Video format code, see the "FORMAT SELECTION" for all the info
625 .RS
626 .RE
627 .TP
628 .B \-\-all\-formats
629 Download all available video formats
630 .RS
631 .RE
632 .TP
633 .B \-\-prefer\-free\-formats
634 Prefer free video formats unless a specific one is requested
635 .RS
636 .RE
637 .TP
638 .B \-F, \-\-list\-formats
639 List all available formats
640 .RS
641 .RE
642 .TP
643 .B \-\-youtube\-skip\-dash\-manifest
644 Do not download the DASH manifests and related data on YouTube videos
645 .RS
646 .RE
647 .TP
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
653 .RS
654 .RE
655 .SS Subtitle Options:
656 .TP
657 .B \-\-write\-sub
658 Write subtitle file
659 .RS
660 .RE
661 .TP
662 .B \-\-write\-auto\-sub
663 Write automatic subtitle file (YouTube only)
664 .RS
665 .RE
666 .TP
667 .B \-\-all\-subs
668 Download all the available subtitles of the video
669 .RS
670 .RE
671 .TP
672 .B \-\-list\-subs
673 List all available subtitles for the video
674 .RS
675 .RE
676 .TP
677 .B \-\-sub\-format \f[I]FORMAT\f[]
678 Subtitle format, accepts formats preference, for example: "srt" or
679 "ass/srt/best"
680 .RS
681 .RE
682 .TP
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]
686 .RS
687 .RE
688 .SS Authentication Options:
689 .TP
690 .B \-u, \-\-username \f[I]USERNAME\f[]
691 Login with this account ID
692 .RS
693 .RE
694 .TP
695 .B \-p, \-\-password \f[I]PASSWORD\f[]
696 Account password.
697 If this option is left out, youtube\-dl will ask interactively.
698 .RS
699 .RE
700 .TP
701 .B \-2, \-\-twofactor \f[I]TWOFACTOR\f[]
702 Two\-factor auth code
703 .RS
704 .RE
705 .TP
706 .B \-n, \-\-netrc
707 Use .netrc authentication data
708 .RS
709 .RE
710 .TP
711 .B \-\-video\-password \f[I]PASSWORD\f[]
712 Video password (vimeo, smotri, youku)
713 .RS
714 .RE
715 .SS Post\-processing Options:
716 .TP
717 .B \-x, \-\-extract\-audio
718 Convert video files to audio\-only files (requires ffmpeg or avconv and
719 ffprobe or avprobe)
720 .RS
721 .RE
722 .TP
723 .B \-\-audio\-format \f[I]FORMAT\f[]
724 Specify audio format: "best", "aac", "vorbis", "mp3", "m4a", "opus", or
725 "wav"; "best" by default
726 .RS
727 .RE
728 .TP
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)
732 .RS
733 .RE
734 .TP
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)
738 .RS
739 .RE
740 .TP
741 .B \-\-postprocessor\-args \f[I]ARGS\f[]
742 Give these arguments to the postprocessor
743 .RS
744 .RE
745 .TP
746 .B \-k, \-\-keep\-video
747 Keep the video file on disk after the post\- processing; the video is
748 erased by default
749 .RS
750 .RE
751 .TP
752 .B \-\-no\-post\-overwrites
753 Do not overwrite post\-processed files; the post\-processed files are
754 overwritten by default
755 .RS
756 .RE
757 .TP
758 .B \-\-embed\-subs
759 Embed subtitles in the video (only for mkv and mp4 videos)
760 .RS
761 .RE
762 .TP
763 .B \-\-embed\-thumbnail
764 Embed thumbnail in the audio as cover art
765 .RS
766 .RE
767 .TP
768 .B \-\-add\-metadata
769 Write metadata to the video file
770 .RS
771 .RE
772 .TP
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"
780 .RS
781 .RE
782 .TP
783 .B \-\-xattrs
784 Write metadata to the video file\[aq]s xattrs (using dublin core and xdg
785 standards)
786 .RS
787 .RE
788 .TP
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)
793 .RS
794 .RE
795 .TP
796 .B \-\-prefer\-avconv
797 Prefer avconv over ffmpeg for running the postprocessors (default)
798 .RS
799 .RE
800 .TP
801 .B \-\-prefer\-ffmpeg
802 Prefer ffmpeg over avconv for running the postprocessors
803 .RS
804 .RE
805 .TP
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.
809 .RS
810 .RE
811 .TP
812 .B \-\-exec \f[I]CMD\f[]
813 Execute a command on the file after downloading, similar to find\[aq]s
814 \-exec syntax.
815 Example: \-\-exec \[aq]adb push {} /sdcard/Music/ && rm {}\[aq]
816 .RS
817 .RE
818 .TP
819 .B \-\-convert\-subtitles \f[I]FORMAT\f[]
820 Convert the subtitles to other format (currently supported: srt|ass|vtt)
821 .RS
822 .RE
823 .SH CONFIGURATION
824 .PP
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:
835 .IP
836 .nf
837 \f[C]
838 \-\-extract\-audio
839 \-\-no\-mtime
840 \-\-proxy\ 127.0.0.1:3128
841 \f[]
842 .fi
843 .PP
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
847 .PP
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
853 history.
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:
858 .IP
859 .nf
860 \f[C]
861 touch\ $HOME/.netrc
862 chmod\ a\-rwx,u+rw\ $HOME/.netrc
863 \f[]
864 .fi
865 .PP
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:
868 .IP
869 .nf
870 \f[C]
871 machine\ <extractor>\ login\ <login>\ password\ <password>
872 \f[]
873 .fi
874 .PP
875 For example:
876 .IP
877 .nf
878 \f[C]
879 machine\ youtube\ login\ myaccount\@gmail.com\ password\ my_youtube_password
880 machine\ twitch\ login\ my_twitch_account_name\ password\ my_twitch_password
881 \f[]
882 .fi
883 .PP
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).
887 .PP
888 On Windows you may also need to setup the \f[C]%HOME%\f[] environment
889 variable manually.
890 .SH OUTPUT TEMPLATE
891 .PP
892 The \f[C]\-o\f[] option allows users to indicate a template for the
893 output file names.
894 The basic usage is not to set any template arguments when downloading a
895 single file, like in
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.
902 Allowed names are:
903 .IP \[bu] 2
904 \f[C]id\f[]: The sequence will be replaced by the video identifier.
905 .IP \[bu] 2
906 \f[C]url\f[]: The sequence will be replaced by the video URL.
907 .IP \[bu] 2
908 \f[C]uploader\f[]: The sequence will be replaced by the nickname of the
909 person who uploaded the video.
910 .IP \[bu] 2
911 \f[C]upload_date\f[]: The sequence will be replaced by the upload date
912 in YYYYMMDD format.
913 .IP \[bu] 2
914 \f[C]title\f[]: The sequence will be replaced by the video title.
915 .IP \[bu] 2
916 \f[C]ext\f[]: The sequence will be replaced by the appropriate extension
917 (like flv or mp4).
918 .IP \[bu] 2
919 \f[C]epoch\f[]: The sequence will be replaced by the Unix epoch when
920 creating the file.
921 .IP \[bu] 2
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.
924 .IP \[bu] 2
925 \f[C]playlist\f[]: The sequence will be replaced by the name or the id
926 of the playlist that contains the video.
927 .IP \[bu] 2
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.
931 .IP \[bu] 2
932 \f[C]format_id\f[]: The sequence will be replaced by the format code
933 specified by \f[C]\-\-format\f[].
934 .IP \[bu] 2
935 \f[C]duration\f[]: The sequence will be replaced by the length of the
936 video in seconds.
937 .PP
938 The current default template is \f[C]%(title)s\-%(id)s.%(ext)s\f[].
939 .PP
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
944 shorter title:
945 .IP
946 .nf
947 \f[C]
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
952 \f[]
953 .fi
954 .SH FORMAT SELECTION
955 .PP
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
959 \f[C]\-f\ 22\f[].
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
964 \f[C]worst\f[].
965 .PP
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
980 KBit/s.
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[].
989 .PP
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
992 #5447, #5456).
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
1000 files.
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.
1011 .PP
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.
1018 .SH VIDEO SELECTION
1019 .PP
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:
1023 .IP \[bu] 2
1024 Absolute dates: Dates in the format \f[C]YYYYMMDD\f[].
1025 .IP \[bu] 2
1026 Relative dates: Dates in the format
1027 \f[C](now|today)[+\-][0\-9](day|week|month|year)(s)?\f[]
1028 .PP
1029 Examples:
1030 .IP
1031 .nf
1032 \f[C]
1033 #\ Download\ only\ the\ videos\ uploaded\ in\ the\ last\ 6\ months
1034 $\ youtube\-dl\ \-\-dateafter\ now\-6months
1035
1036 #\ Download\ only\ the\ videos\ uploaded\ on\ January\ 1,\ 1970
1037 $\ youtube\-dl\ \-\-date\ 19700101
1038
1039 $\ #\ Download\ only\ the\ videos\ uploaded\ in\ the\ 200x\ decade
1040 $\ youtube\-dl\ \-\-dateafter\ 20000101\ \-\-datebefore\ 20091231
1041 \f[]
1042 .fi
1043 .SH FAQ
1044 .SS How do I update youtube\-dl?
1045 .PP
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[]).
1050 .PP
1051 If you have used pip, a simple
1052 \f[C]sudo\ pip\ install\ \-U\ youtube\-dl\f[] is sufficient to update.
1053 .PP
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
1064 or support forum.
1065 .PP
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
1069 .IP
1070 .nf
1071 \f[C]
1072 sudo\ apt\-get\ remove\ \-y\ youtube\-dl
1073 \f[]
1074 .fi
1075 .PP
1076 Afterwards, simply follow our manual installation
1077 instructions (http://rg3.github.io/youtube-dl/download.html):
1078 .IP
1079 .nf
1080 \f[C]
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
1083 hash\ \-r
1084 \f[]
1085 .fi
1086 .PP
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
1091 .PP
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
1094 videos.
1095 .PP
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.
1100 Feel free to report
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
1105 version.
1106 See above for a way to update.
1107 .SS Do I always have to pass \f[C]\-citw\f[]?
1108 .PP
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?
1117 .PP
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
1127 this?
1128 .PP
1129 Apparently YouTube requires you to pass a CAPTCHA test if you download
1130 too much.
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 I have downloaded a video but how can I play it?
1136 .PP
1137 Once the video is fully downloaded, use any video player, such as
1138 vlc (http://www.videolan.org) or mplayer (http://www.mplayerhq.hu/).
1139 .SS I extracted a video URL with \f[C]\-g\f[], but it does not play on
1140 another machine / in my webbrowser.
1141 .PP
1142 It depends a lot on the service.
1143 In many cases, requests for the video (to download/play it) must come
1144 from the same IP address and with the same cookies.
1145 Use the \f[C]\-\-cookies\f[] option to write the required cookies into a
1146 file, and advise your downloader to read cookies from that file.
1147 Some sites also require a common user agent to be used, use
1148 \f[C]\-\-dump\-user\-agent\f[] to see the one in use by youtube\-dl.
1149 .PP
1150 It may be beneficial to use IPv6; in some cases, the restrictions are
1151 only applied to IPv4.
1152 Some services (sometimes only for a subset of videos) do not restrict
1153 the video URL by IP address, cookie, or user\-agent, but these are the
1154 exception rather than the rule.
1155 .PP
1156 Please bear in mind that some URL protocols are \f[B]not\f[] supported
1157 by browsers out of the box, including RTMP.
1158 If you are using \f[C]\-g\f[], your own downloader must support these as
1159 well.
1160 .PP
1161 If you want to play the video on a machine that is not running
1162 youtube\-dl, you can relay the video content from the machine that runs
1163 youtube\-dl.
1164 You can use \f[C]\-o\ \-\f[] to let youtube\-dl stream a video to
1165 stdout, or simply allow the player to download the files written by
1166 youtube\-dl in turn.
1167 .SS ERROR: no fmt_url_map or conn information found in video info
1168 .PP
1169 YouTube has switched to a new video info format in July 2011 which is
1170 not supported by old versions of youtube\-dl.
1171 See above (#how-do-i-update-youtube-dl) for how to update youtube\-dl.
1172 .SS ERROR: unable to download video
1173 .PP
1174 YouTube requires an additional signature since September 2012 which is
1175 not supported by old versions of youtube\-dl.
1176 See above (#how-do-i-update-youtube-dl) for how to update youtube\-dl.
1177 .SS Video URL contains an ampersand and I\[aq]m getting some strange
1178 output \f[C][1]\ 2839\f[] or
1179 \f[C]\[aq]v\[aq]\ is\ not\ recognized\ as\ an\ internal\ or\ external\ command\f[]
1180 .PP
1181 That\[aq]s actually the output from your shell.
1182 Since ampersand is one of the special shell characters it\[aq]s
1183 interpreted by the shell preventing you from passing the whole URL to
1184 youtube\-dl.
1185 To disable your shell from interpreting the ampersands (or any other
1186 special characters) you have to either put the whole URL in quotes or
1187 escape them with a backslash (which approach will work depends on your
1188 shell).
1189 .PP
1190 For example if your URL is
1191 https://www.youtube.com/watch?t=4&v=BaW_jenozKc you should end up with
1192 following command:
1193 .PP
1194 \f[C]youtube\-dl\ \[aq]https://www.youtube.com/watch?t=4&v=BaW_jenozKc\[aq]\f[]
1195 .PP
1196 or
1197 .PP
1198 \f[C]youtube\-dl\ https://www.youtube.com/watch?t=4\\&v=BaW_jenozKc\f[]
1199 .PP
1200 For Windows you have to use the double quotes:
1201 .PP
1202 \f[C]youtube\-dl\ "https://www.youtube.com/watch?t=4&v=BaW_jenozKc"\f[]
1203 .SS ExtractorError: Could not find JS function u\[aq]OF\[aq]
1204 .PP
1205 In February 2015, the new YouTube player contained a character sequence
1206 in a string that was misinterpreted by old versions of youtube\-dl.
1207 See above (#how-do-i-update-youtube-dl) for how to update youtube\-dl.
1208 .SS HTTP Error 429: Too Many Requests or 402: Payment Required
1209 .PP
1210 These two error codes indicate that the service is blocking your IP
1211 address because of overuse.
1212 Contact the service and ask them to unblock your IP address, or \- if
1213 you have acquired a whitelisted IP address already \- use the
1214 \f[C]\-\-proxy\f[] or \f[C]\-\-source\-address\f[]
1215 options (#network-options) to select another IP address.
1216 .SS SyntaxError: Non\-ASCII character
1217 .PP
1218 The error
1219 .IP
1220 .nf
1221 \f[C]
1222 File\ "youtube\-dl",\ line\ 2
1223 SyntaxError:\ Non\-ASCII\ character\ \[aq]\\x93\[aq]\ ...
1224 \f[]
1225 .fi
1226 .PP
1227 means you\[aq]re using an outdated version of Python.
1228 Please update to Python 2.6 or 2.7.
1229 .SS What is this binary file? Where has the code gone?
1230 .PP
1231 Since June 2012 (#342) youtube\-dl is packed as an executable zipfile,
1232 simply unzip it (might need renaming to \f[C]youtube\-dl.zip\f[] first
1233 on some systems) or clone the git repository, as laid out above.
1234 If you modify the code, you can run it by executing the
1235 \f[C]__main__.py\f[] file.
1236 To recompile the executable, run \f[C]make\ youtube\-dl\f[].
1237 .SS The exe throws a \f[I]Runtime error from Visual C++\f[]
1238 .PP
1239 To run the exe you need to install first the Microsoft Visual C++ 2008
1240 Redistributable
1241 Package (http://www.microsoft.com/en-us/download/details.aspx?id=29).
1242 .SS On Windows, how should I set up ffmpeg and youtube\-dl? Where should
1243 I put the exe files?
1244 .PP
1245 If you put youtube\-dl and ffmpeg in the same directory that you\[aq]re
1246 running the command from, it will work, but that\[aq]s rather
1247 cumbersome.
1248 .PP
1249 To make a different directory work \- either for ffmpeg, or for
1250 youtube\-dl, or for both \- simply create the directory (say,
1251 \f[C]C:\\bin\f[], or \f[C]C:\\Users\\<User\ name>\\bin\f[]), put all the
1252 executables directly in there, and then set your PATH environment
1253 variable (https://www.java.com/en/download/help/path.xml) to include
1254 that directory.
1255 .PP
1256 From then on, after restarting your shell, you will be able to access
1257 both youtube\-dl and ffmpeg (and youtube\-dl will be able to find
1258 ffmpeg) by simply typing \f[C]youtube\-dl\f[] or \f[C]ffmpeg\f[], no
1259 matter what directory you\[aq]re in.
1260 .SS How do I put downloads into a specific folder?
1261 .PP
1262 Use the \f[C]\-o\f[] to specify an output template (#output-template),
1263 for example \f[C]\-o\ "/home/user/videos/%(title)s\-%(id)s.%(ext)s"\f[].
1264 If you want this for all of your downloads, put the option into your
1265 configuration file (#configuration).
1266 .SS How do I download a video starting with a \f[C]\-\f[] ?
1267 .PP
1268 Either prepend \f[C]http://www.youtube.com/watch?v=\f[] or separate the
1269 ID from the options with \f[C]\-\-\f[]:
1270 .IP
1271 .nf
1272 \f[C]
1273 youtube\-dl\ \-\-\ \-wNyEUrxzFU
1274 youtube\-dl\ "http://www.youtube.com/watch?v=\-wNyEUrxzFU"
1275 \f[]
1276 .fi
1277 .SS How do I pass cookies to youtube\-dl?
1278 .PP
1279 Use the \f[C]\-\-cookies\f[] option, for example
1280 \f[C]\-\-cookies\ /path/to/cookies/file.txt\f[].
1281 Note that the cookies file must be in Mozilla/Netscape format and the
1282 first line of the cookies file must be either
1283 \f[C]#\ HTTP\ Cookie\ File\f[] or
1284 \f[C]#\ Netscape\ HTTP\ Cookie\ File\f[].
1285 Make sure you have correct newline
1286 format (https://en.wikipedia.org/wiki/Newline) in the cookies file and
1287 convert newlines if necessary to correspond with your OS, namely
1288 \f[C]CRLF\f[] (\f[C]\\r\\n\f[]) for Windows, \f[C]LF\f[] (\f[C]\\n\f[])
1289 for Linux and \f[C]CR\f[] (\f[C]\\r\f[]) for Mac OS.
1290 \f[C]HTTP\ Error\ 400:\ Bad\ Request\f[] when using \f[C]\-\-cookies\f[]
1291 is a good sign of invalid newline format.
1292 .PP
1293 Passing cookies to youtube\-dl is a good way to workaround login when a
1294 particular extractor does not implement it explicitly.
1295 .SS Can you add support for this anime video site, or site which shows
1296 current movies for free?
1297 .PP
1298 As a matter of policy (as well as legality), youtube\-dl does not
1299 include support for services that specialize in infringing copyright.
1300 As a rule of thumb, if you cannot easily find a video that the service
1301 is quite obviously allowed to distribute (i.e.
1302 that has been uploaded by the creator, the creator\[aq]s distributor, or
1303 is published under a free license), the service is probably unfit for
1304 inclusion to youtube\-dl.
1305 .PP
1306 A note on the service that they don\[aq]t host the infringing content,
1307 but just link to those who do, is evidence that the service should
1308 \f[B]not\f[] be included into youtube\-dl.
1309 The same goes for any DMCA note when the whole front page of the service
1310 is filled with videos they are not allowed to distribute.
1311 A "fair use" note is equally unconvincing if the service shows
1312 copyright\-protected videos in full without authorization.
1313 .PP
1314 Support requests for services that \f[B]do\f[] purchase the rights to
1315 distribute their content are perfectly fine though.
1316 If in doubt, you can simply include a source that mentions the
1317 legitimate purchase of content.
1318 .SS How can I speed up work on my issue?
1319 .PP
1320 (Also known as: Help, my important issue not being solved!) The
1321 youtube\-dl core developer team is quite small.
1322 While we do our best to solve as many issues as possible, sometimes that
1323 can take quite a while.
1324 To speed up your issue, here\[aq]s what you can do:
1325 .PP
1326 First of all, please do report the issue at our issue
1327 tracker (https://yt-dl.org/bugs).
1328 That allows us to coordinate all efforts by users and developers, and
1329 serves as a unified point.
1330 Unfortunately, the youtube\-dl project has grown too large to use
1331 personal email as an effective communication channel.
1332 .PP
1333 Please read the bug reporting instructions (#bugs) below.
1334 A lot of bugs lack all the necessary information.
1335 If you can, offer proxy, VPN, or shell access to the youtube\-dl
1336 developers.
1337 If you are able to, test the issue from multiple computers in multiple
1338 countries to exclude local censorship or misconfiguration issues.
1339 .PP
1340 If nobody is interested in solving your issue, you are welcome to take
1341 matters into your own hands and submit a pull request (or coerce/pay
1342 somebody else to do so).
1343 .PP
1344 Feel free to bump the issue from time to time by writing a small comment
1345 ("Issue is still present in youtube\-dl version ...from France, but
1346 fixed from Belgium"), but please not more than once a month.
1347 Please do not declare your issue as \f[C]important\f[] or
1348 \f[C]urgent\f[].
1349 .SS How can I detect whether a given URL is supported by youtube\-dl?
1350 .PP
1351 For one, have a look at the list of supported
1352 sites (docs/supportedsites.md).
1353 Note that it can sometimes happen that the site changes its URL scheme
1354 (say, from http://example.com/video/1234567 to
1355 http://example.com/v/1234567 ) and youtube\-dl reports an URL of a
1356 service in that list as unsupported.
1357 In that case, simply report a bug.
1358 .PP
1359 It is \f[I]not\f[] possible to detect whether a URL is supported or not.
1360 That\[aq]s because youtube\-dl contains a generic extractor which
1361 matches \f[B]all\f[] URLs.
1362 You may be tempted to disable, exclude, or remove the generic extractor,
1363 but the generic extractor not only allows users to extract videos from
1364 lots of websites that embed a video from another service, but may also
1365 be used to extract video from a service that it\[aq]s hosting itself.
1366 Therefore, we neither recommend nor support disabling, excluding, or
1367 removing the generic extractor.
1368 .PP
1369 If you want to find out whether a given URL is supported, simply call
1370 youtube\-dl with it.
1371 If you get no videos back, chances are the URL is either not referring
1372 to a video or unsupported.
1373 You can find out which by examining the output (if you run youtube\-dl
1374 on the console) or catching an \f[C]UnsupportedError\f[] exception if
1375 you run it from a Python program.
1376 .SH DEVELOPER INSTRUCTIONS
1377 .PP
1378 Most users do not need to build youtube\-dl and can download the
1379 builds (http://rg3.github.io/youtube-dl/download.html) or get them from
1380 their distribution.
1381 .PP
1382 To run youtube\-dl as a developer, you don\[aq]t need to build anything
1383 either.
1384 Simply execute
1385 .IP
1386 .nf
1387 \f[C]
1388 python\ \-m\ youtube_dl
1389 \f[]
1390 .fi
1391 .PP
1392 To run the test, simply invoke your favorite test runner, or execute a
1393 test file directly; any of the following work:
1394 .IP
1395 .nf
1396 \f[C]
1397 python\ \-m\ unittest\ discover
1398 python\ test/test_download.py
1399 nosetests
1400 \f[]
1401 .fi
1402 .PP
1403 If you want to create a build of youtube\-dl yourself, you\[aq]ll need
1404 .IP \[bu] 2
1405 python
1406 .IP \[bu] 2
1407 make
1408 .IP \[bu] 2
1409 pandoc
1410 .IP \[bu] 2
1411 zip
1412 .IP \[bu] 2
1413 nosetests
1414 .SS Adding support for a new site
1415 .PP
1416 If you want to add support for a new site, you can follow this quick
1417 list (assuming your service is called \f[C]yourextractor\f[]):
1418 .IP " 1." 4
1419 Fork this repository (https://github.com/rg3/youtube-dl/fork)
1420 .IP " 2." 4
1421 Check out the source code with
1422 \f[C]git\ clone\ git\@github.com:YOUR_GITHUB_USERNAME/youtube\-dl.git\f[]
1423 .IP " 3." 4
1424 Start a new git branch with
1425 \f[C]cd\ youtube\-dl;\ git\ checkout\ \-b\ yourextractor\f[]
1426 .IP " 4." 4
1427 Start with this simple template and save it to
1428 \f[C]youtube_dl/extractor/yourextractor.py\f[]:
1429 .RS 4
1430 .IP
1431 .nf
1432 \f[C]
1433 #\ coding:\ utf\-8
1434 from\ __future__\ import\ unicode_literals
1435
1436 from\ .common\ import\ InfoExtractor
1437
1438
1439 class\ YourExtractorIE(InfoExtractor):
1440 \ \ \ \ _VALID_URL\ =\ r\[aq]https?://(?:www\\.)?yourextractor\\.com/watch/(?P<id>[0\-9]+)\[aq]
1441 \ \ \ \ _TEST\ =\ {
1442 \ \ \ \ \ \ \ \ \[aq]url\[aq]:\ \[aq]http://yourextractor.com/watch/42\[aq],
1443 \ \ \ \ \ \ \ \ \[aq]md5\[aq]:\ \[aq]TODO:\ md5\ sum\ of\ the\ first\ 10241\ bytes\ of\ the\ video\ file\ (use\ \-\-test)\[aq],
1444 \ \ \ \ \ \ \ \ \[aq]info_dict\[aq]:\ {
1445 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]id\[aq]:\ \[aq]42\[aq],
1446 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]ext\[aq]:\ \[aq]mp4\[aq],
1447 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]title\[aq]:\ \[aq]Video\ title\ goes\ here\[aq],
1448 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]thumbnail\[aq]:\ \[aq]re:^https?://.*\\.jpg$\[aq],
1449 \ \ \ \ \ \ \ \ \ \ \ \ #\ TODO\ more\ properties,\ either\ as:
1450 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ A\ value
1451 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ MD5\ checksum;\ start\ the\ string\ with\ md5:
1452 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ A\ regular\ expression;\ start\ the\ string\ with\ re:
1453 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ Any\ Python\ type\ (for\ example\ int\ or\ float)
1454 \ \ \ \ \ \ \ \ }
1455 \ \ \ \ }
1456
1457 \ \ \ \ def\ _real_extract(self,\ url):
1458 \ \ \ \ \ \ \ \ video_id\ =\ self._match_id(url)
1459 \ \ \ \ \ \ \ \ webpage\ =\ self._download_webpage(url,\ video_id)
1460
1461 \ \ \ \ \ \ \ \ #\ TODO\ more\ code\ goes\ here,\ for\ example\ ...
1462 \ \ \ \ \ \ \ \ title\ =\ self._html_search_regex(r\[aq]<h1>(.+?)</h1>\[aq],\ webpage,\ \[aq]title\[aq])
1463
1464 \ \ \ \ \ \ \ \ return\ {
1465 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]id\[aq]:\ video_id,
1466 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]title\[aq]:\ title,
1467 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]description\[aq]:\ self._og_search_description(webpage),
1468 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]uploader\[aq]:\ self._search_regex(r\[aq]<div[^>]+id="uploader"[^>]*>([^<]+)<\[aq],\ webpage,\ \[aq]uploader\[aq],\ fatal=False),
1469 \ \ \ \ \ \ \ \ \ \ \ \ #\ TODO\ more\ properties\ (see\ youtube_dl/extractor/common.py)
1470 \ \ \ \ \ \ \ \ }
1471 \f[]
1472 .fi
1473 .RE
1474 .IP " 5." 4
1475 Add an import in
1476 \f[C]youtube_dl/extractor/__init__.py\f[] (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/__init__.py).
1477 .IP " 6." 4
1478 Run
1479 \f[C]python\ test/test_download.py\ TestDownload.test_YourExtractor\f[].
1480 This \f[I]should fail\f[] at first, but you can continually re\-run it
1481 until you\[aq]re done.
1482 If you decide to add more than one test, then rename \f[C]_TEST\f[] to
1483 \f[C]_TESTS\f[] and make it into a list of dictionaries.
1484 The tests will then be named \f[C]TestDownload.test_YourExtractor\f[],
1485 \f[C]TestDownload.test_YourExtractor_1\f[],
1486 \f[C]TestDownload.test_YourExtractor_2\f[], etc.
1487 .IP " 7." 4
1488 Have a look at
1489 \f[C]youtube_dl/extractor/common.py\f[] (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py)
1490 for possible helper methods and a detailed description of what your
1491 extractor should and may
1492 return (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L62-L200).
1493 Add tests and code for as many as you want.
1494 .IP " 8." 4
1495 If you can, check the code with
1496 flake8 (https://pypi.python.org/pypi/flake8).
1497 .IP " 9." 4
1498 When the tests pass, add (http://git-scm.com/docs/git-add) the new files
1499 and commit (http://git-scm.com/docs/git-commit) them and
1500 push (http://git-scm.com/docs/git-push) the result, like this:
1501 .RS 4
1502 .IP
1503 .nf
1504 \f[C]
1505 $\ git\ add\ youtube_dl/extractor/__init__.py
1506 $\ git\ add\ youtube_dl/extractor/yourextractor.py
1507 $\ git\ commit\ \-m\ \[aq][yourextractor]\ Add\ new\ extractor\[aq]
1508 $\ git\ push\ origin\ yourextractor
1509 \f[]
1510 .fi
1511 .RE
1512 .IP "10." 4
1513 Finally, create a pull
1514 request (https://help.github.com/articles/creating-a-pull-request).
1515 We\[aq]ll then review and merge it.
1516 .PP
1517 In any case, thank you very much for your contributions!
1518 .SH EMBEDDING YOUTUBE\-DL
1519 .PP
1520 youtube\-dl makes the best effort to be a good command\-line program,
1521 and thus should be callable from any programming language.
1522 If you encounter any problems parsing its output, feel free to create a
1523 report (https://github.com/rg3/youtube-dl/issues/new).
1524 .PP
1525 From a Python program, you can embed youtube\-dl in a more powerful
1526 fashion, like this:
1527 .IP
1528 .nf
1529 \f[C]
1530 from\ __future__\ import\ unicode_literals
1531 import\ youtube_dl
1532
1533 ydl_opts\ =\ {}
1534 with\ youtube_dl.YoutubeDL(ydl_opts)\ as\ ydl:
1535 \ \ \ \ ydl.download([\[aq]http://www.youtube.com/watch?v=BaW_jenozKc\[aq]])
1536 \f[]
1537 .fi
1538 .PP
1539 Most likely, you\[aq]ll want to use various options.
1540 For a list of what can be done, have a look at
1541 youtube_dl/YoutubeDL.py (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L117-L265).
1542 For a start, if you want to intercept youtube\-dl\[aq]s output, set a
1543 \f[C]logger\f[] object.
1544 .PP
1545 Here\[aq]s a more complete example of a program that outputs only errors
1546 (and a short message after the download is finished), and
1547 downloads/converts the video to an mp3 file:
1548 .IP
1549 .nf
1550 \f[C]
1551 from\ __future__\ import\ unicode_literals
1552 import\ youtube_dl
1553
1554
1555 class\ MyLogger(object):
1556 \ \ \ \ def\ debug(self,\ msg):
1557 \ \ \ \ \ \ \ \ pass
1558
1559 \ \ \ \ def\ warning(self,\ msg):
1560 \ \ \ \ \ \ \ \ pass
1561
1562 \ \ \ \ def\ error(self,\ msg):
1563 \ \ \ \ \ \ \ \ print(msg)
1564
1565
1566 def\ my_hook(d):
1567 \ \ \ \ if\ d[\[aq]status\[aq]]\ ==\ \[aq]finished\[aq]:
1568 \ \ \ \ \ \ \ \ print(\[aq]Done\ downloading,\ now\ converting\ ...\[aq])
1569
1570
1571 ydl_opts\ =\ {
1572 \ \ \ \ \[aq]format\[aq]:\ \[aq]bestaudio/best\[aq],
1573 \ \ \ \ \[aq]postprocessors\[aq]:\ [{
1574 \ \ \ \ \ \ \ \ \[aq]key\[aq]:\ \[aq]FFmpegExtractAudio\[aq],
1575 \ \ \ \ \ \ \ \ \[aq]preferredcodec\[aq]:\ \[aq]mp3\[aq],
1576 \ \ \ \ \ \ \ \ \[aq]preferredquality\[aq]:\ \[aq]192\[aq],
1577 \ \ \ \ }],
1578 \ \ \ \ \[aq]logger\[aq]:\ MyLogger(),
1579 \ \ \ \ \[aq]progress_hooks\[aq]:\ [my_hook],
1580 }
1581 with\ youtube_dl.YoutubeDL(ydl_opts)\ as\ ydl:
1582 \ \ \ \ ydl.download([\[aq]http://www.youtube.com/watch?v=BaW_jenozKc\[aq]])
1583 \f[]
1584 .fi
1585 .SH BUGS
1586 .PP
1587 Bugs and suggestions should be reported at:
1588 <https://github.com/rg3/youtube-dl/issues> .
1589 Unless you were prompted so or there is another pertinent reason (e.g.
1590 GitHub fails to accept the bug report), please do not send bug reports
1591 via personal email.
1592 For discussions, join us in the irc channel #youtube\-dl on freenode.
1593 .PP
1594 \f[B]Please include the full output of youtube\-dl when run with
1595 \f[C]\-v\f[]\f[].
1596 .PP
1597 The output (including the first lines) contains important debugging
1598 information.
1599 Issues without the full output are often not reproducible and therefore
1600 do not get solved in short order, if ever.
1601 .PP
1602 Please re\-read your issue once again to avoid a couple of common
1603 mistakes (you can and should use this as a checklist):
1604 .SS Is the description of the issue itself sufficient?
1605 .PP
1606 We often get issue reports that we cannot really decipher.
1607 While in most cases we eventually get the required information after
1608 asking back multiple times, this poses an unnecessary drain on our
1609 resources.
1610 Many contributors, including myself, are also not native speakers, so we
1611 may misread some parts.
1612 .PP
1613 So please elaborate on what feature you are requesting, or what bug you
1614 want to be fixed.
1615 Make sure that it\[aq]s obvious
1616 .IP \[bu] 2
1617 What the problem is
1618 .IP \[bu] 2
1619 How it could be fixed
1620 .IP \[bu] 2
1621 How your proposed solution would look like
1622 .PP
1623 If your report is shorter than two lines, it is almost certainly missing
1624 some of these, which makes it hard for us to respond to it.
1625 We\[aq]re often too polite to close the issue outright, but the missing
1626 info makes misinterpretation likely.
1627 As a commiter myself, I often get frustrated by these issues, since the
1628 only possible way for me to move forward on them is to ask for
1629 clarification over and over.
1630 .PP
1631 For bug reports, this means that your report should contain the
1632 \f[I]complete\f[] output of youtube\-dl when called with the
1633 \f[C]\-v\f[] flag.
1634 The error message you get for (most) bugs even says so, but you would
1635 not believe how many of our bug reports do not contain this information.
1636 .PP
1637 If your server has multiple IPs or you suspect censorship, adding
1638 \f[C]\-\-call\-home\f[] may be a good idea to get more diagnostics.
1639 If the error is \f[C]ERROR:\ Unable\ to\ extract\ ...\f[] and you cannot
1640 reproduce it from multiple countries, add \f[C]\-\-dump\-pages\f[]
1641 (warning: this will yield a rather large output, redirect it to the file
1642 \f[C]log.txt\f[] by adding \f[C]>log.txt\ 2>&1\f[] to your
1643 command\-line) or upload the \f[C]\&.dump\f[] files you get when you add
1644 \f[C]\-\-write\-pages\f[] somewhere (https://gist.github.com/).
1645 .PP
1646 \f[B]Site support requests must contain an example URL\f[].
1647 An example URL is a URL you might want to download, like
1648 http://www.youtube.com/watch?v=BaW_jenozKc .
1649 There should be an obvious video present.
1650 Except under very special circumstances, the main page of a video
1651 service (e.g.
1652 http://www.youtube.com/ ) is \f[I]not\f[] an example URL.
1653 .SS Are you using the latest version?
1654 .PP
1655 Before reporting any issue, type \f[C]youtube\-dl\ \-U\f[].
1656 This should report that you\[aq]re up\-to\-date.
1657 About 20% of the reports we receive are already fixed, but people are
1658 using outdated versions.
1659 This goes for feature requests as well.
1660 .SS Is the issue already documented?
1661 .PP
1662 Make sure that someone has not already opened the issue you\[aq]re
1663 trying to open.
1664 Search at the top of the window or at
1665 https://github.com/rg3/youtube\-dl/search?type=Issues .
1666 If there is an issue, feel free to write something along the lines of
1667 "This affects me as well, with version 2015.01.01.
1668 Here is some more information on the issue: ...".
1669 While some issues may be old, a new post into them often spurs rapid
1670 activity.
1671 .SS Why are existing options not enough?
1672 .PP
1673 Before requesting a new feature, please have a quick peek at the list of
1674 supported
1675 options (https://github.com/rg3/youtube-dl/blob/master/README.md#synopsis).
1676 Many feature requests are for features that actually exist already!
1677 Please, absolutely do show off your work in the issue report and detail
1678 how the existing similar options do \f[I]not\f[] solve your problem.
1679 .SS Is there enough context in your bug report?
1680 .PP
1681 People want to solve problems, and often think they do us a favor by
1682 breaking down their larger problems (e.g.
1683 wanting to skip already downloaded files) to a specific request (e.g.
1684 requesting us to look whether the file exists before downloading the
1685 info page).
1686 However, what often happens is that they break down the problem into two
1687 steps: One simple, and one impossible (or extremely complicated one).
1688 .PP
1689 We are then presented with a very complicated request when the original
1690 problem could be solved far easier, e.g.
1691 by recording the downloaded video IDs in a separate file.
1692 To avoid this, you must include the greater context where it is
1693 non\-obvious.
1694 In particular, every feature request that does not consist of adding
1695 support for a new site should contain a use case scenario that explains
1696 in what situation the missing feature would be useful.
1697 .SS Does the issue involve one problem, and one problem only?
1698 .PP
1699 Some of our users seem to think there is a limit of issues they can or
1700 should open.
1701 There is no limit of issues they can or should open.
1702 While it may seem appealing to be able to dump all your issues into one
1703 ticket, that means that someone who solves one of your issues cannot
1704 mark the issue as closed.
1705 Typically, reporting a bunch of issues leads to the ticket lingering
1706 since nobody wants to attack that behemoth, until someone mercifully
1707 splits the issue into multiple ones.
1708 .PP
1709 In particular, every site support request issue should only pertain to
1710 services at one site (generally under a common domain, but always using
1711 the same backend technology).
1712 Do not request support for vimeo user videos, Whitehouse podcasts, and
1713 Google Plus pages in the same issue.
1714 Also, make sure that you don\[aq]t post bug reports alongside feature
1715 requests.
1716 As a rule of thumb, a feature request does not include outputs of
1717 youtube\-dl that are not immediately related to the feature at hand.
1718 Do not post reports of a network error alongside the request for a new
1719 video service.
1720 .SS Is anyone going to need the feature?
1721 .PP
1722 Only post features that you (or an incapacitated friend you can
1723 personally talk to) require.
1724 Do not post features because they seem like a good idea.
1725 If they are really useful, they will be requested by someone who
1726 requires them.
1727 .SS Is your question about youtube\-dl?
1728 .PP
1729 It may sound strange, but some bug reports we receive are completely
1730 unrelated to youtube\-dl and relate to a different or even the
1731 reporter\[aq]s own application.
1732 Please make sure that you are actually using youtube\-dl.
1733 If you are using a UI for youtube\-dl, report the bug to the maintainer
1734 of the actual application providing the UI.
1735 On the other hand, if your UI for youtube\-dl fails in some way you
1736 believe is related to youtube\-dl, by all means, go ahead and report the
1737 bug.
1738 .SH COPYRIGHT
1739 .PP
1740 youtube\-dl is released into the public domain by the copyright holders.
1741 .PP
1742 This README file was originally written by Daniel Bolton
1743 (<https://github.com/dbbolton>) and is likewise released into the public
1744 domain.