Compare commits
152 Commits
2011.09.13
...
2012.02.26
Author | SHA1 | Date | |
---|---|---|---|
c4105fa035 | |||
871dbd3c92 | |||
c9ed14e6d6 | |||
1ad85e5061 | |||
09fbc6c952 | |||
895ec266bb | |||
d85448f3bb | |||
99d46e8c27 | |||
4afdff39d7 | |||
661a807c65 | |||
6d58c4546e | |||
38ffbc0222 | |||
fefb166c52 | |||
dcb3c22e0b | |||
47a53c9e46 | |||
1413cd87eb | |||
c92e184f75 | |||
3906e6ce60 | |||
c7d3c3db0d | |||
d6639d05c2 | |||
633cf7cbad | |||
a5647b79ce | |||
ba5059dd66 | |||
bb8abbbbae | |||
561504fffa | |||
23e6b8adc8 | |||
3e0ea7d07a | |||
94fd3201b2 | |||
0b3f3e1ad9 | |||
a05d2a0c05 | |||
0b14e0b367 | |||
66e8777769 | |||
348486ced4 | |||
f1f300e629 | |||
dd17922afc | |||
40fd4cb86a | |||
9e9b75ae4d | |||
8abf76ddb9 | |||
c95da745bc | |||
0cd235eef6 | |||
77315556f1 | |||
c379c181e0 | |||
31a2ec2d88 | |||
b88a52504e | |||
a95567af99 | |||
849edab8ec | |||
b158a1d946 | |||
fa2672f9fc | |||
28e3614bc0 | |||
208e095f72 | |||
0ae7abe57c | |||
dc0a294a73 | |||
468c99257c | |||
af8e8d63f9 | |||
e092418d8b | |||
e33e3045c6 | |||
cb6568bf21 | |||
235b3ba479 | |||
5b3330e0cf | |||
aab771fbdf | |||
00f95a93f5 | |||
1724e7c461 | |||
3b98a5ddac | |||
8b59cc93d5 | |||
c3e4e7c182 | |||
38348005b3 | |||
208c4b9128 | |||
ec574c2c41 | |||
871be928a8 | |||
b20d4f8626 | |||
073d7a5985 | |||
40306424b1 | |||
ecb3bfe543 | |||
abeac45abe | |||
0fca93ac60 | |||
857e5f329a | |||
053419cd24 | |||
99e207bab0 | |||
0067bbe7a7 | |||
45aa690868 | |||
beb245e92f | |||
c424df0d2f | |||
87929e4b35 | |||
d76736fc5e | |||
0f9b77223e | |||
9f47175a40 | |||
a1a8713aad | |||
6501a06d46 | |||
8d89fbae5a | |||
7a2cf5455c | |||
7125a7ca8b | |||
54d47874f7 | |||
2761012f69 | |||
3de2a1e635 | |||
1eff9ac0c5 | |||
54f329fe93 | |||
9baa2ef53b | |||
6bde5972c3 | |||
36f6cb369b | |||
b845d58b04 | |||
efb113c736 | |||
3ce59dae88 | |||
f0b0caa3fa | |||
58384838c3 | |||
abb870d1ad | |||
daa982bc01 | |||
767414a292 | |||
7b417b388a | |||
44424ceee9 | |||
08a5b7f800 | |||
1cde6f1d52 | |||
2d8acd8039 | |||
67035ede49 | |||
eb6c37da43 | |||
2736595628 | |||
7b1a2bbe17 | |||
c25303c3d5 | |||
cc025e1226 | |||
eca1b76f01 | |||
366cbfb04a | |||
18bb3d1e35 | |||
10e7194db1 | |||
ef357c4bf2 | |||
5260e68f64 | |||
6a1ca41e17 | |||
c99dcbd2d6 | |||
da0db53a75 | |||
c52b01f326 | |||
36597dc40f | |||
9b4556c469 | |||
f3098c4d8a | |||
bdb3f7a769 | |||
afb5b55de6 | |||
c23cec29a3 | |||
e5b9fac281 | |||
08c1d0d3bc | |||
20e91e8375 | |||
f9c6878714 | |||
8c5dc3ad40 | |||
1d2e86aed9 | |||
a2f7e3a5bb | |||
f2a3a3522c | |||
b487ef0833 | |||
d0922f29a3 | |||
b90bcbe79e | |||
8236e85178 | |||
803abae206 | |||
50bdd8a9e7 | |||
34554a7ad4 | |||
18b7f87409 | |||
62a29bbf7b | |||
e26005adea |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
*.pyc
|
||||||
|
*.pyo
|
||||||
|
*~
|
@ -1 +1 @@
|
|||||||
2011.09.13
|
2012.02.26
|
||||||
|
17
Makefile
17
Makefile
@ -1,20 +1,23 @@
|
|||||||
default: update
|
default: update
|
||||||
|
|
||||||
update: update-readme update-latest
|
update: compile update-readme update-latest
|
||||||
|
|
||||||
update-latest:
|
update-latest:
|
||||||
./youtube-dl --version > LATEST_VERSION
|
./youtube-dl.dev --version > LATEST_VERSION
|
||||||
|
|
||||||
update-readme:
|
update-readme:
|
||||||
@options=$$(COLUMNS=80 ./youtube-dl --help | sed -e '1,/.*General Options.*/ d' -e 's/^\W\{2\}\(\w\)/### \1/') && \
|
@options=$$(COLUMNS=80 ./youtube-dl.dev --help | sed -e '1,/.*General Options.*/ d' -e 's/^\W\{2\}\(\w\)/### \1/') && \
|
||||||
header=$$(sed -e '/.*## OPTIONS/,$$ d' README.md) && \
|
header=$$(sed -e '/.*## OPTIONS/,$$ d' README.md) && \
|
||||||
footer=$$(sed -e '1,/.*## FAQ/ d' README.md) && \
|
footer=$$(sed -e '1,/.*## FAQ/ d' README.md) && \
|
||||||
echo "$${header}" > README.md && \
|
echo "$${header}" > README.md && \
|
||||||
echo -e '\n## OPTIONS' >> README.md && \
|
echo >> README.md && \
|
||||||
|
echo '## OPTIONS' >> README.md && \
|
||||||
echo "$${options}" >> README.md&& \
|
echo "$${options}" >> README.md&& \
|
||||||
echo -e '\n## FAQ' >> README.md && \
|
echo >> README.md && \
|
||||||
|
echo '## FAQ' >> README.md && \
|
||||||
echo "$${footer}" >> README.md
|
echo "$${footer}" >> README.md
|
||||||
|
|
||||||
|
compile:
|
||||||
|
cp youtube_dl/__init__.py youtube-dl
|
||||||
|
|
||||||
|
.PHONY: default compile update update-latest update-readme
|
||||||
.PHONY: default update update-latest update-readme
|
|
||||||
|
56
README.md
56
README.md
@ -1,7 +1,7 @@
|
|||||||
# youtube-dl
|
# youtube-dl
|
||||||
|
|
||||||
## USAGE
|
## USAGE
|
||||||
youtube-dl [OPTIONS] URL
|
youtube-dl [options] url [url...]
|
||||||
|
|
||||||
## DESCRIPTION
|
## DESCRIPTION
|
||||||
**youtube-dl** is a small command-line program to download videos from
|
**youtube-dl** is a small command-line program to download videos from
|
||||||
@ -12,24 +12,41 @@ which means you can modify it, redistribute it or use it however you like.
|
|||||||
|
|
||||||
## OPTIONS
|
## OPTIONS
|
||||||
-h, --help print this help text and exit
|
-h, --help print this help text and exit
|
||||||
-v, --version print program version and exit
|
--version print program version and exit
|
||||||
-U, --update update this program to latest version
|
-U, --update update this program to latest version
|
||||||
-i, --ignore-errors continue on download errors
|
-i, --ignore-errors continue on download errors
|
||||||
-r, --rate-limit LIMIT download rate limit (e.g. 50k or 44.6m)
|
-r, --rate-limit LIMIT download rate limit (e.g. 50k or 44.6m)
|
||||||
-R, --retries RETRIES number of retries (default is 10)
|
-R, --retries RETRIES number of retries (default is 10)
|
||||||
|
--dump-user-agent display the current browser identification
|
||||||
|
--list-extractors List all supported extractors and the URLs they
|
||||||
|
would handle
|
||||||
|
|
||||||
|
### Video Selection:
|
||||||
--playlist-start NUMBER playlist video to start at (default is 1)
|
--playlist-start NUMBER playlist video to start at (default is 1)
|
||||||
--playlist-end NUMBER playlist video to end at (default is last)
|
--playlist-end NUMBER playlist video to end at (default is last)
|
||||||
--dump-user-agent display the current browser identification
|
--match-title REGEX download only matching titles (regex or caseless
|
||||||
|
sub-string)
|
||||||
|
--reject-title REGEX skip download for matching titles (regex or
|
||||||
|
caseless sub-string)
|
||||||
|
--max-downloads NUMBER Abort after downloading NUMBER files
|
||||||
|
|
||||||
### Filesystem Options:
|
### Filesystem Options:
|
||||||
-t, --title use title in file name
|
-t, --title use title in file name
|
||||||
-l, --literal use literal title in file name
|
-l, --literal use literal title in file name
|
||||||
-A, --auto-number number downloaded files starting from 00000
|
-A, --auto-number number downloaded files starting from 00000
|
||||||
-o, --output TEMPLATE output filename template
|
-o, --output TEMPLATE output filename template. Use %(stitle)s to get the
|
||||||
|
title, %(uploader)s for the uploader name,
|
||||||
|
%(autonumber)s to get an automatically incremented
|
||||||
|
number, %(ext)s for the filename extension,
|
||||||
|
%(upload_date)s for the upload date (YYYYMMDD), and
|
||||||
|
%% for a literal percent. Use - to output to
|
||||||
|
stdout.
|
||||||
-a, --batch-file FILE file containing URLs to download ('-' for stdin)
|
-a, --batch-file FILE file containing URLs to download ('-' for stdin)
|
||||||
-w, --no-overwrites do not overwrite files
|
-w, --no-overwrites do not overwrite files
|
||||||
-c, --continue resume partially downloaded files
|
-c, --continue resume partially downloaded files
|
||||||
--cookies FILE file to dump cookie jar to
|
--no-continue do not resume partially downloaded files (restart
|
||||||
|
from beginning)
|
||||||
|
--cookies FILE file to read cookies from and dump cookie jar in
|
||||||
--no-part do not use .part files
|
--no-part do not use .part files
|
||||||
--no-mtime do not use the Last-modified header to set the file
|
--no-mtime do not use the Last-modified header to set the file
|
||||||
modification time
|
modification time
|
||||||
@ -38,19 +55,26 @@ which means you can modify it, redistribute it or use it however you like.
|
|||||||
|
|
||||||
### Verbosity / Simulation Options:
|
### Verbosity / Simulation Options:
|
||||||
-q, --quiet activates quiet mode
|
-q, --quiet activates quiet mode
|
||||||
-s, --simulate do not download video
|
-s, --simulate do not download the video and do not write anything
|
||||||
|
to disk
|
||||||
|
--skip-download do not download the video
|
||||||
-g, --get-url simulate, quiet but print URL
|
-g, --get-url simulate, quiet but print URL
|
||||||
-e, --get-title simulate, quiet but print title
|
-e, --get-title simulate, quiet but print title
|
||||||
--get-thumbnail simulate, quiet but print thumbnail URL
|
--get-thumbnail simulate, quiet but print thumbnail URL
|
||||||
--get-description simulate, quiet but print video description
|
--get-description simulate, quiet but print video description
|
||||||
--get-filename simulate, quiet but print output filename
|
--get-filename simulate, quiet but print output filename
|
||||||
|
--get-format simulate, quiet but print output format
|
||||||
--no-progress do not print progress bar
|
--no-progress do not print progress bar
|
||||||
--console-title display progress in console titlebar
|
--console-title display progress in console titlebar
|
||||||
|
-v, --verbose print various debugging information
|
||||||
|
|
||||||
### Video Format Options:
|
### Video Format Options:
|
||||||
-f, --format FORMAT video format code
|
-f, --format FORMAT video format code
|
||||||
--all-formats download all available video formats
|
--all-formats download all available video formats
|
||||||
|
--prefer-free-formats prefer free video formats unless a specific one is
|
||||||
|
requested
|
||||||
--max-quality FORMAT highest quality format to download
|
--max-quality FORMAT highest quality format to download
|
||||||
|
-F, --list-formats list all available formats (currently youtube only)
|
||||||
|
|
||||||
### Authentication Options:
|
### Authentication Options:
|
||||||
-u, --username USERNAME account username
|
-u, --username USERNAME account username
|
||||||
@ -60,7 +84,11 @@ which means you can modify it, redistribute it or use it however you like.
|
|||||||
### Post-processing Options:
|
### Post-processing Options:
|
||||||
--extract-audio convert video files to audio-only files (requires
|
--extract-audio convert video files to audio-only files (requires
|
||||||
ffmpeg and ffprobe)
|
ffmpeg and ffprobe)
|
||||||
--audio-format FORMAT "best", "aac" or "mp3"; best by default
|
--audio-format FORMAT "best", "aac", "vorbis", "mp3", "m4a", or "wav";
|
||||||
|
best by default
|
||||||
|
--audio-quality QUALITY ffmpeg audio bitrate specification, 128k by default
|
||||||
|
-k, --keep-video keeps the video file on disk after the post-
|
||||||
|
processing; the video is erased by default
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
@ -68,9 +96,9 @@ which means you can modify it, redistribute it or use it however you like.
|
|||||||
|
|
||||||
Most people asking this question are not aware that youtube-dl now defaults to downloading the highest available quality as reported by YouTube, which will be 1080p or 720p in some cases, so you no longer need the -b option. For some specific videos, maybe YouTube does not report them to be available in a specific high quality format you''re interested in. In that case, simply request it with the -f option and youtube-dl will try to download it.
|
Most people asking this question are not aware that youtube-dl now defaults to downloading the highest available quality as reported by YouTube, which will be 1080p or 720p in some cases, so you no longer need the -b option. For some specific videos, maybe YouTube does not report them to be available in a specific high quality format you''re interested in. In that case, simply request it with the -f option and youtube-dl will try to download it.
|
||||||
|
|
||||||
### I get HTTP error 402 when trying to download a video. What''s this?
|
### I get HTTP error 402 when trying to download a video. What's this?
|
||||||
|
|
||||||
Apparently YouTube requires you to pass a CAPTCHA test if you download too much. We''re [considering to provide a way to let you solve the CAPTCHA](https://github.com/phihag/youtube-dl/issues/8), but at the moment, your best course of action is pointing a webbrowser to the youtube URL, solving the CAPTCHA, and restart youtube-dl.
|
Apparently YouTube requires you to pass a CAPTCHA test if you download too much. We''re [considering to provide a way to let you solve the CAPTCHA](https://github.com/rg3/youtube-dl/issues/154), but at the moment, your best course of action is pointing a webbrowser to the youtube URL, solving the CAPTCHA, and restart youtube-dl.
|
||||||
|
|
||||||
### I have downloaded a video but how can I play it?
|
### I have downloaded a video but how can I play it?
|
||||||
|
|
||||||
@ -85,14 +113,14 @@ The URLs youtube-dl outputs require the downloader to have the correct cookies.
|
|||||||
youtube has switched to a new video info format in July 2011 which is not supported by old versions of youtube-dl. You can update youtube-dl with `sudo youtube-dl --update`.
|
youtube has switched to a new video info format in July 2011 which is not supported by old versions of youtube-dl. You can update youtube-dl with `sudo youtube-dl --update`.
|
||||||
|
|
||||||
## COPYRIGHT
|
## COPYRIGHT
|
||||||
**youtube-dl**: Copyright © 2006-2011 Ricardo Garcia Gonzalez. The program is
|
|
||||||
released into the public domain by the copyright holder. This README file was
|
youtube-dl is released into the public domain by the copyright holders.
|
||||||
originally written by Daniel Bolton (<https://github.com/dbbolton>) and is
|
|
||||||
likewise released into the public domain.
|
This README file was originally written by Daniel Bolton (<https://github.com/dbbolton>) and is likewise released into the public domain.
|
||||||
|
|
||||||
## BUGS
|
## BUGS
|
||||||
|
|
||||||
Bugs and suggestions should be reported at: <https://github.com/phihag/youtube-dl/issues>
|
Bugs and suggestions should be reported at: <https://github.com/rg3/youtube-dl/issues>
|
||||||
|
|
||||||
Please include:
|
Please include:
|
||||||
|
|
||||||
|
6
devscripts/posix-locale.sh
Normal file
6
devscripts/posix-locale.sh
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
# source this file in your shell to get a POSIX locale (which will break many programs, but that's kind of the point)
|
||||||
|
|
||||||
|
export LC_ALL=POSIX
|
||||||
|
export LANG=POSIX
|
||||||
|
export LANGUAGE=POSIX
|
29
test/test_div.py
Normal file
29
test/test_div.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Various small unit tests
|
||||||
|
|
||||||
|
import os,sys
|
||||||
|
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
||||||
|
import youtube_dl
|
||||||
|
|
||||||
|
def test_simplify_title():
|
||||||
|
assert youtube_dl._simplify_title(u'abc') == u'abc'
|
||||||
|
assert youtube_dl._simplify_title(u'abc_d-e') == u'abc_d-e'
|
||||||
|
|
||||||
|
assert youtube_dl._simplify_title(u'123') == u'123'
|
||||||
|
|
||||||
|
assert u'/' not in youtube_dl._simplify_title(u'abc/de')
|
||||||
|
assert u'abc' in youtube_dl._simplify_title(u'abc/de')
|
||||||
|
assert u'de' in youtube_dl._simplify_title(u'abc/de')
|
||||||
|
assert u'/' not in youtube_dl._simplify_title(u'abc/de///')
|
||||||
|
|
||||||
|
assert u'\\' not in youtube_dl._simplify_title(u'abc\\de')
|
||||||
|
assert u'abc' in youtube_dl._simplify_title(u'abc\\de')
|
||||||
|
assert u'de' in youtube_dl._simplify_title(u'abc\\de')
|
||||||
|
|
||||||
|
assert youtube_dl._simplify_title(u'ä') == u'ä'
|
||||||
|
assert youtube_dl._simplify_title(u'кириллица') == u'кириллица'
|
||||||
|
|
||||||
|
# Strip underlines
|
||||||
|
assert youtube_dl._simplify_title(u'\'a_') == u'a'
|
1636
youtube-dl
1636
youtube-dl
File diff suppressed because it is too large
Load Diff
6
youtube-dl.dev
Executable file
6
youtube-dl.dev
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import youtube_dl
|
||||||
|
|
||||||
|
youtube_dl.main()
|
4648
youtube_dl/__init__.py
Executable file
4648
youtube_dl/__init__.py
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user