]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube-dl.1
Update changelog.
[youtubedl] / youtube-dl.1
1 .\" Automatically generated by Pandoc 1.16.0.2
2 .\"
3 .TH "YOUTUBE\-DL" "1" "" "" ""
4 .hy
5 .SH NAME
6 .PP
7 youtube\-dl \- download videos from youtube.com or other video platforms
8 .SH SYNOPSIS
9 .PP
10 \f[B]youtube\-dl\f[] [OPTIONS] URL [URL...]
11 .SH DESCRIPTION
12 .PP
13 \f[B]youtube\-dl\f[] is a small command\-line program to download videos
14 from YouTube.com and a few more sites.
15 It requires the Python interpreter, version 2.6, 2.7, or 3.2+, and it is
16 not platform specific.
17 It should work on your Unix box, on Windows or on Mac OS X.
18 It is released to the public domain, which means you can modify it,
19 redistribute it or use it however you like.
20 .SH OPTIONS
21 .TP
22 .B \-h, \-\-help
23 Print this help text and exit
24 .RS
25 .RE
26 .TP
27 .B \-\-version
28 Print program version and exit
29 .RS
30 .RE
31 .TP
32 .B \-U, \-\-update
33 Update this program to latest version.
34 Make sure that you have sufficient permissions (run with sudo if needed)
35 .RS
36 .RE
37 .TP
38 .B \-i, \-\-ignore\-errors
39 Continue on download errors, for example to skip unavailable videos in a
40 playlist
41 .RS
42 .RE
43 .TP
44 .B \-\-abort\-on\-error
45 Abort downloading of further videos (in the playlist or the command
46 line) if an error occurs
47 .RS
48 .RE
49 .TP
50 .B \-\-dump\-user\-agent
51 Display the current browser identification
52 .RS
53 .RE
54 .TP
55 .B \-\-list\-extractors
56 List all supported extractors
57 .RS
58 .RE
59 .TP
60 .B \-\-extractor\-descriptions
61 Output descriptions of all supported extractors
62 .RS
63 .RE
64 .TP
65 .B \-\-force\-generic\-extractor
66 Force extraction to use the generic extractor
67 .RS
68 .RE
69 .TP
70 .B \-\-default\-search \f[I]PREFIX\f[]
71 Use this prefix for unqualified URLs.
72 For example "gvsearch2:" downloads two videos from google videos for
73 youtube\-dl "large apple".
74 Use the value "auto" to let youtube\-dl guess ("auto_warning" to emit a
75 warning when guessing).
76 "error" just throws an error.
77 The default value "fixup_error" repairs broken URLs, but emits an error
78 if this is not possible instead of searching.
79 .RS
80 .RE
81 .TP
82 .B \-\-ignore\-config
83 Do not read configuration files.
84 When given in the global configuration file /etc /youtube\-dl.conf: Do
85 not read the user configuration in ~/.config/youtube\- dl/config
86 (%APPDATA%/youtube\-dl/config.txt on Windows)
87 .RS
88 .RE
89 .TP
90 .B \-\-flat\-playlist
91 Do not extract the videos of a playlist, only list them.
92 .RS
93 .RE
94 .TP
95 .B \-\-no\-color
96 Do not emit color codes in output
97 .RS
98 .RE
99 .SS Network Options:
100 .TP
101 .B \-\-proxy \f[I]URL\f[]
102 Use the specified HTTP/HTTPS proxy.
103 Pass in an empty string (\-\-proxy "") for direct connection
104 .RS
105 .RE
106 .TP
107 .B \-\-socket\-timeout \f[I]SECONDS\f[]
108 Time to wait before giving up, in seconds
109 .RS
110 .RE
111 .TP
112 .B \-\-source\-address \f[I]IP\f[]
113 Client\-side IP address to bind to (experimental)
114 .RS
115 .RE
116 .TP
117 .B \-4, \-\-force\-ipv4
118 Make all connections via IPv4 (experimental)
119 .RS
120 .RE
121 .TP
122 .B \-6, \-\-force\-ipv6
123 Make all connections via IPv6 (experimental)
124 .RS
125 .RE
126 .TP
127 .B \-\-cn\-verification\-proxy \f[I]URL\f[]
128 Use this proxy to verify the IP address for some Chinese sites.
129 The default proxy specified by \-\-proxy (or none, if the options is not
130 present) is used for the actual downloading.
131 (experimental)
132 .RS
133 .RE
134 .SS Video Selection:
135 .TP
136 .B \-\-playlist\-start \f[I]NUMBER\f[]
137 Playlist video to start at (default is 1)
138 .RS
139 .RE
140 .TP
141 .B \-\-playlist\-end \f[I]NUMBER\f[]
142 Playlist video to end at (default is last)
143 .RS
144 .RE
145 .TP
146 .B \-\-playlist\-items \f[I]ITEM_SPEC\f[]
147 Playlist video items to download.
148 Specify indices of the videos in the playlist separated by commas like:
149 "\-\-playlist\-items 1,2,5,8" if you want to download videos indexed 1,
150 2, 5, 8 in the playlist.
151 You can specify range: "\-\-playlist\-items 1\-3,7,10\-13", it will
152 download the videos at index 1, 2, 3, 7, 10, 11, 12 and 13.
153 .RS
154 .RE
155 .TP
156 .B \-\-match\-title \f[I]REGEX\f[]
157 Download only matching titles (regex or caseless sub\-string)
158 .RS
159 .RE
160 .TP
161 .B \-\-reject\-title \f[I]REGEX\f[]
162 Skip download for matching titles (regex or caseless sub\-string)
163 .RS
164 .RE
165 .TP
166 .B \-\-max\-downloads \f[I]NUMBER\f[]
167 Abort after downloading NUMBER files
168 .RS
169 .RE
170 .TP
171 .B \-\-min\-filesize \f[I]SIZE\f[]
172 Do not download any videos smaller than SIZE (e.g.
173 50k or 44.6m)
174 .RS
175 .RE
176 .TP
177 .B \-\-max\-filesize \f[I]SIZE\f[]
178 Do not download any videos larger than SIZE (e.g.
179 50k or 44.6m)
180 .RS
181 .RE
182 .TP
183 .B \-\-date \f[I]DATE\f[]
184 Download only videos uploaded in this date
185 .RS
186 .RE
187 .TP
188 .B \-\-datebefore \f[I]DATE\f[]
189 Download only videos uploaded on or before this date (i.e.
190 inclusive)
191 .RS
192 .RE
193 .TP
194 .B \-\-dateafter \f[I]DATE\f[]
195 Download only videos uploaded on or after this date (i.e.
196 inclusive)
197 .RS
198 .RE
199 .TP
200 .B \-\-min\-views \f[I]COUNT\f[]
201 Do not download any videos with less than COUNT views
202 .RS
203 .RE
204 .TP
205 .B \-\-max\-views \f[I]COUNT\f[]
206 Do not download any videos with more than COUNT views
207 .RS
208 .RE
209 .TP
210 .B \-\-match\-filter \f[I]FILTER\f[]
211 Generic video filter (experimental).
212 Specify any key (see help for \-o for a list of available keys) to match
213 if the key is present, !key to check if the key is not present,key >
214 NUMBER (like "comment_count > 12", also works with >=, <, <=, !=, =) to
215 compare against a number, and & to require multiple matches.
216 Values which are not known are excluded unless you put a question mark
217 (?) after the operator.For example, to only match videos that have been
218 liked more than 100 times and disliked less than 50 times (or the
219 dislike functionality is not available at the given service), but who
220 also have a description, use \-\-match\-filter "like_count > 100 &
221 dislike_count <?
222 50 & description" .
223 .RS
224 .RE
225 .TP
226 .B \-\-no\-playlist
227 Download only the video, if the URL refers to a video and a playlist.
228 .RS
229 .RE
230 .TP
231 .B \-\-yes\-playlist
232 Download the playlist, if the URL refers to a video and a playlist.
233 .RS
234 .RE
235 .TP
236 .B \-\-age\-limit \f[I]YEARS\f[]
237 Download only videos suitable for the given age
238 .RS
239 .RE
240 .TP
241 .B \-\-download\-archive \f[I]FILE\f[]
242 Download only videos not listed in the archive file.
243 Record the IDs of all downloaded videos in it.
244 .RS
245 .RE
246 .TP
247 .B \-\-include\-ads
248 Download advertisements as well (experimental)
249 .RS
250 .RE
251 .SS Download Options:
252 .TP
253 .B \-r, \-\-rate\-limit \f[I]LIMIT\f[]
254 Maximum download rate in bytes per second (e.g.
255 50K or 4.2M)
256 .RS
257 .RE
258 .TP
259 .B \-R, \-\-retries \f[I]RETRIES\f[]
260 Number of retries (default is 10), or "infinite".
261 .RS
262 .RE
263 .TP
264 .B \-\-buffer\-size \f[I]SIZE\f[]
265 Size of download buffer (e.g.
266 1024 or 16K) (default is 1024)
267 .RS
268 .RE
269 .TP
270 .B \-\-no\-resize\-buffer
271 Do not automatically adjust the buffer size.
272 By default, the buffer size is automatically resized from an initial
273 value of SIZE.
274 .RS
275 .RE
276 .TP
277 .B \-\-playlist\-reverse
278 Download playlist videos in reverse order
279 .RS
280 .RE
281 .TP
282 .B \-\-xattr\-set\-filesize
283 Set file xattribute ytdl.filesize with expected filesize (experimental)
284 .RS
285 .RE
286 .TP
287 .B \-\-hls\-prefer\-native
288 Use the native HLS downloader instead of ffmpeg (experimental)
289 .RS
290 .RE
291 .TP
292 .B \-\-hls\-use\-mpegts
293 Use the mpegts container for HLS videos, allowing to play the video
294 while downloading (some players may not be able to play it)
295 .RS
296 .RE
297 .TP
298 .B \-\-external\-downloader \f[I]COMMAND\f[]
299 Use the specified external downloader.
300 Currently supports aria2c,axel,curl,httpie,wget
301 .RS
302 .RE
303 .TP
304 .B \-\-external\-downloader\-args \f[I]ARGS\f[]
305 Give these arguments to the external downloader
306 .RS
307 .RE
308 .SS Filesystem Options:
309 .TP
310 .B \-a, \-\-batch\-file \f[I]FILE\f[]
311 File containing URLs to download (\[aq]\-\[aq] for stdin)
312 .RS
313 .RE
314 .TP
315 .B \-\-id
316 Use only video ID in file name
317 .RS
318 .RE
319 .TP
320 .B \-o, \-\-output \f[I]TEMPLATE\f[]
321 Output filename template.
322 Use %(title)s to get the title, %(uploader)s for the uploader name,
323 %(uploader_id)s for the uploader nickname if different, %(autonumber)s
324 to get an automatically incremented number, %(ext)s for the filename
325 extension, %(format)s for the format description (like "22 \- 1280x720"
326 or "HD"), %(format_id)s for the unique id of the format (like
327 YouTube\[aq]s itags: "137"), %(upload_date)s for the upload date
328 (YYYYMMDD), %(extractor)s for the provider (youtube, metacafe, etc),
329 %(id)s for the video id, %(playlist_title)s, %(playlist_id)s, or
330 %(playlist)s (=title if present, ID otherwise) for the playlist the
331 video is in, %(playlist_index)s for the position in the playlist.
332 %(height)s and %(width)s for the width and height of the video format.
333 %(resolution)s for a textual description of the resolution of the video
334 format.
335 %% for a literal percent.
336 Use \- to output to stdout.
337 Can also be used to download to a different directory, for example with
338 \-o \[aq]/my/downloads/%(uploader)s /%(title)s\-%(id)s.%(ext)s\[aq] .
339 .RS
340 .RE
341 .TP
342 .B \-\-autonumber\-size \f[I]NUMBER\f[]
343 Specify the number of digits in %(autonumber)s when it is present in
344 output filename template or \-\-auto\-number option is given
345 .RS
346 .RE
347 .TP
348 .B \-\-restrict\-filenames
349 Restrict filenames to only ASCII characters, and avoid "&" and spaces in
350 filenames
351 .RS
352 .RE
353 .TP
354 .B \-A, \-\-auto\-number
355 [deprecated; use \-o "%(autonumber)s\-%(title)s.%(ext)s" ] Number
356 downloaded files starting from 00000
357 .RS
358 .RE
359 .TP
360 .B \-t, \-\-title
361 [deprecated] Use title in file name (default)
362 .RS
363 .RE
364 .TP
365 .B \-l, \-\-literal
366 [deprecated] Alias of \-\-title
367 .RS
368 .RE
369 .TP
370 .B \-w, \-\-no\-overwrites
371 Do not overwrite files
372 .RS
373 .RE
374 .TP
375 .B \-c, \-\-continue
376 Force resume of partially downloaded files.
377 By default, youtube\-dl will resume downloads if possible.
378 .RS
379 .RE
380 .TP
381 .B \-\-no\-continue
382 Do not resume partially downloaded files (restart from beginning)
383 .RS
384 .RE
385 .TP
386 .B \-\-no\-part
387 Do not use .part files \- write directly into output file
388 .RS
389 .RE
390 .TP
391 .B \-\-no\-mtime
392 Do not use the Last\-modified header to set the file modification time
393 .RS
394 .RE
395 .TP
396 .B \-\-write\-description
397 Write video description to a .description file
398 .RS
399 .RE
400 .TP
401 .B \-\-write\-info\-json
402 Write video metadata to a .info.json file
403 .RS
404 .RE
405 .TP
406 .B \-\-write\-annotations
407 Write video annotations to a .annotations.xml file
408 .RS
409 .RE
410 .TP
411 .B \-\-load\-info \f[I]FILE\f[]
412 JSON file containing the video information (created with the
413 "\-\-write\-info\-json" option)
414 .RS
415 .RE
416 .TP
417 .B \-\-cookies \f[I]FILE\f[]
418 File to read cookies from and dump cookie jar in
419 .RS
420 .RE
421 .TP
422 .B \-\-cache\-dir \f[I]DIR\f[]
423 Location in the filesystem where youtube\-dl can store some downloaded
424 information permanently.
425 By default $XDG_CACHE_HOME /youtube\-dl or ~/.cache/youtube\-dl .
426 At the moment, only YouTube player files (for videos with obfuscated
427 signatures) are cached, but that may change.
428 .RS
429 .RE
430 .TP
431 .B \-\-no\-cache\-dir
432 Disable filesystem caching
433 .RS
434 .RE
435 .TP
436 .B \-\-rm\-cache\-dir
437 Delete all filesystem cache files
438 .RS
439 .RE
440 .SS Thumbnail images:
441 .TP
442 .B \-\-write\-thumbnail
443 Write thumbnail image to disk
444 .RS
445 .RE
446 .TP
447 .B \-\-write\-all\-thumbnails
448 Write all thumbnail image formats to disk
449 .RS
450 .RE
451 .TP
452 .B \-\-list\-thumbnails
453 Simulate and list all available thumbnail formats
454 .RS
455 .RE
456 .SS Verbosity / Simulation Options:
457 .TP
458 .B \-q, \-\-quiet
459 Activate quiet mode
460 .RS
461 .RE
462 .TP
463 .B \-\-no\-warnings
464 Ignore warnings
465 .RS
466 .RE
467 .TP
468 .B \-s, \-\-simulate
469 Do not download the video and do not write anything to disk
470 .RS
471 .RE
472 .TP
473 .B \-\-skip\-download
474 Do not download the video
475 .RS
476 .RE
477 .TP
478 .B \-g, \-\-get\-url
479 Simulate, quiet but print URL
480 .RS
481 .RE
482 .TP
483 .B \-e, \-\-get\-title
484 Simulate, quiet but print title
485 .RS
486 .RE
487 .TP
488 .B \-\-get\-id
489 Simulate, quiet but print id
490 .RS
491 .RE
492 .TP
493 .B \-\-get\-thumbnail
494 Simulate, quiet but print thumbnail URL
495 .RS
496 .RE
497 .TP
498 .B \-\-get\-description
499 Simulate, quiet but print video description
500 .RS
501 .RE
502 .TP
503 .B \-\-get\-duration
504 Simulate, quiet but print video length
505 .RS
506 .RE
507 .TP
508 .B \-\-get\-filename
509 Simulate, quiet but print output filename
510 .RS
511 .RE
512 .TP
513 .B \-\-get\-format
514 Simulate, quiet but print output format
515 .RS
516 .RE
517 .TP
518 .B \-j, \-\-dump\-json
519 Simulate, quiet but print JSON information.
520 See \-\-output for a description of available keys.
521 .RS
522 .RE
523 .TP
524 .B \-J, \-\-dump\-single\-json
525 Simulate, quiet but print JSON information for each command\-line
526 argument.
527 If the URL refers to a playlist, dump the whole playlist information in
528 a single line.
529 .RS
530 .RE
531 .TP
532 .B \-\-print\-json
533 Be quiet and print the video information as JSON (video is still being
534 downloaded).
535 .RS
536 .RE
537 .TP
538 .B \-\-newline
539 Output progress bar as new lines
540 .RS
541 .RE
542 .TP
543 .B \-\-no\-progress
544 Do not print progress bar
545 .RS
546 .RE
547 .TP
548 .B \-\-console\-title
549 Display progress in console titlebar
550 .RS
551 .RE
552 .TP
553 .B \-v, \-\-verbose
554 Print various debugging information
555 .RS
556 .RE
557 .TP
558 .B \-\-dump\-pages
559 Print downloaded pages encoded using base64 to debug problems (very
560 verbose)
561 .RS
562 .RE
563 .TP
564 .B \-\-write\-pages
565 Write downloaded intermediary pages to files in the current directory to
566 debug problems
567 .RS
568 .RE
569 .TP
570 .B \-\-print\-traffic
571 Display sent and read HTTP traffic
572 .RS
573 .RE
574 .TP
575 .B \-C, \-\-call\-home
576 Contact the youtube\-dl server for debugging
577 .RS
578 .RE
579 .TP
580 .B \-\-no\-call\-home
581 Do NOT contact the youtube\-dl server for debugging
582 .RS
583 .RE
584 .SS Workarounds:
585 .TP
586 .B \-\-encoding \f[I]ENCODING\f[]
587 Force the specified encoding (experimental)
588 .RS
589 .RE
590 .TP
591 .B \-\-no\-check\-certificate
592 Suppress HTTPS certificate validation
593 .RS
594 .RE
595 .TP
596 .B \-\-prefer\-insecure
597 Use an unencrypted connection to retrieve information about the video.
598 (Currently supported only for YouTube)
599 .RS
600 .RE
601 .TP
602 .B \-\-user\-agent \f[I]UA\f[]
603 Specify a custom user agent
604 .RS
605 .RE
606 .TP
607 .B \-\-referer \f[I]URL\f[]
608 Specify a custom referer, use if the video access is restricted to one
609 domain
610 .RS
611 .RE
612 .TP
613 .B \-\-add\-header \f[I]FIELD:VALUE\f[]
614 Specify a custom HTTP header and its value, separated by a colon
615 \[aq]:\[aq].
616 You can use this option multiple times
617 .RS
618 .RE
619 .TP
620 .B \-\-bidi\-workaround
621 Work around terminals that lack bidirectional text support.
622 Requires bidiv or fribidi executable in PATH
623 .RS
624 .RE
625 .TP
626 .B \-\-sleep\-interval \f[I]SECONDS\f[]
627 Number of seconds to sleep before each download.
628 .RS
629 .RE
630 .SS Video Format Options:
631 .TP
632 .B \-f, \-\-format \f[I]FORMAT\f[]
633 Video format code, see the "FORMAT SELECTION" for all the info
634 .RS
635 .RE
636 .TP
637 .B \-\-all\-formats
638 Download all available video formats
639 .RS
640 .RE
641 .TP
642 .B \-\-prefer\-free\-formats
643 Prefer free video formats unless a specific one is requested
644 .RS
645 .RE
646 .TP
647 .B \-F, \-\-list\-formats
648 List all available formats of requested videos
649 .RS
650 .RE
651 .TP
652 .B \-\-youtube\-skip\-dash\-manifest
653 Do not download the DASH manifests and related data on YouTube videos
654 .RS
655 .RE
656 .TP
657 .B \-\-merge\-output\-format \f[I]FORMAT\f[]
658 If a merge is required (e.g.
659 bestvideo+bestaudio), output to given container format.
660 One of mkv, mp4, ogg, webm, flv.
661 Ignored if no merge is required
662 .RS
663 .RE
664 .SS Subtitle Options:
665 .TP
666 .B \-\-write\-sub
667 Write subtitle file
668 .RS
669 .RE
670 .TP
671 .B \-\-write\-auto\-sub
672 Write automatically generated subtitle file (YouTube only)
673 .RS
674 .RE
675 .TP
676 .B \-\-all\-subs
677 Download all the available subtitles of the video
678 .RS
679 .RE
680 .TP
681 .B \-\-list\-subs
682 List all available subtitles for the video
683 .RS
684 .RE
685 .TP
686 .B \-\-sub\-format \f[I]FORMAT\f[]
687 Subtitle format, accepts formats preference, for example: "srt" or
688 "ass/srt/best"
689 .RS
690 .RE
691 .TP
692 .B \-\-sub\-lang \f[I]LANGS\f[]
693 Languages of the subtitles to download (optional) separated by commas,
694 use \-\-list\- subs for available language tags
695 .RS
696 .RE
697 .SS Authentication Options:
698 .TP
699 .B \-u, \-\-username \f[I]USERNAME\f[]
700 Login with this account ID
701 .RS
702 .RE
703 .TP
704 .B \-p, \-\-password \f[I]PASSWORD\f[]
705 Account password.
706 If this option is left out, youtube\-dl will ask interactively.
707 .RS
708 .RE
709 .TP
710 .B \-2, \-\-twofactor \f[I]TWOFACTOR\f[]
711 Two\-factor auth code
712 .RS
713 .RE
714 .TP
715 .B \-n, \-\-netrc
716 Use .netrc authentication data
717 .RS
718 .RE
719 .TP
720 .B \-\-video\-password \f[I]PASSWORD\f[]
721 Video password (vimeo, smotri, youku)
722 .RS
723 .RE
724 .SS Post\-processing Options:
725 .TP
726 .B \-x, \-\-extract\-audio
727 Convert video files to audio\-only files (requires ffmpeg or avconv and
728 ffprobe or avprobe)
729 .RS
730 .RE
731 .TP
732 .B \-\-audio\-format \f[I]FORMAT\f[]
733 Specify audio format: "best", "aac", "vorbis", "mp3", "m4a", "opus", or
734 "wav"; "best" by default
735 .RS
736 .RE
737 .TP
738 .B \-\-audio\-quality \f[I]QUALITY\f[]
739 Specify ffmpeg/avconv audio quality, insert a value between 0 (better)
740 and 9 (worse) for VBR or a specific bitrate like 128K (default 5)
741 .RS
742 .RE
743 .TP
744 .B \-\-recode\-video \f[I]FORMAT\f[]
745 Encode the video to another format if necessary (currently supported:
746 mp4|flv|ogg|webm|mkv|avi)
747 .RS
748 .RE
749 .TP
750 .B \-\-postprocessor\-args \f[I]ARGS\f[]
751 Give these arguments to the postprocessor
752 .RS
753 .RE
754 .TP
755 .B \-k, \-\-keep\-video
756 Keep the video file on disk after the post\- processing; the video is
757 erased by default
758 .RS
759 .RE
760 .TP
761 .B \-\-no\-post\-overwrites
762 Do not overwrite post\-processed files; the post\-processed files are
763 overwritten by default
764 .RS
765 .RE
766 .TP
767 .B \-\-embed\-subs
768 Embed subtitles in the video (only for mkv and mp4 videos)
769 .RS
770 .RE
771 .TP
772 .B \-\-embed\-thumbnail
773 Embed thumbnail in the audio as cover art
774 .RS
775 .RE
776 .TP
777 .B \-\-add\-metadata
778 Write metadata to the video file
779 .RS
780 .RE
781 .TP
782 .B \-\-metadata\-from\-title \f[I]FORMAT\f[]
783 Parse additional metadata like song title / artist from the video title.
784 The format syntax is the same as \-\-output, the parsed parameters
785 replace existing values.
786 Additional templates: %(album)s, %(artist)s.
787 Example: \-\-metadata\-from\-title "%(artist)s \- %(title)s" matches a
788 title like "Coldplay \- Paradise"
789 .RS
790 .RE
791 .TP
792 .B \-\-xattrs
793 Write metadata to the video file\[aq]s xattrs (using dublin core and xdg
794 standards)
795 .RS
796 .RE
797 .TP
798 .B \-\-fixup \f[I]POLICY\f[]
799 Automatically correct known faults of the file.
800 One of never (do nothing), warn (only emit a warning), detect_or_warn
801 (the default; fix file if we can, warn otherwise)
802 .RS
803 .RE
804 .TP
805 .B \-\-prefer\-avconv
806 Prefer avconv over ffmpeg for running the postprocessors (default)
807 .RS
808 .RE
809 .TP
810 .B \-\-prefer\-ffmpeg
811 Prefer ffmpeg over avconv for running the postprocessors
812 .RS
813 .RE
814 .TP
815 .B \-\-ffmpeg\-location \f[I]PATH\f[]
816 Location of the ffmpeg/avconv binary; either the path to the binary or
817 its containing directory.
818 .RS
819 .RE
820 .TP
821 .B \-\-exec \f[I]CMD\f[]
822 Execute a command on the file after downloading, similar to find\[aq]s
823 \-exec syntax.
824 Example: \-\-exec \[aq]adb push {} /sdcard/Music/ && rm {}\[aq]
825 .RS
826 .RE
827 .TP
828 .B \-\-convert\-subs \f[I]FORMAT\f[]
829 Convert the subtitles to other format (currently supported: srt|ass|vtt)
830 .RS
831 .RE
832 .SH CONFIGURATION
833 .PP
834 You can configure youtube\-dl by placing any supported command line
835 option to a configuration file.
836 On Linux, the system wide configuration file is located at
837 \f[C]/etc/youtube\-dl.conf\f[] and the user wide configuration file at
838 \f[C]~/.config/youtube\-dl/config\f[].
839 On Windows, the user wide configuration file locations are
840 \f[C]%APPDATA%\\youtube\-dl\\config.txt\f[] or
841 \f[C]C:\\Users\\<user\ name>\\youtube\-dl.conf\f[].
842 For example, with the following configuration file youtube\-dl will
843 always extract the audio, not copy the mtime and use a proxy:
844 .IP
845 .nf
846 \f[C]
847 \-\-extract\-audio
848 \-\-no\-mtime
849 \-\-proxy\ 127.0.0.1:3128
850 \f[]
851 .fi
852 .PP
853 You can use \f[C]\-\-ignore\-config\f[] if you want to disable the
854 configuration file for a particular youtube\-dl run.
855 .SS Authentication with \f[C]\&.netrc\f[] file
856 .PP
857 You may also want to configure automatic credentials storage for
858 extractors that support authentication (by providing login and password
859 with \f[C]\-\-username\f[] and \f[C]\-\-password\f[]) in order not to
860 pass credentials as command line arguments on every youtube\-dl
861 execution and prevent tracking plain text passwords in the shell command
862 history.
863 You can achieve this using a \f[C]\&.netrc\f[]
864 file (http://stackoverflow.com/tags/.netrc/info) on per extractor basis.
865 For that you will need to create a\f[C]\&.netrc\f[] file in your
866 \f[C]$HOME\f[] and restrict permissions to read/write by you only:
867 .IP
868 .nf
869 \f[C]
870 touch\ $HOME/.netrc
871 chmod\ a\-rwx,u+rw\ $HOME/.netrc
872 \f[]
873 .fi
874 .PP
875 After that you can add credentials for extractor in the following
876 format, where \f[I]extractor\f[] is the name of extractor in lowercase:
877 .IP
878 .nf
879 \f[C]
880 machine\ <extractor>\ login\ <login>\ password\ <password>
881 \f[]
882 .fi
883 .PP
884 For example:
885 .IP
886 .nf
887 \f[C]
888 machine\ youtube\ login\ myaccount\@gmail.com\ password\ my_youtube_password
889 machine\ twitch\ login\ my_twitch_account_name\ password\ my_twitch_password
890 \f[]
891 .fi
892 .PP
893 To activate authentication with the \f[C]\&.netrc\f[] file you should
894 pass \f[C]\-\-netrc\f[] to youtube\-dl or place it in the configuration
895 file (#configuration).
896 .PP
897 On Windows you may also need to setup the \f[C]%HOME%\f[] environment
898 variable manually.
899 .SH OUTPUT TEMPLATE
900 .PP
901 The \f[C]\-o\f[] option allows users to indicate a template for the
902 output file names.
903 The basic usage is not to set any template arguments when downloading a
904 single file, like in
905 \f[C]youtube\-dl\ \-o\ funny_video.flv\ "http://some/video"\f[].
906 However, it may contain special sequences that will be replaced when
907 downloading each video.
908 The special sequences have the format \f[C]%(NAME)s\f[].
909 To clarify, that is a percent symbol followed by a name in parentheses,
910 followed by a lowercase S.
911 Allowed names are:
912 .IP \[bu] 2
913 \f[C]id\f[]: Video identifier
914 .IP \[bu] 2
915 \f[C]title\f[]: Video title
916 .IP \[bu] 2
917 \f[C]url\f[]: Video URL
918 .IP \[bu] 2
919 \f[C]ext\f[]: Video filename extension
920 .IP \[bu] 2
921 \f[C]alt_title\f[]: A secondary title of the video
922 .IP \[bu] 2
923 \f[C]display_id\f[]: An alternative identifier for the video
924 .IP \[bu] 2
925 \f[C]uploader\f[]: Full name of the video uploader
926 .IP \[bu] 2
927 \f[C]creator\f[]: The main artist who created the video
928 .IP \[bu] 2
929 \f[C]release_date\f[]: The date (YYYYMMDD) when the video was released
930 .IP \[bu] 2
931 \f[C]timestamp\f[]: UNIX timestamp of the moment the video became
932 available
933 .IP \[bu] 2
934 \f[C]upload_date\f[]: Video upload date (YYYYMMDD)
935 .IP \[bu] 2
936 \f[C]uploader_id\f[]: Nickname or id of the video uploader
937 .IP \[bu] 2
938 \f[C]location\f[]: Physical location where the video was filmed
939 .IP \[bu] 2
940 \f[C]duration\f[]: Length of the video in seconds
941 .IP \[bu] 2
942 \f[C]view_count\f[]: How many users have watched the video on the
943 platform
944 .IP \[bu] 2
945 \f[C]like_count\f[]: Number of positive ratings of the video
946 .IP \[bu] 2
947 \f[C]dislike_count\f[]: Number of negative ratings of the video
948 .IP \[bu] 2
949 \f[C]repost_count\f[]: Number of reposts of the video
950 .IP \[bu] 2
951 \f[C]average_rating\f[]: Average rating give by users, the scale used
952 depends on the webpage
953 .IP \[bu] 2
954 \f[C]comment_count\f[]: Number of comments on the video
955 .IP \[bu] 2
956 \f[C]age_limit\f[]: Age restriction for the video (years)
957 .IP \[bu] 2
958 \f[C]format\f[]: A human\-readable description of the format
959 .IP \[bu] 2
960 \f[C]format_id\f[]: Format code specified by \f[C]\-\-format\f[]
961 .IP \[bu] 2
962 \f[C]format_note\f[]: Additional info about the format
963 .IP \[bu] 2
964 \f[C]width\f[]: Width of the video
965 .IP \[bu] 2
966 \f[C]height\f[]: Height of the video
967 .IP \[bu] 2
968 \f[C]resolution\f[]: Textual description of width and height
969 .IP \[bu] 2
970 \f[C]tbr\f[]: Average bitrate of audio and video in KBit/s
971 .IP \[bu] 2
972 \f[C]abr\f[]: Average audio bitrate in KBit/s
973 .IP \[bu] 2
974 \f[C]acodec\f[]: Name of the audio codec in use
975 .IP \[bu] 2
976 \f[C]asr\f[]: Audio sampling rate in Hertz
977 .IP \[bu] 2
978 \f[C]vbr\f[]: Average video bitrate in KBit/s
979 .IP \[bu] 2
980 \f[C]fps\f[]: Frame rate
981 .IP \[bu] 2
982 \f[C]vcodec\f[]: Name of the video codec in use
983 .IP \[bu] 2
984 \f[C]container\f[]: Name of the container format
985 .IP \[bu] 2
986 \f[C]filesize\f[]: The number of bytes, if known in advance
987 .IP \[bu] 2
988 \f[C]filesize_approx\f[]: An estimate for the number of bytes
989 .IP \[bu] 2
990 \f[C]protocol\f[]: The protocol that will be used for the actual
991 download
992 .IP \[bu] 2
993 \f[C]extractor\f[]: Name of the extractor
994 .IP \[bu] 2
995 \f[C]extractor_key\f[]: Key name of the extractor
996 .IP \[bu] 2
997 \f[C]epoch\f[]: Unix epoch when creating the file
998 .IP \[bu] 2
999 \f[C]autonumber\f[]: Five\-digit number that will be increased with each
1000 download, starting at zero
1001 .IP \[bu] 2
1002 \f[C]playlist\f[]: Name or id of the playlist that contains the video
1003 .IP \[bu] 2
1004 \f[C]playlist_index\f[]: Index of the video in the playlist padded with
1005 leading zeros according to the total length of the playlist
1006 .PP
1007 Available for the video that belongs to some logical chapter or section:
1008 \- \f[C]chapter\f[]: Name or title of the chapter the video belongs to
1009 \- \f[C]chapter_number\f[]: Number of the chapter the video belongs to
1010 \- \f[C]chapter_id\f[]: Id of the chapter the video belongs to
1011 .PP
1012 Available for the video that is an episode of some series or programme:
1013 \- \f[C]series\f[]: Title of the series or programme the video episode
1014 belongs to \- \f[C]season\f[]: Title of the season the video episode
1015 belongs to \- \f[C]season_number\f[]: Number of the season the video
1016 episode belongs to \- \f[C]season_id\f[]: Id of the season the video
1017 episode belongs to \- \f[C]episode\f[]: Title of the video episode \-
1018 \f[C]episode_number\f[]: Number of the video episode within a season \-
1019 \f[C]episode_id\f[]: Id of the video episode
1020 .PP
1021 Each aforementioned sequence when referenced in output template will be
1022 replaced by the actual value corresponding to the sequence name.
1023 Note that some of the sequences are not guaranteed to be present since
1024 they depend on the metadata obtained by particular extractor, such
1025 sequences will be replaced with \f[C]NA\f[].
1026 .PP
1027 For example for \f[C]\-o\ %(title)s\-%(id)s.%(ext)s\f[] and mp4 video
1028 with title \f[C]youtube\-dl\ test\ video\f[] and id
1029 \f[C]BaW_jenozKcj\f[] this will result in a
1030 \f[C]youtube\-dl\ test\ video\-BaW_jenozKcj.mp4\f[] file created in the
1031 current directory.
1032 .PP
1033 Output template can also contain arbitrary hierarchical path, e.g.
1034 \f[C]\-o\ \[aq]%(playlist)s/%(playlist_index)s\ \-\ %(title)s.%(ext)s\[aq]\f[]
1035 that will result in downloading each video in a directory corresponding
1036 to this path template.
1037 Any missing directory will be automatically created for you.
1038 .PP
1039 To specify percent literal in output template use \f[C]%%\f[].
1040 To output to stdout use \f[C]\-o\ \-\f[].
1041 .PP
1042 The current default template is \f[C]%(title)s\-%(id)s.%(ext)s\f[].
1043 .PP
1044 In some cases, you don\[aq]t want special characters such as äø­, spaces,
1045 or &, such as when transferring the downloaded filename to a Windows
1046 system or the filename through an 8bit\-unsafe channel.
1047 In these cases, add the \f[C]\-\-restrict\-filenames\f[] flag to get a
1048 shorter title:
1049 .PP
1050 Examples (note on Windows you may need to use double quotes instead of
1051 single):
1052 .IP
1053 .nf
1054 \f[C]
1055 $\ youtube\-dl\ \-\-get\-filename\ \-o\ \[aq]%(title)s.%(ext)s\[aq]\ BaW_jenozKc
1056 youtube\-dl\ test\ video\ \[aq]\[aq]_Ƥā†­š•.mp4\ \ \ \ #\ All\ kinds\ of\ weird\ characters
1057
1058 $\ youtube\-dl\ \-\-get\-filename\ \-o\ \[aq]%(title)s.%(ext)s\[aq]\ BaW_jenozKc\ \-\-restrict\-filenames
1059 youtube\-dl_test_video_.mp4\ \ \ \ \ \ \ \ \ \ #\ A\ simple\ file\ name
1060
1061 #\ Download\ YouTube\ playlist\ videos\ in\ separate\ directory\ indexed\ by\ video\ order\ in\ a\ playlist
1062 $\ youtube\-dl\ \-o\ \[aq]%(playlist)s/%(playlist_index)s\ \-\ %(title)s.%(ext)s\[aq]\ https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re
1063
1064 #\ Download\ Udemy\ course\ keeping\ each\ chapter\ in\ separate\ directory\ under\ MyVideos\ directory\ in\ your\ home
1065 $\ youtube\-dl\ \-u\ user\ \-p\ password\ \-o\ \[aq]~/MyVideos/%(playlist)s/%(chapter_number)s\ \-\ %(chapter)s/%(title)s.%(ext)s\[aq]\ https://www.udemy.com/java\-tutorial/
1066
1067 #\ Download\ entire\ series\ season\ keeping\ each\ series\ and\ each\ season\ in\ separate\ directory\ under\ C:/MyVideos
1068 $\ youtube\-dl\ \-o\ "C:/MyVideos/%(series)s/%(season_number)s\ \-\ %(season)s/%(episode_number)s\ \-\ %(episode)s.%(ext)s"\ http://videomore.ru/kino_v_detalayah/5_sezon/367617
1069
1070 #\ Stream\ the\ video\ being\ downloaded\ to\ stdout
1071 $\ youtube\-dl\ \-o\ \-\ BaW_jenozKc
1072 \f[]
1073 .fi
1074 .SH FORMAT SELECTION
1075 .PP
1076 By default youtube\-dl tries to download the best available quality,
1077 i.e.
1078 if you want the best quality you \f[B]don\[aq]t need\f[] to pass any
1079 special options, youtube\-dl will guess it for you by \f[B]default\f[].
1080 .PP
1081 But sometimes you may want to download in a different format, for
1082 example when you are on a slow or intermittent connection.
1083 The key mechanism for achieving this is so called \f[I]format
1084 selection\f[] based on which you can explicitly specify desired format,
1085 select formats based on some criterion or criteria, setup precedence and
1086 much more.
1087 .PP
1088 The general syntax for format selection is \f[C]\-\-format\ FORMAT\f[]
1089 or shorter \f[C]\-f\ FORMAT\f[] where \f[C]FORMAT\f[] is a \f[I]selector
1090 expression\f[], i.e.
1091 an expression that describes format or formats you would like to
1092 download.
1093 .PP
1094 The simplest case is requesting a specific format, for example with
1095 \f[C]\-f\ 22\f[] you can download the format with format code equal to
1096 22.
1097 You can get the list of available format codes for particular video
1098 using \f[C]\-\-list\-formats\f[] or \f[C]\-F\f[].
1099 Note that these format codes are extractor specific.
1100 .PP
1101 You can also use a file extension (currently \f[C]3gp\f[], \f[C]aac\f[],
1102 \f[C]flv\f[], \f[C]m4a\f[], \f[C]mp3\f[], \f[C]mp4\f[], \f[C]ogg\f[],
1103 \f[C]wav\f[], \f[C]webm\f[] are supported) to download best quality
1104 format of particular file extension served as a single file, e.g.
1105 \f[C]\-f\ webm\f[] will download best quality format with \f[C]webm\f[]
1106 extension served as a single file.
1107 .PP
1108 You can also use special names to select particular edge case format: \-
1109 \f[C]best\f[]: Select best quality format represented by single file
1110 with video and audio \- \f[C]worst\f[]: Select worst quality format
1111 represented by single file with video and audio \- \f[C]bestvideo\f[]:
1112 Select best quality video only format (e.g.
1113 DASH video), may not be available \- \f[C]worstvideo\f[]: Select worst
1114 quality video only format, may not be available \- \f[C]bestaudio\f[]:
1115 Select best quality audio only format, may not be available \-
1116 \f[C]worstaudio\f[]: Select worst quality audio only format, may not be
1117 available
1118 .PP
1119 For example, to download worst quality video only format you can use
1120 \f[C]\-f\ worstvideo\f[].
1121 .PP
1122 If you want to download multiple videos and they don\[aq]t have the same
1123 formats available, you can specify the order of preference using
1124 slashes.
1125 Note that slash is left\-associative, i.e.
1126 formats on the left hand side are preferred, for example
1127 \f[C]\-f\ 22/17/18\f[] will download format 22 if it\[aq]s available,
1128 otherwise it will download format 17 if it\[aq]s available, otherwise it
1129 will download format 18 if it\[aq]s available, otherwise it will
1130 complain that no suitable formats are available for download.
1131 .PP
1132 If you want to download several formats of the same video use comma as a
1133 separator, e.g.
1134 \f[C]\-f\ 22,17,18\f[] will download all these three formats, of course
1135 if they are available.
1136 Or more sophisticated example combined with precedence feature
1137 \f[C]\-f\ 136/137/mp4/bestvideo,140/m4a/bestaudio\f[].
1138 .PP
1139 You can also filter the video formats by putting a condition in
1140 brackets, as in \f[C]\-f\ "best[height=720]"\f[] (or
1141 \f[C]\-f\ "[filesize>10M]"\f[]).
1142 .PP
1143 The following numeric meta fields can be used with comparisons
1144 \f[C]<\f[], \f[C]<=\f[], \f[C]>\f[], \f[C]>=\f[], \f[C]=\f[] (equals),
1145 \f[C]!=\f[] (not equals): \- \f[C]filesize\f[]: The number of bytes, if
1146 known in advance \- \f[C]width\f[]: Width of the video, if known \-
1147 \f[C]height\f[]: Height of the video, if known \- \f[C]tbr\f[]: Average
1148 bitrate of audio and video in KBit/s \- \f[C]abr\f[]: Average audio
1149 bitrate in KBit/s \- \f[C]vbr\f[]: Average video bitrate in KBit/s \-
1150 \f[C]asr\f[]: Audio sampling rate in Hertz \- \f[C]fps\f[]: Frame rate
1151 .PP
1152 Also filtering work for comparisons \f[C]=\f[] (equals), \f[C]!=\f[]
1153 (not equals), \f[C]^=\f[] (begins with), \f[C]$=\f[] (ends with),
1154 \f[C]*=\f[] (contains) and following string meta fields: \-
1155 \f[C]ext\f[]: File extension \- \f[C]acodec\f[]: Name of the audio codec
1156 in use \- \f[C]vcodec\f[]: Name of the video codec in use \-
1157 \f[C]container\f[]: Name of the container format \- \f[C]protocol\f[]:
1158 The protocol that will be used for the actual download, lower\-case.
1159 \f[C]http\f[], \f[C]https\f[], \f[C]rtsp\f[], \f[C]rtmp\f[],
1160 \f[C]rtmpe\f[], \f[C]m3u8\f[], or \f[C]m3u8_native\f[]
1161 .PP
1162 Note that none of the aforementioned meta fields are guaranteed to be
1163 present since this solely depends on the metadata obtained by particular
1164 extractor, i.e.
1165 the metadata offered by video hoster.
1166 .PP
1167 Formats for which the value is not known are excluded unless you put a
1168 question mark (\f[C]?\f[]) after the operator.
1169 You can combine format filters, so
1170 \f[C]\-f\ "[height\ <=?\ 720][tbr>500]"\f[] selects up to 720p videos
1171 (or videos where the height is not known) with a bitrate of at least 500
1172 KBit/s.
1173 .PP
1174 You can merge the video and audio of two formats into a single file
1175 using \f[C]\-f\ <video\-format>+<audio\-format>\f[] (requires ffmpeg or
1176 avconv installed), for example \f[C]\-f\ bestvideo+bestaudio\f[] will
1177 download best video only format, best audio only format and mux them
1178 together with ffmpeg/avconv.
1179 .PP
1180 Format selectors can also be grouped using parentheses, for example if
1181 you want to download the best mp4 and webm formats with a height lower
1182 than 480 you can use \f[C]\-f\ \[aq](mp4,webm)[height<480]\[aq]\f[].
1183 .PP
1184 Since the end of April 2015 and version 2015.04.26 youtube\-dl uses
1185 \f[C]\-f\ bestvideo+bestaudio/best\f[] as default format selection (see
1186 #5447, #5456).
1187 If ffmpeg or avconv are installed this results in downloading
1188 \f[C]bestvideo\f[] and \f[C]bestaudio\f[] separately and muxing them
1189 together into a single file giving the best overall quality available.
1190 Otherwise it falls back to \f[C]best\f[] and results in downloading the
1191 best available quality served as a single file.
1192 \f[C]best\f[] is also needed for videos that don\[aq]t come from YouTube
1193 because they don\[aq]t provide the audio and video in two different
1194 files.
1195 If you want to only download some DASH formats (for example if you are
1196 not interested in getting videos with a resolution higher than 1080p),
1197 you can add \f[C]\-f\ bestvideo[height<=?1080]+bestaudio/best\f[] to
1198 your configuration file.
1199 Note that if you use youtube\-dl to stream to \f[C]stdout\f[] (and most
1200 likely to pipe it to your media player then), i.e.
1201 you explicitly specify output template as \f[C]\-o\ \-\f[], youtube\-dl
1202 still uses \f[C]\-f\ best\f[] format selection in order to start content
1203 delivery immediately to your player and not to wait until
1204 \f[C]bestvideo\f[] and \f[C]bestaudio\f[] are downloaded and muxed.
1205 .PP
1206 If you want to preserve the old format selection behavior (prior to
1207 youtube\-dl 2015.04.26), i.e.
1208 you want to download the best available quality media served as a single
1209 file, you should explicitly specify your choice with \f[C]\-f\ best\f[].
1210 You may want to add it to the configuration file (#configuration) in
1211 order not to type it every time you run youtube\-dl.
1212 .PP
1213 Examples (note on Windows you may need to use double quotes instead of
1214 single):
1215 .IP
1216 .nf
1217 \f[C]
1218 #\ Download\ best\ mp4\ format\ available\ or\ any\ other\ best\ if\ no\ mp4\ available
1219 $\ youtube\-dl\ \-f\ \[aq]bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best\[aq]
1220
1221 #\ Download\ best\ format\ available\ but\ not\ better\ that\ 480p
1222 $\ youtube\-dl\ \-f\ \[aq]bestvideo[height<=480]+bestaudio/best[height<=480]\[aq]
1223
1224 #\ Download\ best\ video\ only\ format\ but\ no\ bigger\ that\ 50\ MB
1225 $\ youtube\-dl\ \-f\ \[aq]best[filesize<50M]\[aq]
1226
1227 #\ Download\ best\ format\ available\ via\ direct\ link\ over\ HTTP/HTTPS\ protocol
1228 $\ youtube\-dl\ \-f\ \[aq](bestvideo+bestaudio/best)[protocol^=http]\[aq]
1229 \f[]
1230 .fi
1231 .SH VIDEO SELECTION
1232 .PP
1233 Videos can be filtered by their upload date using the options
1234 \f[C]\-\-date\f[], \f[C]\-\-datebefore\f[] or \f[C]\-\-dateafter\f[].
1235 They accept dates in two formats:
1236 .IP \[bu] 2
1237 Absolute dates: Dates in the format \f[C]YYYYMMDD\f[].
1238 .IP \[bu] 2
1239 Relative dates: Dates in the format
1240 \f[C](now|today)[+\-][0\-9](day|week|month|year)(s)?\f[]
1241 .PP
1242 Examples:
1243 .IP
1244 .nf
1245 \f[C]
1246 #\ Download\ only\ the\ videos\ uploaded\ in\ the\ last\ 6\ months
1247 $\ youtube\-dl\ \-\-dateafter\ now\-6months
1248
1249 #\ Download\ only\ the\ videos\ uploaded\ on\ January\ 1,\ 1970
1250 $\ youtube\-dl\ \-\-date\ 19700101
1251
1252 $\ #\ Download\ only\ the\ videos\ uploaded\ in\ the\ 200x\ decade
1253 $\ youtube\-dl\ \-\-dateafter\ 20000101\ \-\-datebefore\ 20091231
1254 \f[]
1255 .fi
1256 .SH FAQ
1257 .SS How do I update youtube\-dl?
1258 .PP
1259 If you\[aq]ve followed our manual installation
1260 instructions (http://rg3.github.io/youtube-dl/download.html), you can
1261 simply run \f[C]youtube\-dl\ \-U\f[] (or, on Linux,
1262 \f[C]sudo\ youtube\-dl\ \-U\f[]).
1263 .PP
1264 If you have used pip, a simple
1265 \f[C]sudo\ pip\ install\ \-U\ youtube\-dl\f[] is sufficient to update.
1266 .PP
1267 If you have installed youtube\-dl using a package manager like
1268 \f[I]apt\-get\f[] or \f[I]yum\f[], use the standard system update
1269 mechanism to update.
1270 Note that distribution packages are often outdated.
1271 As a rule of thumb, youtube\-dl releases at least once a month, and
1272 often weekly or even daily.
1273 Simply go to http://yt\-dl.org/ to find out the current version.
1274 Unfortunately, there is nothing we youtube\-dl developers can do if your
1275 distribution serves a really outdated version.
1276 You can (and should) complain to your distribution in their bugtracker
1277 or support forum.
1278 .PP
1279 As a last resort, you can also uninstall the version installed by your
1280 package manager and follow our manual installation instructions.
1281 For that, remove the distribution\[aq]s package, with a line like
1282 .IP
1283 .nf
1284 \f[C]
1285 sudo\ apt\-get\ remove\ \-y\ youtube\-dl
1286 \f[]
1287 .fi
1288 .PP
1289 Afterwards, simply follow our manual installation
1290 instructions (http://rg3.github.io/youtube-dl/download.html):
1291 .IP
1292 .nf
1293 \f[C]
1294 sudo\ wget\ https://yt\-dl.org/latest/youtube\-dl\ \-O\ /usr/local/bin/youtube\-dl
1295 sudo\ chmod\ a+x\ /usr/local/bin/youtube\-dl
1296 hash\ \-r
1297 \f[]
1298 .fi
1299 .PP
1300 Again, from then on you\[aq]ll be able to update with
1301 \f[C]sudo\ youtube\-dl\ \-U\f[].
1302 .SS I\[aq]m getting an error
1303 \f[C]Unable\ to\ extract\ OpenGraph\ title\f[] on YouTube playlists
1304 .PP
1305 YouTube changed their playlist format in March 2014 and later on, so
1306 you\[aq]ll need at least youtube\-dl 2014.07.25 to download all YouTube
1307 videos.
1308 .PP
1309 If you have installed youtube\-dl with a package manager, pip, setup.py
1310 or a tarball, please use that to update.
1311 Note that Ubuntu packages do not seem to get updated anymore.
1312 Since we are not affiliated with Ubuntu, there is little we can do.
1313 Feel free to report
1314 bugs (https://bugs.launchpad.net/ubuntu/+source/youtube-dl/+filebug) to
1315 the Ubuntu packaging
1316 guys (mailto:ubuntu-motu@lists.ubuntu.com?subject=outdated%20version%20of%20youtube-dl)
1317 \- all they have to do is update the package to a somewhat recent
1318 version.
1319 See above for a way to update.
1320 .SS Do I always have to pass \f[C]\-citw\f[]?
1321 .PP
1322 By default, youtube\-dl intends to have the best options (incidentally,
1323 if you have a convincing case that these should be different, please
1324 file an issue where you explain that (https://yt-dl.org/bug)).
1325 Therefore, it is unnecessary and sometimes harmful to copy long option
1326 strings from webpages.
1327 In particular, the only option out of \f[C]\-citw\f[] that is regularly
1328 useful is \f[C]\-i\f[].
1329 .SS Can you please put the \f[C]\-b\f[] option back?
1330 .PP
1331 Most people asking this question are not aware that youtube\-dl now
1332 defaults to downloading the highest available quality as reported by
1333 YouTube, which will be 1080p or 720p in some cases, so you no longer
1334 need the \f[C]\-b\f[] option.
1335 For some specific videos, maybe YouTube does not report them to be
1336 available in a specific high quality format you\[aq]re interested in.
1337 In that case, simply request it with the \f[C]\-f\f[] option and
1338 youtube\-dl will try to download it.
1339 .SS I get HTTP error 402 when trying to download a video. What\[aq]s
1340 this?
1341 .PP
1342 Apparently YouTube requires you to pass a CAPTCHA test if you download
1343 too much.
1344 We\[aq]re considering to provide a way to let you solve the
1345 CAPTCHA (https://github.com/rg3/youtube-dl/issues/154), but at the
1346 moment, your best course of action is pointing a webbrowser to the
1347 youtube URL, solving the CAPTCHA, and restart youtube\-dl.
1348 .SS Do I need any other programs?
1349 .PP
1350 youtube\-dl works fine on its own on most sites.
1351 However, if you want to convert video/audio, you\[aq]ll need
1352 avconv (https://libav.org/) or ffmpeg (https://www.ffmpeg.org/).
1353 On some sites \- most notably YouTube \- videos can be retrieved in a
1354 higher quality format without sound.
1355 youtube\-dl will detect whether avconv/ffmpeg is present and
1356 automatically pick the best option.
1357 .PP
1358 Videos or video formats streamed via RTMP protocol can only be
1359 downloaded when rtmpdump (https://rtmpdump.mplayerhq.hu/) is installed.
1360 Downloading MMS and RTSP videos requires either
1361 mplayer (http://mplayerhq.hu/) or mpv (https://mpv.io/) to be installed.
1362 .SS I have downloaded a video but how can I play it?
1363 .PP
1364 Once the video is fully downloaded, use any video player, such as
1365 vlc (http://www.videolan.org) or mplayer (http://www.mplayerhq.hu/).
1366 .SS I extracted a video URL with \f[C]\-g\f[], but it does not play on
1367 another machine / in my webbrowser.
1368 .PP
1369 It depends a lot on the service.
1370 In many cases, requests for the video (to download/play it) must come
1371 from the same IP address and with the same cookies.
1372 Use the \f[C]\-\-cookies\f[] option to write the required cookies into a
1373 file, and advise your downloader to read cookies from that file.
1374 Some sites also require a common user agent to be used, use
1375 \f[C]\-\-dump\-user\-agent\f[] to see the one in use by youtube\-dl.
1376 .PP
1377 It may be beneficial to use IPv6; in some cases, the restrictions are
1378 only applied to IPv4.
1379 Some services (sometimes only for a subset of videos) do not restrict
1380 the video URL by IP address, cookie, or user\-agent, but these are the
1381 exception rather than the rule.
1382 .PP
1383 Please bear in mind that some URL protocols are \f[B]not\f[] supported
1384 by browsers out of the box, including RTMP.
1385 If you are using \f[C]\-g\f[], your own downloader must support these as
1386 well.
1387 .PP
1388 If you want to play the video on a machine that is not running
1389 youtube\-dl, you can relay the video content from the machine that runs
1390 youtube\-dl.
1391 You can use \f[C]\-o\ \-\f[] to let youtube\-dl stream a video to
1392 stdout, or simply allow the player to download the files written by
1393 youtube\-dl in turn.
1394 .SS ERROR: no fmt_url_map or conn information found in video info
1395 .PP
1396 YouTube has switched to a new video info format in July 2011 which is
1397 not supported by old versions of youtube\-dl.
1398 See above (#how-do-i-update-youtube-dl) for how to update youtube\-dl.
1399 .SS ERROR: unable to download video
1400 .PP
1401 YouTube requires an additional signature since September 2012 which is
1402 not supported by old versions of youtube\-dl.
1403 See above (#how-do-i-update-youtube-dl) for how to update youtube\-dl.
1404 .SS Video URL contains an ampersand and I\[aq]m getting some strange
1405 output \f[C][1]\ 2839\f[] or
1406 \f[C]\[aq]v\[aq]\ is\ not\ recognized\ as\ an\ internal\ or\ external\ command\f[]
1407 .PP
1408 That\[aq]s actually the output from your shell.
1409 Since ampersand is one of the special shell characters it\[aq]s
1410 interpreted by the shell preventing you from passing the whole URL to
1411 youtube\-dl.
1412 To disable your shell from interpreting the ampersands (or any other
1413 special characters) you have to either put the whole URL in quotes or
1414 escape them with a backslash (which approach will work depends on your
1415 shell).
1416 .PP
1417 For example if your URL is
1418 https://www.youtube.com/watch?t=4&v=BaW_jenozKc you should end up with
1419 following command:
1420 .PP
1421 \f[C]youtube\-dl\ \[aq]https://www.youtube.com/watch?t=4&v=BaW_jenozKc\[aq]\f[]
1422 .PP
1423 or
1424 .PP
1425 \f[C]youtube\-dl\ https://www.youtube.com/watch?t=4\\&v=BaW_jenozKc\f[]
1426 .PP
1427 For Windows you have to use the double quotes:
1428 .PP
1429 \f[C]youtube\-dl\ "https://www.youtube.com/watch?t=4&v=BaW_jenozKc"\f[]
1430 .SS ExtractorError: Could not find JS function u\[aq]OF\[aq]
1431 .PP
1432 In February 2015, the new YouTube player contained a character sequence
1433 in a string that was misinterpreted by old versions of youtube\-dl.
1434 See above (#how-do-i-update-youtube-dl) for how to update youtube\-dl.
1435 .SS HTTP Error 429: Too Many Requests or 402: Payment Required
1436 .PP
1437 These two error codes indicate that the service is blocking your IP
1438 address because of overuse.
1439 Contact the service and ask them to unblock your IP address, or \- if
1440 you have acquired a whitelisted IP address already \- use the
1441 \f[C]\-\-proxy\f[] or \f[C]\-\-source\-address\f[]
1442 options (#network-options) to select another IP address.
1443 .SS SyntaxError: Non\-ASCII character
1444 .PP
1445 The error
1446 .IP
1447 .nf
1448 \f[C]
1449 File\ "youtube\-dl",\ line\ 2
1450 SyntaxError:\ Non\-ASCII\ character\ \[aq]\\x93\[aq]\ ...
1451 \f[]
1452 .fi
1453 .PP
1454 means you\[aq]re using an outdated version of Python.
1455 Please update to Python 2.6 or 2.7.
1456 .SS What is this binary file? Where has the code gone?
1457 .PP
1458 Since June 2012 (#342) youtube\-dl is packed as an executable zipfile,
1459 simply unzip it (might need renaming to \f[C]youtube\-dl.zip\f[] first
1460 on some systems) or clone the git repository, as laid out above.
1461 If you modify the code, you can run it by executing the
1462 \f[C]__main__.py\f[] file.
1463 To recompile the executable, run \f[C]make\ youtube\-dl\f[].
1464 .SS The exe throws a \f[I]Runtime error from Visual C++\f[]
1465 .PP
1466 To run the exe you need to install first the Microsoft Visual C++ 2008
1467 Redistributable
1468 Package (http://www.microsoft.com/en-us/download/details.aspx?id=29).
1469 .SS On Windows, how should I set up ffmpeg and youtube\-dl? Where should
1470 I put the exe files?
1471 .PP
1472 If you put youtube\-dl and ffmpeg in the same directory that you\[aq]re
1473 running the command from, it will work, but that\[aq]s rather
1474 cumbersome.
1475 .PP
1476 To make a different directory work \- either for ffmpeg, or for
1477 youtube\-dl, or for both \- simply create the directory (say,
1478 \f[C]C:\\bin\f[], or \f[C]C:\\Users\\<User\ name>\\bin\f[]), put all the
1479 executables directly in there, and then set your PATH environment
1480 variable (https://www.java.com/en/download/help/path.xml) to include
1481 that directory.
1482 .PP
1483 From then on, after restarting your shell, you will be able to access
1484 both youtube\-dl and ffmpeg (and youtube\-dl will be able to find
1485 ffmpeg) by simply typing \f[C]youtube\-dl\f[] or \f[C]ffmpeg\f[], no
1486 matter what directory you\[aq]re in.
1487 .SS How do I put downloads into a specific folder?
1488 .PP
1489 Use the \f[C]\-o\f[] to specify an output template (#output-template),
1490 for example \f[C]\-o\ "/home/user/videos/%(title)s\-%(id)s.%(ext)s"\f[].
1491 If you want this for all of your downloads, put the option into your
1492 configuration file (#configuration).
1493 .SS How do I download a video starting with a \f[C]\-\f[]?
1494 .PP
1495 Either prepend \f[C]http://www.youtube.com/watch?v=\f[] or separate the
1496 ID from the options with \f[C]\-\-\f[]:
1497 .IP
1498 .nf
1499 \f[C]
1500 youtube\-dl\ \-\-\ \-wNyEUrxzFU
1501 youtube\-dl\ "http://www.youtube.com/watch?v=\-wNyEUrxzFU"
1502 \f[]
1503 .fi
1504 .SS How do I pass cookies to youtube\-dl?
1505 .PP
1506 Use the \f[C]\-\-cookies\f[] option, for example
1507 \f[C]\-\-cookies\ /path/to/cookies/file.txt\f[].
1508 Note that the cookies file must be in Mozilla/Netscape format and the
1509 first line of the cookies file must be either
1510 \f[C]#\ HTTP\ Cookie\ File\f[] or
1511 \f[C]#\ Netscape\ HTTP\ Cookie\ File\f[].
1512 Make sure you have correct newline
1513 format (https://en.wikipedia.org/wiki/Newline) in the cookies file and
1514 convert newlines if necessary to correspond with your OS, namely
1515 \f[C]CRLF\f[] (\f[C]\\r\\n\f[]) for Windows, \f[C]LF\f[] (\f[C]\\n\f[])
1516 for Linux and \f[C]CR\f[] (\f[C]\\r\f[]) for Mac OS.
1517 \f[C]HTTP\ Error\ 400:\ Bad\ Request\f[] when using \f[C]\-\-cookies\f[]
1518 is a good sign of invalid newline format.
1519 .PP
1520 Passing cookies to youtube\-dl is a good way to workaround login when a
1521 particular extractor does not implement it explicitly.
1522 Another use case is working around
1523 CAPTCHA (https://en.wikipedia.org/wiki/CAPTCHA) some websites require
1524 you to solve in particular cases in order to get access (e.g.
1525 YouTube, CloudFlare).
1526 .SS Can you add support for this anime video site, or site which shows
1527 current movies for free?
1528 .PP
1529 As a matter of policy (as well as legality), youtube\-dl does not
1530 include support for services that specialize in infringing copyright.
1531 As a rule of thumb, if you cannot easily find a video that the service
1532 is quite obviously allowed to distribute (i.e.
1533 that has been uploaded by the creator, the creator\[aq]s distributor, or
1534 is published under a free license), the service is probably unfit for
1535 inclusion to youtube\-dl.
1536 .PP
1537 A note on the service that they don\[aq]t host the infringing content,
1538 but just link to those who do, is evidence that the service should
1539 \f[B]not\f[] be included into youtube\-dl.
1540 The same goes for any DMCA note when the whole front page of the service
1541 is filled with videos they are not allowed to distribute.
1542 A "fair use" note is equally unconvincing if the service shows
1543 copyright\-protected videos in full without authorization.
1544 .PP
1545 Support requests for services that \f[B]do\f[] purchase the rights to
1546 distribute their content are perfectly fine though.
1547 If in doubt, you can simply include a source that mentions the
1548 legitimate purchase of content.
1549 .SS How can I speed up work on my issue?
1550 .PP
1551 (Also known as: Help, my important issue not being solved!) The
1552 youtube\-dl core developer team is quite small.
1553 While we do our best to solve as many issues as possible, sometimes that
1554 can take quite a while.
1555 To speed up your issue, here\[aq]s what you can do:
1556 .PP
1557 First of all, please do report the issue at our issue
1558 tracker (https://yt-dl.org/bugs).
1559 That allows us to coordinate all efforts by users and developers, and
1560 serves as a unified point.
1561 Unfortunately, the youtube\-dl project has grown too large to use
1562 personal email as an effective communication channel.
1563 .PP
1564 Please read the bug reporting instructions (#bugs) below.
1565 A lot of bugs lack all the necessary information.
1566 If you can, offer proxy, VPN, or shell access to the youtube\-dl
1567 developers.
1568 If you are able to, test the issue from multiple computers in multiple
1569 countries to exclude local censorship or misconfiguration issues.
1570 .PP
1571 If nobody is interested in solving your issue, you are welcome to take
1572 matters into your own hands and submit a pull request (or coerce/pay
1573 somebody else to do so).
1574 .PP
1575 Feel free to bump the issue from time to time by writing a small comment
1576 ("Issue is still present in youtube\-dl version ...from France, but
1577 fixed from Belgium"), but please not more than once a month.
1578 Please do not declare your issue as \f[C]important\f[] or
1579 \f[C]urgent\f[].
1580 .SS How can I detect whether a given URL is supported by youtube\-dl?
1581 .PP
1582 For one, have a look at the list of supported
1583 sites (docs/supportedsites.md).
1584 Note that it can sometimes happen that the site changes its URL scheme
1585 (say, from http://example.com/video/1234567 to
1586 http://example.com/v/1234567 ) and youtube\-dl reports an URL of a
1587 service in that list as unsupported.
1588 In that case, simply report a bug.
1589 .PP
1590 It is \f[I]not\f[] possible to detect whether a URL is supported or not.
1591 That\[aq]s because youtube\-dl contains a generic extractor which
1592 matches \f[B]all\f[] URLs.
1593 You may be tempted to disable, exclude, or remove the generic extractor,
1594 but the generic extractor not only allows users to extract videos from
1595 lots of websites that embed a video from another service, but may also
1596 be used to extract video from a service that it\[aq]s hosting itself.
1597 Therefore, we neither recommend nor support disabling, excluding, or
1598 removing the generic extractor.
1599 .PP
1600 If you want to find out whether a given URL is supported, simply call
1601 youtube\-dl with it.
1602 If you get no videos back, chances are the URL is either not referring
1603 to a video or unsupported.
1604 You can find out which by examining the output (if you run youtube\-dl
1605 on the console) or catching an \f[C]UnsupportedError\f[] exception if
1606 you run it from a Python program.
1607 .SH DEVELOPER INSTRUCTIONS
1608 .PP
1609 Most users do not need to build youtube\-dl and can download the
1610 builds (http://rg3.github.io/youtube-dl/download.html) or get them from
1611 their distribution.
1612 .PP
1613 To run youtube\-dl as a developer, you don\[aq]t need to build anything
1614 either.
1615 Simply execute
1616 .IP
1617 .nf
1618 \f[C]
1619 python\ \-m\ youtube_dl
1620 \f[]
1621 .fi
1622 .PP
1623 To run the test, simply invoke your favorite test runner, or execute a
1624 test file directly; any of the following work:
1625 .IP
1626 .nf
1627 \f[C]
1628 python\ \-m\ unittest\ discover
1629 python\ test/test_download.py
1630 nosetests
1631 \f[]
1632 .fi
1633 .PP
1634 If you want to create a build of youtube\-dl yourself, you\[aq]ll need
1635 .IP \[bu] 2
1636 python
1637 .IP \[bu] 2
1638 make
1639 .IP \[bu] 2
1640 pandoc
1641 .IP \[bu] 2
1642 zip
1643 .IP \[bu] 2
1644 nosetests
1645 .SS Adding support for a new site
1646 .PP
1647 If you want to add support for a new site, you can follow this quick
1648 list (assuming your service is called \f[C]yourextractor\f[]):
1649 .IP " 1." 4
1650 Fork this repository (https://github.com/rg3/youtube-dl/fork)
1651 .IP " 2." 4
1652 Check out the source code with
1653 \f[C]git\ clone\ git\@github.com:YOUR_GITHUB_USERNAME/youtube\-dl.git\f[]
1654 .IP " 3." 4
1655 Start a new git branch with
1656 \f[C]cd\ youtube\-dl;\ git\ checkout\ \-b\ yourextractor\f[]
1657 .IP " 4." 4
1658 Start with this simple template and save it to
1659 \f[C]youtube_dl/extractor/yourextractor.py\f[]:
1660 .RS 4
1661 .IP
1662 .nf
1663 \f[C]
1664 #\ coding:\ utf\-8
1665 from\ __future__\ import\ unicode_literals
1666
1667 from\ .common\ import\ InfoExtractor
1668
1669
1670 class\ YourExtractorIE(InfoExtractor):
1671 \ \ \ \ _VALID_URL\ =\ r\[aq]https?://(?:www\\.)?yourextractor\\.com/watch/(?P<id>[0\-9]+)\[aq]
1672 \ \ \ \ _TEST\ =\ {
1673 \ \ \ \ \ \ \ \ \[aq]url\[aq]:\ \[aq]http://yourextractor.com/watch/42\[aq],
1674 \ \ \ \ \ \ \ \ \[aq]md5\[aq]:\ \[aq]TODO:\ md5\ sum\ of\ the\ first\ 10241\ bytes\ of\ the\ video\ file\ (use\ \-\-test)\[aq],
1675 \ \ \ \ \ \ \ \ \[aq]info_dict\[aq]:\ {
1676 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]id\[aq]:\ \[aq]42\[aq],
1677 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]ext\[aq]:\ \[aq]mp4\[aq],
1678 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]title\[aq]:\ \[aq]Video\ title\ goes\ here\[aq],
1679 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]thumbnail\[aq]:\ \[aq]re:^https?://.*\\.jpg$\[aq],
1680 \ \ \ \ \ \ \ \ \ \ \ \ #\ TODO\ more\ properties,\ either\ as:
1681 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ A\ value
1682 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ MD5\ checksum;\ start\ the\ string\ with\ md5:
1683 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ A\ regular\ expression;\ start\ the\ string\ with\ re:
1684 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ Any\ Python\ type\ (for\ example\ int\ or\ float)
1685 \ \ \ \ \ \ \ \ }
1686 \ \ \ \ }
1687
1688 \ \ \ \ def\ _real_extract(self,\ url):
1689 \ \ \ \ \ \ \ \ video_id\ =\ self._match_id(url)
1690 \ \ \ \ \ \ \ \ webpage\ =\ self._download_webpage(url,\ video_id)
1691
1692 \ \ \ \ \ \ \ \ #\ TODO\ more\ code\ goes\ here,\ for\ example\ ...
1693 \ \ \ \ \ \ \ \ title\ =\ self._html_search_regex(r\[aq]<h1>(.+?)</h1>\[aq],\ webpage,\ \[aq]title\[aq])
1694
1695 \ \ \ \ \ \ \ \ return\ {
1696 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]id\[aq]:\ video_id,
1697 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]title\[aq]:\ title,
1698 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]description\[aq]:\ self._og_search_description(webpage),
1699 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]uploader\[aq]:\ self._search_regex(r\[aq]<div[^>]+id="uploader"[^>]*>([^<]+)<\[aq],\ webpage,\ \[aq]uploader\[aq],\ fatal=False),
1700 \ \ \ \ \ \ \ \ \ \ \ \ #\ TODO\ more\ properties\ (see\ youtube_dl/extractor/common.py)
1701 \ \ \ \ \ \ \ \ }
1702 \f[]
1703 .fi
1704 .RE
1705 .IP " 5." 4
1706 Add an import in
1707 \f[C]youtube_dl/extractor/__init__.py\f[] (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/__init__.py).
1708 .IP " 6." 4
1709 Run
1710 \f[C]python\ test/test_download.py\ TestDownload.test_YourExtractor\f[].
1711 This \f[I]should fail\f[] at first, but you can continually re\-run it
1712 until you\[aq]re done.
1713 If you decide to add more than one test, then rename \f[C]_TEST\f[] to
1714 \f[C]_TESTS\f[] and make it into a list of dictionaries.
1715 The tests will then be named \f[C]TestDownload.test_YourExtractor\f[],
1716 \f[C]TestDownload.test_YourExtractor_1\f[],
1717 \f[C]TestDownload.test_YourExtractor_2\f[], etc.
1718 .IP " 7." 4
1719 Have a look at
1720 \f[C]youtube_dl/extractor/common.py\f[] (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py)
1721 for possible helper methods and a detailed description of what your
1722 extractor should and may
1723 return (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L62-L200).
1724 Add tests and code for as many as you want.
1725 .IP " 8." 4
1726 If you can, check the code with
1727 flake8 (https://pypi.python.org/pypi/flake8).
1728 .IP " 9." 4
1729 When the tests pass, add (http://git-scm.com/docs/git-add) the new files
1730 and commit (http://git-scm.com/docs/git-commit) them and
1731 push (http://git-scm.com/docs/git-push) the result, like this:
1732 .RS 4
1733 .IP
1734 .nf
1735 \f[C]
1736 $\ git\ add\ youtube_dl/extractor/__init__.py
1737 $\ git\ add\ youtube_dl/extractor/yourextractor.py
1738 $\ git\ commit\ \-m\ \[aq][yourextractor]\ Add\ new\ extractor\[aq]
1739 $\ git\ push\ origin\ yourextractor
1740 \f[]
1741 .fi
1742 .RE
1743 .IP "10." 4
1744 Finally, create a pull
1745 request (https://help.github.com/articles/creating-a-pull-request).
1746 We\[aq]ll then review and merge it.
1747 .PP
1748 In any case, thank you very much for your contributions!
1749 .SH EMBEDDING YOUTUBE\-DL
1750 .PP
1751 youtube\-dl makes the best effort to be a good command\-line program,
1752 and thus should be callable from any programming language.
1753 If you encounter any problems parsing its output, feel free to create a
1754 report (https://github.com/rg3/youtube-dl/issues/new).
1755 .PP
1756 From a Python program, you can embed youtube\-dl in a more powerful
1757 fashion, like this:
1758 .IP
1759 .nf
1760 \f[C]
1761 from\ __future__\ import\ unicode_literals
1762 import\ youtube_dl
1763
1764 ydl_opts\ =\ {}
1765 with\ youtube_dl.YoutubeDL(ydl_opts)\ as\ ydl:
1766 \ \ \ \ ydl.download([\[aq]http://www.youtube.com/watch?v=BaW_jenozKc\[aq]])
1767 \f[]
1768 .fi
1769 .PP
1770 Most likely, you\[aq]ll want to use various options.
1771 For a list of what can be done, have a look at
1772 \f[C]youtube_dl/YoutubeDL.py\f[] (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L121-L269).
1773 For a start, if you want to intercept youtube\-dl\[aq]s output, set a
1774 \f[C]logger\f[] object.
1775 .PP
1776 Here\[aq]s a more complete example of a program that outputs only errors
1777 (and a short message after the download is finished), and
1778 downloads/converts the video to an mp3 file:
1779 .IP
1780 .nf
1781 \f[C]
1782 from\ __future__\ import\ unicode_literals
1783 import\ youtube_dl
1784
1785
1786 class\ MyLogger(object):
1787 \ \ \ \ def\ debug(self,\ msg):
1788 \ \ \ \ \ \ \ \ pass
1789
1790 \ \ \ \ def\ warning(self,\ msg):
1791 \ \ \ \ \ \ \ \ pass
1792
1793 \ \ \ \ def\ error(self,\ msg):
1794 \ \ \ \ \ \ \ \ print(msg)
1795
1796
1797 def\ my_hook(d):
1798 \ \ \ \ if\ d[\[aq]status\[aq]]\ ==\ \[aq]finished\[aq]:
1799 \ \ \ \ \ \ \ \ print(\[aq]Done\ downloading,\ now\ converting\ ...\[aq])
1800
1801
1802 ydl_opts\ =\ {
1803 \ \ \ \ \[aq]format\[aq]:\ \[aq]bestaudio/best\[aq],
1804 \ \ \ \ \[aq]postprocessors\[aq]:\ [{
1805 \ \ \ \ \ \ \ \ \[aq]key\[aq]:\ \[aq]FFmpegExtractAudio\[aq],
1806 \ \ \ \ \ \ \ \ \[aq]preferredcodec\[aq]:\ \[aq]mp3\[aq],
1807 \ \ \ \ \ \ \ \ \[aq]preferredquality\[aq]:\ \[aq]192\[aq],
1808 \ \ \ \ }],
1809 \ \ \ \ \[aq]logger\[aq]:\ MyLogger(),
1810 \ \ \ \ \[aq]progress_hooks\[aq]:\ [my_hook],
1811 }
1812 with\ youtube_dl.YoutubeDL(ydl_opts)\ as\ ydl:
1813 \ \ \ \ ydl.download([\[aq]http://www.youtube.com/watch?v=BaW_jenozKc\[aq]])
1814 \f[]
1815 .fi
1816 .SH BUGS
1817 .PP
1818 Bugs and suggestions should be reported at:
1819 <https://github.com/rg3/youtube-dl/issues>.
1820 Unless you were prompted so or there is another pertinent reason (e.g.
1821 GitHub fails to accept the bug report), please do not send bug reports
1822 via personal email.
1823 For discussions, join us in the IRC channel
1824 #youtube\-dl (irc://chat.freenode.net/#youtube-dl) on freenode
1825 (webchat (http://webchat.freenode.net/?randomnick=1&channels=youtube-dl)).
1826 .PP
1827 \f[B]Please include the full output of youtube\-dl when run with
1828 \f[C]\-v\f[]\f[], i.e.
1829 \f[B]add\f[] \f[C]\-v\f[] flag to \f[B]your command line\f[], copy the
1830 \f[B]whole\f[] output and post it in the issue body wrapped in ``` for
1831 better formatting.
1832 It should look similar to this:
1833 .IP
1834 .nf
1835 \f[C]
1836 $\ youtube\-dl\ \-v\ <your\ command\ line>
1837 [debug]\ System\ config:\ []
1838 [debug]\ User\ config:\ []
1839 [debug]\ Command\-line\ args:\ [u\[aq]\-v\[aq],\ u\[aq]http://www.youtube.com/watch?v=BaW_jenozKcj\[aq]]
1840 [debug]\ Encodings:\ locale\ cp1251,\ fs\ mbcs,\ out\ cp866,\ pref\ cp1251
1841 [debug]\ youtube\-dl\ version\ 2015.12.06
1842 [debug]\ Git\ HEAD:\ 135392e
1843 [debug]\ Python\ version\ 2.6.6\ \-\ Windows\-2003Server\-5.2.3790\-SP2
1844 [debug]\ exe\ versions:\ ffmpeg\ N\-75573\-g1d0487f,\ ffprobe\ N\-75573\-g1d0487f,\ rtmpdump\ 2.4
1845 [debug]\ Proxy\ map:\ {}
1846 \&...
1847 \f[]
1848 .fi
1849 .PP
1850 \f[B]Do not post screenshots of verbose log only plain text is
1851 acceptable.\f[]
1852 .PP
1853 The output (including the first lines) contains important debugging
1854 information.
1855 Issues without the full output are often not reproducible and therefore
1856 do not get solved in short order, if ever.
1857 .PP
1858 Please re\-read your issue once again to avoid a couple of common
1859 mistakes (you can and should use this as a checklist):
1860 .SS Is the description of the issue itself sufficient?
1861 .PP
1862 We often get issue reports that we cannot really decipher.
1863 While in most cases we eventually get the required information after
1864 asking back multiple times, this poses an unnecessary drain on our
1865 resources.
1866 Many contributors, including myself, are also not native speakers, so we
1867 may misread some parts.
1868 .PP
1869 So please elaborate on what feature you are requesting, or what bug you
1870 want to be fixed.
1871 Make sure that it\[aq]s obvious
1872 .IP \[bu] 2
1873 What the problem is
1874 .IP \[bu] 2
1875 How it could be fixed
1876 .IP \[bu] 2
1877 How your proposed solution would look like
1878 .PP
1879 If your report is shorter than two lines, it is almost certainly missing
1880 some of these, which makes it hard for us to respond to it.
1881 We\[aq]re often too polite to close the issue outright, but the missing
1882 info makes misinterpretation likely.
1883 As a committer myself, I often get frustrated by these issues, since the
1884 only possible way for me to move forward on them is to ask for
1885 clarification over and over.
1886 .PP
1887 For bug reports, this means that your report should contain the
1888 \f[I]complete\f[] output of youtube\-dl when called with the
1889 \f[C]\-v\f[] flag.
1890 The error message you get for (most) bugs even says so, but you would
1891 not believe how many of our bug reports do not contain this information.
1892 .PP
1893 If your server has multiple IPs or you suspect censorship, adding
1894 \f[C]\-\-call\-home\f[] may be a good idea to get more diagnostics.
1895 If the error is \f[C]ERROR:\ Unable\ to\ extract\ ...\f[] and you cannot
1896 reproduce it from multiple countries, add \f[C]\-\-dump\-pages\f[]
1897 (warning: this will yield a rather large output, redirect it to the file
1898 \f[C]log.txt\f[] by adding \f[C]>log.txt\ 2>&1\f[] to your
1899 command\-line) or upload the \f[C]\&.dump\f[] files you get when you add
1900 \f[C]\-\-write\-pages\f[] somewhere (https://gist.github.com/).
1901 .PP
1902 \f[B]Site support requests must contain an example URL\f[].
1903 An example URL is a URL you might want to download, like
1904 \f[C]http://www.youtube.com/watch?v=BaW_jenozKc\f[].
1905 There should be an obvious video present.
1906 Except under very special circumstances, the main page of a video
1907 service (e.g.
1908 \f[C]http://www.youtube.com/\f[]) is \f[I]not\f[] an example URL.
1909 .SS Are you using the latest version?
1910 .PP
1911 Before reporting any issue, type \f[C]youtube\-dl\ \-U\f[].
1912 This should report that you\[aq]re up\-to\-date.
1913 About 20% of the reports we receive are already fixed, but people are
1914 using outdated versions.
1915 This goes for feature requests as well.
1916 .SS Is the issue already documented?
1917 .PP
1918 Make sure that someone has not already opened the issue you\[aq]re
1919 trying to open.
1920 Search at the top of the window or browse the GitHub
1921 Issues (https://github.com/rg3/youtube-dl/search?type=Issues) of this
1922 repository.
1923 If there is an issue, feel free to write something along the lines of
1924 "This affects me as well, with version 2015.01.01.
1925 Here is some more information on the issue: ...".
1926 While some issues may be old, a new post into them often spurs rapid
1927 activity.
1928 .SS Why are existing options not enough?
1929 .PP
1930 Before requesting a new feature, please have a quick peek at the list of
1931 supported
1932 options (https://github.com/rg3/youtube-dl/blob/master/README.md#synopsis).
1933 Many feature requests are for features that actually exist already!
1934 Please, absolutely do show off your work in the issue report and detail
1935 how the existing similar options do \f[I]not\f[] solve your problem.
1936 .SS Is there enough context in your bug report?
1937 .PP
1938 People want to solve problems, and often think they do us a favor by
1939 breaking down their larger problems (e.g.
1940 wanting to skip already downloaded files) to a specific request (e.g.
1941 requesting us to look whether the file exists before downloading the
1942 info page).
1943 However, what often happens is that they break down the problem into two
1944 steps: One simple, and one impossible (or extremely complicated one).
1945 .PP
1946 We are then presented with a very complicated request when the original
1947 problem could be solved far easier, e.g.
1948 by recording the downloaded video IDs in a separate file.
1949 To avoid this, you must include the greater context where it is
1950 non\-obvious.
1951 In particular, every feature request that does not consist of adding
1952 support for a new site should contain a use case scenario that explains
1953 in what situation the missing feature would be useful.
1954 .SS Does the issue involve one problem, and one problem only?
1955 .PP
1956 Some of our users seem to think there is a limit of issues they can or
1957 should open.
1958 There is no limit of issues they can or should open.
1959 While it may seem appealing to be able to dump all your issues into one
1960 ticket, that means that someone who solves one of your issues cannot
1961 mark the issue as closed.
1962 Typically, reporting a bunch of issues leads to the ticket lingering
1963 since nobody wants to attack that behemoth, until someone mercifully
1964 splits the issue into multiple ones.
1965 .PP
1966 In particular, every site support request issue should only pertain to
1967 services at one site (generally under a common domain, but always using
1968 the same backend technology).
1969 Do not request support for vimeo user videos, Whitehouse podcasts, and
1970 Google Plus pages in the same issue.
1971 Also, make sure that you don\[aq]t post bug reports alongside feature
1972 requests.
1973 As a rule of thumb, a feature request does not include outputs of
1974 youtube\-dl that are not immediately related to the feature at hand.
1975 Do not post reports of a network error alongside the request for a new
1976 video service.
1977 .SS Is anyone going to need the feature?
1978 .PP
1979 Only post features that you (or an incapacitated friend you can
1980 personally talk to) require.
1981 Do not post features because they seem like a good idea.
1982 If they are really useful, they will be requested by someone who
1983 requires them.
1984 .SS Is your question about youtube\-dl?
1985 .PP
1986 It may sound strange, but some bug reports we receive are completely
1987 unrelated to youtube\-dl and relate to a different or even the
1988 reporter\[aq]s own application.
1989 Please make sure that you are actually using youtube\-dl.
1990 If you are using a UI for youtube\-dl, report the bug to the maintainer
1991 of the actual application providing the UI.
1992 On the other hand, if your UI for youtube\-dl fails in some way you
1993 believe is related to youtube\-dl, by all means, go ahead and report the
1994 bug.
1995 .SH COPYRIGHT
1996 .PP
1997 youtube\-dl is released into the public domain by the copyright holders.
1998 .PP
1999 This README file was originally written by Daniel
2000 Bolton (https://github.com/dbbolton) and is likewise released into the
2001 public domain.