]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube-dl.1
d5967c8bfb8637e762fd0c4f0dd2f5b0726d36dd
[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 of specified videos
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 automatically generated 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 Do I need any other programs?
1136 .PP
1137 youtube\-dl works fine on its own on most sites.
1138 However, if you want to convert video/audio, you\[aq]ll need
1139 avconv (https://libav.org/) or ffmpeg (https://www.ffmpeg.org/).
1140 On some sites \- most notably YouTube \- videos can be retrieved in a
1141 higher quality format without sound.
1142 youtube\-dl will detect whether avconv/ffmpeg is present and
1143 automatically pick the best option.
1144 .PP
1145 Videos or video formats streamed via RTMP protocol can only be
1146 downloaded when rtmpdump (https://rtmpdump.mplayerhq.hu/) is installed.
1147 Downloading MMS and RTSP videos requires either
1148 mplayer (http://mplayerhq.hu/) or mpv (https://mpv.io/) to be installed.
1149 .SS I have downloaded a video but how can I play it?
1150 .PP
1151 Once the video is fully downloaded, use any video player, such as
1152 vlc (http://www.videolan.org) or mplayer (http://www.mplayerhq.hu/).
1153 .SS I extracted a video URL with \f[C]\-g\f[], but it does not play on
1154 another machine / in my webbrowser.
1155 .PP
1156 It depends a lot on the service.
1157 In many cases, requests for the video (to download/play it) must come
1158 from the same IP address and with the same cookies.
1159 Use the \f[C]\-\-cookies\f[] option to write the required cookies into a
1160 file, and advise your downloader to read cookies from that file.
1161 Some sites also require a common user agent to be used, use
1162 \f[C]\-\-dump\-user\-agent\f[] to see the one in use by youtube\-dl.
1163 .PP
1164 It may be beneficial to use IPv6; in some cases, the restrictions are
1165 only applied to IPv4.
1166 Some services (sometimes only for a subset of videos) do not restrict
1167 the video URL by IP address, cookie, or user\-agent, but these are the
1168 exception rather than the rule.
1169 .PP
1170 Please bear in mind that some URL protocols are \f[B]not\f[] supported
1171 by browsers out of the box, including RTMP.
1172 If you are using \f[C]\-g\f[], your own downloader must support these as
1173 well.
1174 .PP
1175 If you want to play the video on a machine that is not running
1176 youtube\-dl, you can relay the video content from the machine that runs
1177 youtube\-dl.
1178 You can use \f[C]\-o\ \-\f[] to let youtube\-dl stream a video to
1179 stdout, or simply allow the player to download the files written by
1180 youtube\-dl in turn.
1181 .SS ERROR: no fmt_url_map or conn information found in video info
1182 .PP
1183 YouTube has switched to a new video info format in July 2011 which is
1184 not supported by old versions of youtube\-dl.
1185 See above (#how-do-i-update-youtube-dl) for how to update youtube\-dl.
1186 .SS ERROR: unable to download video
1187 .PP
1188 YouTube requires an additional signature since September 2012 which is
1189 not supported by old versions of youtube\-dl.
1190 See above (#how-do-i-update-youtube-dl) for how to update youtube\-dl.
1191 .SS Video URL contains an ampersand and I\[aq]m getting some strange
1192 output \f[C][1]\ 2839\f[] or
1193 \f[C]\[aq]v\[aq]\ is\ not\ recognized\ as\ an\ internal\ or\ external\ command\f[]
1194 .PP
1195 That\[aq]s actually the output from your shell.
1196 Since ampersand is one of the special shell characters it\[aq]s
1197 interpreted by the shell preventing you from passing the whole URL to
1198 youtube\-dl.
1199 To disable your shell from interpreting the ampersands (or any other
1200 special characters) you have to either put the whole URL in quotes or
1201 escape them with a backslash (which approach will work depends on your
1202 shell).
1203 .PP
1204 For example if your URL is
1205 https://www.youtube.com/watch?t=4&v=BaW_jenozKc you should end up with
1206 following command:
1207 .PP
1208 \f[C]youtube\-dl\ \[aq]https://www.youtube.com/watch?t=4&v=BaW_jenozKc\[aq]\f[]
1209 .PP
1210 or
1211 .PP
1212 \f[C]youtube\-dl\ https://www.youtube.com/watch?t=4\\&v=BaW_jenozKc\f[]
1213 .PP
1214 For Windows you have to use the double quotes:
1215 .PP
1216 \f[C]youtube\-dl\ "https://www.youtube.com/watch?t=4&v=BaW_jenozKc"\f[]
1217 .SS ExtractorError: Could not find JS function u\[aq]OF\[aq]
1218 .PP
1219 In February 2015, the new YouTube player contained a character sequence
1220 in a string that was misinterpreted by old versions of youtube\-dl.
1221 See above (#how-do-i-update-youtube-dl) for how to update youtube\-dl.
1222 .SS HTTP Error 429: Too Many Requests or 402: Payment Required
1223 .PP
1224 These two error codes indicate that the service is blocking your IP
1225 address because of overuse.
1226 Contact the service and ask them to unblock your IP address, or \- if
1227 you have acquired a whitelisted IP address already \- use the
1228 \f[C]\-\-proxy\f[] or \f[C]\-\-source\-address\f[]
1229 options (#network-options) to select another IP address.
1230 .SS SyntaxError: Non\-ASCII character
1231 .PP
1232 The error
1233 .IP
1234 .nf
1235 \f[C]
1236 File\ "youtube\-dl",\ line\ 2
1237 SyntaxError:\ Non\-ASCII\ character\ \[aq]\\x93\[aq]\ ...
1238 \f[]
1239 .fi
1240 .PP
1241 means you\[aq]re using an outdated version of Python.
1242 Please update to Python 2.6 or 2.7.
1243 .SS What is this binary file? Where has the code gone?
1244 .PP
1245 Since June 2012 (#342) youtube\-dl is packed as an executable zipfile,
1246 simply unzip it (might need renaming to \f[C]youtube\-dl.zip\f[] first
1247 on some systems) or clone the git repository, as laid out above.
1248 If you modify the code, you can run it by executing the
1249 \f[C]__main__.py\f[] file.
1250 To recompile the executable, run \f[C]make\ youtube\-dl\f[].
1251 .SS The exe throws a \f[I]Runtime error from Visual C++\f[]
1252 .PP
1253 To run the exe you need to install first the Microsoft Visual C++ 2008
1254 Redistributable
1255 Package (http://www.microsoft.com/en-us/download/details.aspx?id=29).
1256 .SS On Windows, how should I set up ffmpeg and youtube\-dl? Where should
1257 I put the exe files?
1258 .PP
1259 If you put youtube\-dl and ffmpeg in the same directory that you\[aq]re
1260 running the command from, it will work, but that\[aq]s rather
1261 cumbersome.
1262 .PP
1263 To make a different directory work \- either for ffmpeg, or for
1264 youtube\-dl, or for both \- simply create the directory (say,
1265 \f[C]C:\\bin\f[], or \f[C]C:\\Users\\<User\ name>\\bin\f[]), put all the
1266 executables directly in there, and then set your PATH environment
1267 variable (https://www.java.com/en/download/help/path.xml) to include
1268 that directory.
1269 .PP
1270 From then on, after restarting your shell, you will be able to access
1271 both youtube\-dl and ffmpeg (and youtube\-dl will be able to find
1272 ffmpeg) by simply typing \f[C]youtube\-dl\f[] or \f[C]ffmpeg\f[], no
1273 matter what directory you\[aq]re in.
1274 .SS How do I put downloads into a specific folder?
1275 .PP
1276 Use the \f[C]\-o\f[] to specify an output template (#output-template),
1277 for example \f[C]\-o\ "/home/user/videos/%(title)s\-%(id)s.%(ext)s"\f[].
1278 If you want this for all of your downloads, put the option into your
1279 configuration file (#configuration).
1280 .SS How do I download a video starting with a \f[C]\-\f[] ?
1281 .PP
1282 Either prepend \f[C]http://www.youtube.com/watch?v=\f[] or separate the
1283 ID from the options with \f[C]\-\-\f[]:
1284 .IP
1285 .nf
1286 \f[C]
1287 youtube\-dl\ \-\-\ \-wNyEUrxzFU
1288 youtube\-dl\ "http://www.youtube.com/watch?v=\-wNyEUrxzFU"
1289 \f[]
1290 .fi
1291 .SS How do I pass cookies to youtube\-dl?
1292 .PP
1293 Use the \f[C]\-\-cookies\f[] option, for example
1294 \f[C]\-\-cookies\ /path/to/cookies/file.txt\f[].
1295 Note that the cookies file must be in Mozilla/Netscape format and the
1296 first line of the cookies file must be either
1297 \f[C]#\ HTTP\ Cookie\ File\f[] or
1298 \f[C]#\ Netscape\ HTTP\ Cookie\ File\f[].
1299 Make sure you have correct newline
1300 format (https://en.wikipedia.org/wiki/Newline) in the cookies file and
1301 convert newlines if necessary to correspond with your OS, namely
1302 \f[C]CRLF\f[] (\f[C]\\r\\n\f[]) for Windows, \f[C]LF\f[] (\f[C]\\n\f[])
1303 for Linux and \f[C]CR\f[] (\f[C]\\r\f[]) for Mac OS.
1304 \f[C]HTTP\ Error\ 400:\ Bad\ Request\f[] when using \f[C]\-\-cookies\f[]
1305 is a good sign of invalid newline format.
1306 .PP
1307 Passing cookies to youtube\-dl is a good way to workaround login when a
1308 particular extractor does not implement it explicitly.
1309 .SS Can you add support for this anime video site, or site which shows
1310 current movies for free?
1311 .PP
1312 As a matter of policy (as well as legality), youtube\-dl does not
1313 include support for services that specialize in infringing copyright.
1314 As a rule of thumb, if you cannot easily find a video that the service
1315 is quite obviously allowed to distribute (i.e.
1316 that has been uploaded by the creator, the creator\[aq]s distributor, or
1317 is published under a free license), the service is probably unfit for
1318 inclusion to youtube\-dl.
1319 .PP
1320 A note on the service that they don\[aq]t host the infringing content,
1321 but just link to those who do, is evidence that the service should
1322 \f[B]not\f[] be included into youtube\-dl.
1323 The same goes for any DMCA note when the whole front page of the service
1324 is filled with videos they are not allowed to distribute.
1325 A "fair use" note is equally unconvincing if the service shows
1326 copyright\-protected videos in full without authorization.
1327 .PP
1328 Support requests for services that \f[B]do\f[] purchase the rights to
1329 distribute their content are perfectly fine though.
1330 If in doubt, you can simply include a source that mentions the
1331 legitimate purchase of content.
1332 .SS How can I speed up work on my issue?
1333 .PP
1334 (Also known as: Help, my important issue not being solved!) The
1335 youtube\-dl core developer team is quite small.
1336 While we do our best to solve as many issues as possible, sometimes that
1337 can take quite a while.
1338 To speed up your issue, here\[aq]s what you can do:
1339 .PP
1340 First of all, please do report the issue at our issue
1341 tracker (https://yt-dl.org/bugs).
1342 That allows us to coordinate all efforts by users and developers, and
1343 serves as a unified point.
1344 Unfortunately, the youtube\-dl project has grown too large to use
1345 personal email as an effective communication channel.
1346 .PP
1347 Please read the bug reporting instructions (#bugs) below.
1348 A lot of bugs lack all the necessary information.
1349 If you can, offer proxy, VPN, or shell access to the youtube\-dl
1350 developers.
1351 If you are able to, test the issue from multiple computers in multiple
1352 countries to exclude local censorship or misconfiguration issues.
1353 .PP
1354 If nobody is interested in solving your issue, you are welcome to take
1355 matters into your own hands and submit a pull request (or coerce/pay
1356 somebody else to do so).
1357 .PP
1358 Feel free to bump the issue from time to time by writing a small comment
1359 ("Issue is still present in youtube\-dl version ...from France, but
1360 fixed from Belgium"), but please not more than once a month.
1361 Please do not declare your issue as \f[C]important\f[] or
1362 \f[C]urgent\f[].
1363 .SS How can I detect whether a given URL is supported by youtube\-dl?
1364 .PP
1365 For one, have a look at the list of supported
1366 sites (docs/supportedsites.md).
1367 Note that it can sometimes happen that the site changes its URL scheme
1368 (say, from http://example.com/video/1234567 to
1369 http://example.com/v/1234567 ) and youtube\-dl reports an URL of a
1370 service in that list as unsupported.
1371 In that case, simply report a bug.
1372 .PP
1373 It is \f[I]not\f[] possible to detect whether a URL is supported or not.
1374 That\[aq]s because youtube\-dl contains a generic extractor which
1375 matches \f[B]all\f[] URLs.
1376 You may be tempted to disable, exclude, or remove the generic extractor,
1377 but the generic extractor not only allows users to extract videos from
1378 lots of websites that embed a video from another service, but may also
1379 be used to extract video from a service that it\[aq]s hosting itself.
1380 Therefore, we neither recommend nor support disabling, excluding, or
1381 removing the generic extractor.
1382 .PP
1383 If you want to find out whether a given URL is supported, simply call
1384 youtube\-dl with it.
1385 If you get no videos back, chances are the URL is either not referring
1386 to a video or unsupported.
1387 You can find out which by examining the output (if you run youtube\-dl
1388 on the console) or catching an \f[C]UnsupportedError\f[] exception if
1389 you run it from a Python program.
1390 .SH DEVELOPER INSTRUCTIONS
1391 .PP
1392 Most users do not need to build youtube\-dl and can download the
1393 builds (http://rg3.github.io/youtube-dl/download.html) or get them from
1394 their distribution.
1395 .PP
1396 To run youtube\-dl as a developer, you don\[aq]t need to build anything
1397 either.
1398 Simply execute
1399 .IP
1400 .nf
1401 \f[C]
1402 python\ \-m\ youtube_dl
1403 \f[]
1404 .fi
1405 .PP
1406 To run the test, simply invoke your favorite test runner, or execute a
1407 test file directly; any of the following work:
1408 .IP
1409 .nf
1410 \f[C]
1411 python\ \-m\ unittest\ discover
1412 python\ test/test_download.py
1413 nosetests
1414 \f[]
1415 .fi
1416 .PP
1417 If you want to create a build of youtube\-dl yourself, you\[aq]ll need
1418 .IP \[bu] 2
1419 python
1420 .IP \[bu] 2
1421 make
1422 .IP \[bu] 2
1423 pandoc
1424 .IP \[bu] 2
1425 zip
1426 .IP \[bu] 2
1427 nosetests
1428 .SS Adding support for a new site
1429 .PP
1430 If you want to add support for a new site, you can follow this quick
1431 list (assuming your service is called \f[C]yourextractor\f[]):
1432 .IP " 1." 4
1433 Fork this repository (https://github.com/rg3/youtube-dl/fork)
1434 .IP " 2." 4
1435 Check out the source code with
1436 \f[C]git\ clone\ git\@github.com:YOUR_GITHUB_USERNAME/youtube\-dl.git\f[]
1437 .IP " 3." 4
1438 Start a new git branch with
1439 \f[C]cd\ youtube\-dl;\ git\ checkout\ \-b\ yourextractor\f[]
1440 .IP " 4." 4
1441 Start with this simple template and save it to
1442 \f[C]youtube_dl/extractor/yourextractor.py\f[]:
1443 .RS 4
1444 .IP
1445 .nf
1446 \f[C]
1447 #\ coding:\ utf\-8
1448 from\ __future__\ import\ unicode_literals
1449
1450 from\ .common\ import\ InfoExtractor
1451
1452
1453 class\ YourExtractorIE(InfoExtractor):
1454 \ \ \ \ _VALID_URL\ =\ r\[aq]https?://(?:www\\.)?yourextractor\\.com/watch/(?P<id>[0\-9]+)\[aq]
1455 \ \ \ \ _TEST\ =\ {
1456 \ \ \ \ \ \ \ \ \[aq]url\[aq]:\ \[aq]http://yourextractor.com/watch/42\[aq],
1457 \ \ \ \ \ \ \ \ \[aq]md5\[aq]:\ \[aq]TODO:\ md5\ sum\ of\ the\ first\ 10241\ bytes\ of\ the\ video\ file\ (use\ \-\-test)\[aq],
1458 \ \ \ \ \ \ \ \ \[aq]info_dict\[aq]:\ {
1459 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]id\[aq]:\ \[aq]42\[aq],
1460 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]ext\[aq]:\ \[aq]mp4\[aq],
1461 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]title\[aq]:\ \[aq]Video\ title\ goes\ here\[aq],
1462 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]thumbnail\[aq]:\ \[aq]re:^https?://.*\\.jpg$\[aq],
1463 \ \ \ \ \ \ \ \ \ \ \ \ #\ TODO\ more\ properties,\ either\ as:
1464 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ A\ value
1465 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ MD5\ checksum;\ start\ the\ string\ with\ md5:
1466 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ A\ regular\ expression;\ start\ the\ string\ with\ re:
1467 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ Any\ Python\ type\ (for\ example\ int\ or\ float)
1468 \ \ \ \ \ \ \ \ }
1469 \ \ \ \ }
1470
1471 \ \ \ \ def\ _real_extract(self,\ url):
1472 \ \ \ \ \ \ \ \ video_id\ =\ self._match_id(url)
1473 \ \ \ \ \ \ \ \ webpage\ =\ self._download_webpage(url,\ video_id)
1474
1475 \ \ \ \ \ \ \ \ #\ TODO\ more\ code\ goes\ here,\ for\ example\ ...
1476 \ \ \ \ \ \ \ \ title\ =\ self._html_search_regex(r\[aq]<h1>(.+?)</h1>\[aq],\ webpage,\ \[aq]title\[aq])
1477
1478 \ \ \ \ \ \ \ \ return\ {
1479 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]id\[aq]:\ video_id,
1480 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]title\[aq]:\ title,
1481 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]description\[aq]:\ self._og_search_description(webpage),
1482 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]uploader\[aq]:\ self._search_regex(r\[aq]<div[^>]+id="uploader"[^>]*>([^<]+)<\[aq],\ webpage,\ \[aq]uploader\[aq],\ fatal=False),
1483 \ \ \ \ \ \ \ \ \ \ \ \ #\ TODO\ more\ properties\ (see\ youtube_dl/extractor/common.py)
1484 \ \ \ \ \ \ \ \ }
1485 \f[]
1486 .fi
1487 .RE
1488 .IP " 5." 4
1489 Add an import in
1490 \f[C]youtube_dl/extractor/__init__.py\f[] (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/__init__.py).
1491 .IP " 6." 4
1492 Run
1493 \f[C]python\ test/test_download.py\ TestDownload.test_YourExtractor\f[].
1494 This \f[I]should fail\f[] at first, but you can continually re\-run it
1495 until you\[aq]re done.
1496 If you decide to add more than one test, then rename \f[C]_TEST\f[] to
1497 \f[C]_TESTS\f[] and make it into a list of dictionaries.
1498 The tests will then be named \f[C]TestDownload.test_YourExtractor\f[],
1499 \f[C]TestDownload.test_YourExtractor_1\f[],
1500 \f[C]TestDownload.test_YourExtractor_2\f[], etc.
1501 .IP " 7." 4
1502 Have a look at
1503 \f[C]youtube_dl/extractor/common.py\f[] (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py)
1504 for possible helper methods and a detailed description of what your
1505 extractor should and may
1506 return (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L62-L200).
1507 Add tests and code for as many as you want.
1508 .IP " 8." 4
1509 If you can, check the code with
1510 flake8 (https://pypi.python.org/pypi/flake8).
1511 .IP " 9." 4
1512 When the tests pass, add (http://git-scm.com/docs/git-add) the new files
1513 and commit (http://git-scm.com/docs/git-commit) them and
1514 push (http://git-scm.com/docs/git-push) the result, like this:
1515 .RS 4
1516 .IP
1517 .nf
1518 \f[C]
1519 $\ git\ add\ youtube_dl/extractor/__init__.py
1520 $\ git\ add\ youtube_dl/extractor/yourextractor.py
1521 $\ git\ commit\ \-m\ \[aq][yourextractor]\ Add\ new\ extractor\[aq]
1522 $\ git\ push\ origin\ yourextractor
1523 \f[]
1524 .fi
1525 .RE
1526 .IP "10." 4
1527 Finally, create a pull
1528 request (https://help.github.com/articles/creating-a-pull-request).
1529 We\[aq]ll then review and merge it.
1530 .PP
1531 In any case, thank you very much for your contributions!
1532 .SH EMBEDDING YOUTUBE\-DL
1533 .PP
1534 youtube\-dl makes the best effort to be a good command\-line program,
1535 and thus should be callable from any programming language.
1536 If you encounter any problems parsing its output, feel free to create a
1537 report (https://github.com/rg3/youtube-dl/issues/new).
1538 .PP
1539 From a Python program, you can embed youtube\-dl in a more powerful
1540 fashion, like this:
1541 .IP
1542 .nf
1543 \f[C]
1544 from\ __future__\ import\ unicode_literals
1545 import\ youtube_dl
1546
1547 ydl_opts\ =\ {}
1548 with\ youtube_dl.YoutubeDL(ydl_opts)\ as\ ydl:
1549 \ \ \ \ ydl.download([\[aq]http://www.youtube.com/watch?v=BaW_jenozKc\[aq]])
1550 \f[]
1551 .fi
1552 .PP
1553 Most likely, you\[aq]ll want to use various options.
1554 For a list of what can be done, have a look at
1555 youtube_dl/YoutubeDL.py (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L117-L265).
1556 For a start, if you want to intercept youtube\-dl\[aq]s output, set a
1557 \f[C]logger\f[] object.
1558 .PP
1559 Here\[aq]s a more complete example of a program that outputs only errors
1560 (and a short message after the download is finished), and
1561 downloads/converts the video to an mp3 file:
1562 .IP
1563 .nf
1564 \f[C]
1565 from\ __future__\ import\ unicode_literals
1566 import\ youtube_dl
1567
1568
1569 class\ MyLogger(object):
1570 \ \ \ \ def\ debug(self,\ msg):
1571 \ \ \ \ \ \ \ \ pass
1572
1573 \ \ \ \ def\ warning(self,\ msg):
1574 \ \ \ \ \ \ \ \ pass
1575
1576 \ \ \ \ def\ error(self,\ msg):
1577 \ \ \ \ \ \ \ \ print(msg)
1578
1579
1580 def\ my_hook(d):
1581 \ \ \ \ if\ d[\[aq]status\[aq]]\ ==\ \[aq]finished\[aq]:
1582 \ \ \ \ \ \ \ \ print(\[aq]Done\ downloading,\ now\ converting\ ...\[aq])
1583
1584
1585 ydl_opts\ =\ {
1586 \ \ \ \ \[aq]format\[aq]:\ \[aq]bestaudio/best\[aq],
1587 \ \ \ \ \[aq]postprocessors\[aq]:\ [{
1588 \ \ \ \ \ \ \ \ \[aq]key\[aq]:\ \[aq]FFmpegExtractAudio\[aq],
1589 \ \ \ \ \ \ \ \ \[aq]preferredcodec\[aq]:\ \[aq]mp3\[aq],
1590 \ \ \ \ \ \ \ \ \[aq]preferredquality\[aq]:\ \[aq]192\[aq],
1591 \ \ \ \ }],
1592 \ \ \ \ \[aq]logger\[aq]:\ MyLogger(),
1593 \ \ \ \ \[aq]progress_hooks\[aq]:\ [my_hook],
1594 }
1595 with\ youtube_dl.YoutubeDL(ydl_opts)\ as\ ydl:
1596 \ \ \ \ ydl.download([\[aq]http://www.youtube.com/watch?v=BaW_jenozKc\[aq]])
1597 \f[]
1598 .fi
1599 .SH BUGS
1600 .PP
1601 Bugs and suggestions should be reported at:
1602 <https://github.com/rg3/youtube-dl/issues> .
1603 Unless you were prompted so or there is another pertinent reason (e.g.
1604 GitHub fails to accept the bug report), please do not send bug reports
1605 via personal email.
1606 For discussions, join us in the irc channel #youtube\-dl on freenode.
1607 .PP
1608 \f[B]Please include the full output of youtube\-dl when run with
1609 \f[C]\-v\f[]\f[].
1610 .PP
1611 The output (including the first lines) contains important debugging
1612 information.
1613 Issues without the full output are often not reproducible and therefore
1614 do not get solved in short order, if ever.
1615 .PP
1616 Please re\-read your issue once again to avoid a couple of common
1617 mistakes (you can and should use this as a checklist):
1618 .SS Is the description of the issue itself sufficient?
1619 .PP
1620 We often get issue reports that we cannot really decipher.
1621 While in most cases we eventually get the required information after
1622 asking back multiple times, this poses an unnecessary drain on our
1623 resources.
1624 Many contributors, including myself, are also not native speakers, so we
1625 may misread some parts.
1626 .PP
1627 So please elaborate on what feature you are requesting, or what bug you
1628 want to be fixed.
1629 Make sure that it\[aq]s obvious
1630 .IP \[bu] 2
1631 What the problem is
1632 .IP \[bu] 2
1633 How it could be fixed
1634 .IP \[bu] 2
1635 How your proposed solution would look like
1636 .PP
1637 If your report is shorter than two lines, it is almost certainly missing
1638 some of these, which makes it hard for us to respond to it.
1639 We\[aq]re often too polite to close the issue outright, but the missing
1640 info makes misinterpretation likely.
1641 As a commiter myself, I often get frustrated by these issues, since the
1642 only possible way for me to move forward on them is to ask for
1643 clarification over and over.
1644 .PP
1645 For bug reports, this means that your report should contain the
1646 \f[I]complete\f[] output of youtube\-dl when called with the
1647 \f[C]\-v\f[] flag.
1648 The error message you get for (most) bugs even says so, but you would
1649 not believe how many of our bug reports do not contain this information.
1650 .PP
1651 If your server has multiple IPs or you suspect censorship, adding
1652 \f[C]\-\-call\-home\f[] may be a good idea to get more diagnostics.
1653 If the error is \f[C]ERROR:\ Unable\ to\ extract\ ...\f[] and you cannot
1654 reproduce it from multiple countries, add \f[C]\-\-dump\-pages\f[]
1655 (warning: this will yield a rather large output, redirect it to the file
1656 \f[C]log.txt\f[] by adding \f[C]>log.txt\ 2>&1\f[] to your
1657 command\-line) or upload the \f[C]\&.dump\f[] files you get when you add
1658 \f[C]\-\-write\-pages\f[] somewhere (https://gist.github.com/).
1659 .PP
1660 \f[B]Site support requests must contain an example URL\f[].
1661 An example URL is a URL you might want to download, like
1662 http://www.youtube.com/watch?v=BaW_jenozKc .
1663 There should be an obvious video present.
1664 Except under very special circumstances, the main page of a video
1665 service (e.g.
1666 http://www.youtube.com/ ) is \f[I]not\f[] an example URL.
1667 .SS Are you using the latest version?
1668 .PP
1669 Before reporting any issue, type \f[C]youtube\-dl\ \-U\f[].
1670 This should report that you\[aq]re up\-to\-date.
1671 About 20% of the reports we receive are already fixed, but people are
1672 using outdated versions.
1673 This goes for feature requests as well.
1674 .SS Is the issue already documented?
1675 .PP
1676 Make sure that someone has not already opened the issue you\[aq]re
1677 trying to open.
1678 Search at the top of the window or at
1679 https://github.com/rg3/youtube\-dl/search?type=Issues .
1680 If there is an issue, feel free to write something along the lines of
1681 "This affects me as well, with version 2015.01.01.
1682 Here is some more information on the issue: ...".
1683 While some issues may be old, a new post into them often spurs rapid
1684 activity.
1685 .SS Why are existing options not enough?
1686 .PP
1687 Before requesting a new feature, please have a quick peek at the list of
1688 supported
1689 options (https://github.com/rg3/youtube-dl/blob/master/README.md#synopsis).
1690 Many feature requests are for features that actually exist already!
1691 Please, absolutely do show off your work in the issue report and detail
1692 how the existing similar options do \f[I]not\f[] solve your problem.
1693 .SS Is there enough context in your bug report?
1694 .PP
1695 People want to solve problems, and often think they do us a favor by
1696 breaking down their larger problems (e.g.
1697 wanting to skip already downloaded files) to a specific request (e.g.
1698 requesting us to look whether the file exists before downloading the
1699 info page).
1700 However, what often happens is that they break down the problem into two
1701 steps: One simple, and one impossible (or extremely complicated one).
1702 .PP
1703 We are then presented with a very complicated request when the original
1704 problem could be solved far easier, e.g.
1705 by recording the downloaded video IDs in a separate file.
1706 To avoid this, you must include the greater context where it is
1707 non\-obvious.
1708 In particular, every feature request that does not consist of adding
1709 support for a new site should contain a use case scenario that explains
1710 in what situation the missing feature would be useful.
1711 .SS Does the issue involve one problem, and one problem only?
1712 .PP
1713 Some of our users seem to think there is a limit of issues they can or
1714 should open.
1715 There is no limit of issues they can or should open.
1716 While it may seem appealing to be able to dump all your issues into one
1717 ticket, that means that someone who solves one of your issues cannot
1718 mark the issue as closed.
1719 Typically, reporting a bunch of issues leads to the ticket lingering
1720 since nobody wants to attack that behemoth, until someone mercifully
1721 splits the issue into multiple ones.
1722 .PP
1723 In particular, every site support request issue should only pertain to
1724 services at one site (generally under a common domain, but always using
1725 the same backend technology).
1726 Do not request support for vimeo user videos, Whitehouse podcasts, and
1727 Google Plus pages in the same issue.
1728 Also, make sure that you don\[aq]t post bug reports alongside feature
1729 requests.
1730 As a rule of thumb, a feature request does not include outputs of
1731 youtube\-dl that are not immediately related to the feature at hand.
1732 Do not post reports of a network error alongside the request for a new
1733 video service.
1734 .SS Is anyone going to need the feature?
1735 .PP
1736 Only post features that you (or an incapacitated friend you can
1737 personally talk to) require.
1738 Do not post features because they seem like a good idea.
1739 If they are really useful, they will be requested by someone who
1740 requires them.
1741 .SS Is your question about youtube\-dl?
1742 .PP
1743 It may sound strange, but some bug reports we receive are completely
1744 unrelated to youtube\-dl and relate to a different or even the
1745 reporter\[aq]s own application.
1746 Please make sure that you are actually using youtube\-dl.
1747 If you are using a UI for youtube\-dl, report the bug to the maintainer
1748 of the actual application providing the UI.
1749 On the other hand, if your UI for youtube\-dl fails in some way you
1750 believe is related to youtube\-dl, by all means, go ahead and report the
1751 bug.
1752 .SH COPYRIGHT
1753 .PP
1754 youtube\-dl is released into the public domain by the copyright holders.
1755 .PP
1756 This README file was originally written by Daniel Bolton
1757 (<https://github.com/dbbolton>) and is likewise released into the public
1758 domain.