From ef0c08cdfe05295f7dc5b164f187e2359970cde1 Mon Sep 17 00:00:00 2001 From: joehillen Date: Sun, 22 Jul 2012 13:36:22 -0700 Subject: [PATCH 1/7] Added install target to Makefile. --- Makefile | 5 ++++- youtube-dl | Bin 40554 -> 40604 bytes 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e2da02e96..0de669c12 100644 --- a/Makefile +++ b/Makefile @@ -23,4 +23,7 @@ compile: cat youtube-dl.zip >> youtube-dl rm youtube-dl.zip -.PHONY: default compile update update-latest update-readme +install: youtube-dl + install -m 755 --owner root --group root youtube-dl /usr/local/bin/ + +.PHONY: default compile update update-latest update-readme install diff --git a/youtube-dl b/youtube-dl index b3e0cd4221b302881fc5ad75746dd5fc9ad0c7fd..0a59de83b7ee43b69175850e6ed2714b38c7937c 100755 GIT binary patch delta 3919 zcmZXXcQ734{>E2Uj}~EB8!b9fca^Y+PKa0~qD0xO)w}3yWOYlFNW|R`J&5R5XSIls zjovw|8b=Qjhq!WP?wR|$zjx-DdFT0lpLu59_pi^l)+_k7E2(_IGWX*&0TG(FNCuNj zRU@{znJ%q6&|zctX+r=27MXFE=f;1=wVpgcHB6(lk~vwhmzg7jMW_AD)gut-KiH?1 zxT@^6ggN~BOq5O}c|_{Xa|Q9DM-$OzbjXs?I?n)W_7*Gj(Eu9lz%tTF*fUXC0wdyg z`i3z~@jBDT)E{s8N6FBNMB()q_bqPOG&@iNwOv}7?yd9Lu;+-U{2c$%_Bp`4!! zq|DW|%jGmuY&lxdJK!t@2~?Dxb($H=tbJPI?(3J`feAioUq6i*>bqq< ziTNu~*3bsOJ`+laa)^3PFe-)*_=7748JUp|ohmLX2QiV8SlrLMW1cdfSmu`=a}xJu zHk=I+Ba5wJFPAFLlY@OS!`k2JQo$WOa8VnPo?7d&iC zl7-(WTJnw`zDypZ0r$TC@rXWwq2<`Rp>klGBx&ztA3bPfNv4`3@b~kJD8IBnn^I7g1O^>c>1-qMhU7=q@ex80W zhgw4o9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---- README.md | 31 ++++---- youtube-dl.1 | 192 +++++++++++++++++++++++++++++++++++++++++++++++++ youtube-dl.dev | 6 -- youtube-dl.exe | Bin 3989787 -> 3989787 bytes 5 files changed, 226 insertions(+), 32 deletions(-) create mode 100644 youtube-dl.1 delete mode 100755 youtube-dl.dev diff --git a/Makefile b/Makefile index 0de669c12..c31850a55 100644 --- a/Makefile +++ b/Makefile @@ -1,29 +1,34 @@ -default: update - -update: compile update-readme update-latest +all: compile exe readme man-page update-latest update-latest: - ./youtube-dl.dev --version > LATEST_VERSION + ./youtube-dl --version > LATEST_VERSION -update-readme: - @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) && \ - footer=$$(sed -e '1,/.*## FAQ/ d' README.md) && \ +readme: + @options=$$(COLUMNS=80 ./youtube-dl --help | sed -e '1,/.*General Options.*/ d' -e 's/^\W\{2\}\(\w\)/## \1/') && \ + header=$$(sed -e '/.*# OPTIONS/,$$ d' README.md) && \ + footer=$$(sed -e '1,/.*# FAQ/ d' README.md) && \ echo "$${header}" > README.md && \ echo >> README.md && \ - echo '## OPTIONS' >> README.md && \ + echo '# OPTIONS' >> README.md && \ echo "$${options}" >> README.md&& \ echo >> README.md && \ - echo '## FAQ' >> README.md && \ + echo '# FAQ' >> README.md && \ echo "$${footer}" >> README.md +man-page: + pandoc -s -w man README.md -o youtube-dl.1 + compile: zip --quiet --junk-paths youtube-dl youtube_dl/*.py echo '#!/usr/bin/env python' > youtube-dl cat youtube-dl.zip >> youtube-dl rm youtube-dl.zip -install: youtube-dl +exe: + bash devscripts/wine-py2exe.sh build_exe.py + +install: install -m 755 --owner root --group root youtube-dl /usr/local/bin/ + install -m 644 --owner root --group root youtube-dl.1 /usr/local/man/man1 -.PHONY: default compile update update-latest update-readme install +.PHONY: all update-latest readme man-page compile exe install \ No newline at end of file diff --git a/README.md b/README.md index f04b96128..05f437db9 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,19 @@ -# youtube-dl +% youtube-dl(1) -## USAGE -youtube-dl [options] url [url...] +# NAME +youtube-dl -## DESCRIPTION +# SYNOPSIS +**youtube-dl** [OPTIONS] URL [URL...] + +# DESCRIPTION **youtube-dl** is a small command-line program to download videos from YouTube.com and a few more sites. It requires the Python interpreter, version 2.x (x being at least 6), and it is not platform specific. It should work in your Unix box, in Windows or in Mac OS X. It is released to the public domain, which means you can modify it, redistribute it or use it however you like. -## OPTIONS +# OPTIONS -h, --help print this help text and exit --version print program version and exit -U, --update update this program to latest version @@ -21,7 +24,7 @@ which means you can modify it, redistribute it or use it however you like. --list-extractors List all supported extractors and the URLs they would handle -### Video Selection: +## Video Selection: --playlist-start NUMBER playlist video to start at (default is 1) --playlist-end NUMBER playlist video to end at (default is last) --match-title REGEX download only matching titles (regex or caseless @@ -30,7 +33,7 @@ which means you can modify it, redistribute it or use it however you like. caseless sub-string) --max-downloads NUMBER Abort after downloading NUMBER files -### Filesystem Options: +## Filesystem Options: -t, --title use title in file name -l, --literal use literal title in file name -A, --auto-number number downloaded files starting from 00000 @@ -53,7 +56,7 @@ which means you can modify it, redistribute it or use it however you like. --write-description write video description to a .description file --write-info-json write video metadata to a .info.json file -### Verbosity / Simulation Options: +## Verbosity / Simulation Options: -q, --quiet activates quiet mode -s, --simulate do not download the video and do not write anything to disk @@ -68,7 +71,7 @@ which means you can modify it, redistribute it or use it however you like. --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 --all-formats download all available video formats --prefer-free-formats prefer free video formats unless a specific one is @@ -80,12 +83,12 @@ which means you can modify it, redistribute it or use it however you like. --srt-lang LANG language of the closed captions to download (optional) use IETF language tags like 'en' -### Authentication Options: +## Authentication Options: -u, --username USERNAME account username -p, --password PASSWORD account password -n, --netrc use .netrc authentication data -### Post-processing Options: +## Post-processing Options: --extract-audio convert video files to audio-only files (requires ffmpeg or avconv and ffprobe or avprobe) --audio-format FORMAT "best", "aac", "vorbis", "mp3", "m4a", or "wav"; @@ -95,7 +98,7 @@ which means you can modify it, redistribute it or use it however you like. -k, --keep-video keeps the video file on disk after the post- processing; the video is erased by default -## FAQ +# FAQ ### Can you please put the -b option back? @@ -117,13 +120,13 @@ 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`. -## COPYRIGHT +# COPYRIGHT youtube-dl is released into the public domain by the copyright holders. This README file was originally written by Daniel Bolton () and is likewise released into the public domain. -## BUGS +# BUGS Bugs and suggestions should be reported at: diff --git a/youtube-dl.1 b/youtube-dl.1 new file mode 100644 index 000000000..09bb843f4 --- /dev/null +++ b/youtube-dl.1 @@ -0,0 +1,192 @@ +.TH youtube-dl 1 "" +.SH NAME +.PP +youtube-dl +.SH SYNOPSIS +.PP +\f[B]youtube-dl\f[] [OPTIONS] URL [URL...] +.SH DESCRIPTION +.PP +\f[B]youtube-dl\f[] is a small command-line program to download videos +from YouTube.com and a few more sites. +It requires the Python interpreter, version 2.x (x being at least 6), +and it is not platform specific. +It should work in your Unix box, in Windows or in Mac OS X. +It is released to the public domain, which means you can modify it, +redistribute it or use it however you like. +.SH OPTIONS +.IP +.nf +\f[C] +-h,\ --help\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ print\ this\ help\ text\ and\ exit +--version\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ print\ program\ version\ and\ exit +-U,\ --update\ \ \ \ \ \ \ \ \ \ \ \ \ update\ this\ program\ to\ latest\ version +-i,\ --ignore-errors\ \ \ \ \ \ continue\ on\ download\ errors +-r,\ --rate-limit\ LIMIT\ \ \ download\ rate\ limit\ (e.g.\ 50k\ or\ 44.6m) +-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 +\f[] +.fi +.SS Video Selection: +.IP +.nf +\f[C] +--playlist-start\ NUMBER\ \ playlist\ video\ to\ start\ at\ (default\ is\ 1) +--playlist-end\ NUMBER\ \ \ \ playlist\ video\ to\ end\ at\ (default\ is\ last) +--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 +\f[] +.fi +.SS Filesystem Options: +.IP +.nf +\f[C] +-t,\ --title\ \ \ \ \ \ \ \ \ \ \ \ \ \ use\ title\ in\ file\ name +-l,\ --literal\ \ \ \ \ \ \ \ \ \ \ \ use\ literal\ title\ in\ file\ name +-A,\ --auto-number\ \ \ \ \ \ \ \ number\ downloaded\ files\ starting\ from\ 00000 +-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\ (\[aq]-\[aq]\ for\ stdin) +-w,\ --no-overwrites\ \ \ \ \ \ do\ not\ overwrite\ files +-c,\ --continue\ \ \ \ \ \ \ \ \ \ \ resume\ partially\ downloaded\ files +--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-mtime\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ use\ the\ Last-modified\ header\ to\ set\ the\ file +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ modification\ time +--write-description\ \ \ \ \ \ write\ video\ description\ to\ a\ .description\ file +--write-info-json\ \ \ \ \ \ \ \ write\ video\ metadata\ to\ a\ .info.json\ file +\f[] +.fi +.SS Verbosity / Simulation Options: +.IP +.nf +\f[C] +-q,\ --quiet\ \ \ \ \ \ \ \ \ \ \ \ \ \ activates\ quiet\ mode +-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 +-e,\ --get-title\ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ title +--get-thumbnail\ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ thumbnail\ URL +--get-description\ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ video\ description +--get-filename\ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ output\ filename +--get-format\ \ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ output\ format +--no-progress\ \ \ \ \ \ \ \ \ \ \ \ do\ not\ print\ progress\ bar +--console-title\ \ \ \ \ \ \ \ \ \ display\ progress\ in\ console\ titlebar +-v,\ --verbose\ \ \ \ \ \ \ \ \ \ \ \ print\ various\ debugging\ information +\f[] +.fi +.SS Video Format Options: +.IP +.nf +\f[C] +-f,\ --format\ FORMAT\ \ \ \ \ \ video\ format\ code +--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 +-F,\ --list-formats\ \ \ \ \ \ \ list\ all\ available\ formats\ (currently\ youtube\ only) +--write-srt\ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ video\ closed\ captions\ to\ a\ .srt\ file +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (currently\ youtube\ only) +--srt-lang\ LANG\ \ \ \ \ \ \ \ \ \ language\ of\ the\ closed\ captions\ to\ download +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (optional)\ use\ IETF\ language\ tags\ like\ \[aq]en\[aq] +\f[] +.fi +.SS Authentication Options: +.IP +.nf +\f[C] +-u,\ --username\ USERNAME\ \ account\ username +-p,\ --password\ PASSWORD\ \ account\ password +-n,\ --netrc\ \ \ \ \ \ \ \ \ \ \ \ \ \ use\ .netrc\ authentication\ data +\f[] +.fi +.SS Post-processing Options: +.IP +.nf +\f[C] +--extract-audio\ \ \ \ \ \ \ \ \ \ convert\ video\ files\ to\ audio-only\ files\ (requires +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ffmpeg\ or\ avconv\ and\ ffprobe\ or\ avprobe) +--audio-format\ FORMAT\ \ \ \ "best",\ "aac",\ "vorbis",\ "mp3",\ "m4a",\ or\ "wav"; +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ best\ by\ default +--audio-quality\ QUALITY\ \ ffmpeg/avconv\ 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 +\f[] +.fi +.SH FAQ +.SS Can you please put the -b option back? +.PP +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\[aq]\[aq]re interested +in. +In that case, simply request it with the -f option and youtube-dl will +try to download it. +.SS I get HTTP error 402 when trying to download a video. What\[aq]s +this? +.PP +Apparently YouTube requires you to pass a CAPTCHA test if you download +too much. +We\[aq]\[aq]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. +.SS I have downloaded a video but how can I play it? +.PP +Once the video is fully downloaded, use any video player, such as +vlc (http://www.videolan.org) or mplayer (http://www.mplayerhq.hu/). +.SS The links provided by youtube-dl -g are not working anymore +.PP +The URLs youtube-dl outputs require the downloader to have the correct +cookies. +Use the \f[C]--cookies\f[] option to write the required cookies into a +file, and advise your downloader to read cookies from that file. +Some sites also require a common user agent to be used, use +\f[C]--dump-user-agent\f[] to see the one in use by youtube-dl. +.SS ERROR: no fmt_url_map or conn information found in video info +.PP +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 \f[C]sudo\ youtube-dl\ --update\f[]. +.SH COPYRIGHT +.PP +youtube-dl is released into the public domain by the copyright holders. +.PP +This README file was originally written by Daniel Bolton +() and is likewise released into the public +domain. +.SH BUGS +.PP +Bugs and suggestions should be reported at: + +.PP +Please include: +.IP \[bu] 2 +Your exact command line, like +\f[C]youtube-dl\ -t\ "http://www.youtube.com/watch?v=uHlDtZ6Oc3s&feature=channel_video_title"\f[]. +A common mistake is not to escape the \f[C]&\f[]. +Putting URLs in quotes should solve this problem. +.IP \[bu] 2 +The output of \f[C]youtube-dl\ --version\f[] +.IP \[bu] 2 +The output of \f[C]python\ --version\f[] +.IP \[bu] 2 +The name and version of your Operating System ("Ubuntu 11.04 x64" or +"Windows 7 x64" is usually enough). diff --git a/youtube-dl.dev b/youtube-dl.dev deleted file mode 100755 index 473b7f42d..000000000 --- a/youtube-dl.dev +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import youtube_dl - -youtube_dl.main() diff --git a/youtube-dl.exe b/youtube-dl.exe index 2aa052ccf569ae513f627910c18e55675effe844..b3016aeb678171271710d313df1f739e3187b8c7 100755 GIT binary patch delta 5829 zcmX|_cU%kzR~ z6$KO(78OJgL}`K`pcF+#qlqy-3mOyiE_2VBKkn!A{haeV<(_+IWW^HRHf4qSx(~zecB(^c7-sKQyZAFKKBZpb#&Af1y2P8I zbA$Sk7sK`^>Nx_#&vlwI&<2NUUUy>FKH-`(P~w+QHL1|Uo++CBdM4<%NfQT~uidGM z9?7hu8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nqG?D!=<>($E7&6z%u$i zmm_AE(XWS031#%FAX9T0eP7Ddy&S!tlw-seg^J4Q*F)C5Rct{O^cyMLW>?_sk5*vp zU4?wF2)&tZ%oX~S$q_$ap-+@d6$*8#MBB(p%(AW$J3Uv4{k^Kh)9PPEzqE3es4CPQ zQ|Mt8_UC^UVqP>OmcS}HV|5evUzn_BDoHe zG}qyVy49m?Y(3hx*5e2+DP(;eGY`Cu?L}QjUAp3Zpm=-Tz=vY`4Ls=h8+c9cD7JtG zv`tqiu>lYDUIUJRYs4&HG-A*D8u4n>HexSsO*q`)O=w%$ggQ$TUaOZ)__7e1k=8Zi QBU9WAkBr6Trr>J*4?*|G?f?J) From ce7b2a40d04de1eadd5b81910ad374fee8db268d Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Wed, 1 Aug 2012 17:26:50 +0200 Subject: [PATCH 3/7] added automatically generated bash-completion; closes #191 --- Makefile | 10 ++++++++-- youtube-dl.bash-completion | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 youtube-dl.bash-completion diff --git a/Makefile b/Makefile index c31850a55..da9103cd2 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -all: compile exe readme man-page update-latest +all: compile exe readme man-page bash-completion update-latest update-latest: ./youtube-dl --version > LATEST_VERSION @@ -18,6 +18,11 @@ readme: man-page: pandoc -s -w man README.md -o youtube-dl.1 +bash-completion: + @options=`egrep -o '(--[a-z-]+) ' README.md | sort -u | xargs echo` && \ + content=`sed "s/opts=\"[^\"]*\"/opts=\"$${options}\"/g" youtube-dl.bash-completion` && \ + echo "$${content}" > youtube-dl.bash-completion + compile: zip --quiet --junk-paths youtube-dl youtube_dl/*.py echo '#!/usr/bin/env python' > youtube-dl @@ -30,5 +35,6 @@ exe: install: install -m 755 --owner root --group root youtube-dl /usr/local/bin/ install -m 644 --owner root --group root youtube-dl.1 /usr/local/man/man1 + install -m 644 --owner root --group root youtube-dl.bash-completion /etc/bash_completion.d/youtube-dl -.PHONY: all update-latest readme man-page compile exe install \ No newline at end of file +.PHONY: all update-latest readme man-page bash-completion compile exe install \ No newline at end of file diff --git a/youtube-dl.bash-completion b/youtube-dl.bash-completion new file mode 100644 index 000000000..8704d0fd3 --- /dev/null +++ b/youtube-dl.bash-completion @@ -0,0 +1,14 @@ +__youtube-dl() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + opts="--all-formats --audio-format --audio-quality --auto-number --batch-file --console-title --continue --cookies --dump-user-agent --extract-audio --format --get-description --get-filename --get-format --get-thumbnail --get-title --get-url --help --ignore-errors --keep-video --list-extractors --list-formats --literal --match-title --max-downloads --max-quality --netrc --no-continue --no-mtime --no-overwrites --no-part --no-progress --output --password --playlist-end --playlist-start --prefer-free-formats --quiet --rate-limit --reject-title --retries --simulate --skip-download --srt-lang --title --update --username --verbose --version --write-description --write-info-json --write-srt" + + if [[ ${cur} == * ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + fi +} + +complete -F __youtube-dl youtube-dl From 7a7c093ab011ea94de52d90500cb90c7a39ea0a2 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Wed, 1 Aug 2012 18:40:27 +0200 Subject: [PATCH 4/7] added one-step realese script 'make release version=nn' - closes #158 --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index da9103cd2..ea1efe075 100644 --- a/Makefile +++ b/Makefile @@ -37,4 +37,14 @@ install: install -m 644 --owner root --group root youtube-dl.1 /usr/local/man/man1 install -m 644 --owner root --group root youtube-dl.bash-completion /etc/bash_completion.d/youtube-dl -.PHONY: all update-latest readme man-page bash-completion compile exe install \ No newline at end of file +release: + @if [ -z "$$version" ]; then echo 'ERROR: specify version number like this: make release version=1994.09.06'; exit 1; fi + @if [ ! -z "`git tag | grep "$$version"`" ]; then echo 'ERROR: version already present'; exit 1; fi + @if [ ! -z "`git status --porcelain`" ]; then echo 'ERROR: the working directory is not clean; commit or stash changes'; exit 1; fi + @sed -i "s/__version__ = '.*'/__version__ = '$$version'/" youtube_dl/__init__.py + make all + git add -A + git commit -m "release $$version" + git tag -m "Release $$version" "$$version" + +.PHONY: all update-latest readme man-page bash-completion compile exe install release From dce1088450becaa95e7fcaea2c70e8965b142a69 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 3 Aug 2012 20:10:54 +0200 Subject: [PATCH 5/7] A more "make-esque" Makefile with file targets and dependencies --- Makefile | 62 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index ea1efe075..26c85b578 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,32 @@ -all: compile exe readme man-page bash-completion update-latest +all: youtube-dl youtube-dl.exe README.md youtube-dl.1 youtube-dl.bash-completion LATEST_VERSION -update-latest: - ./youtube-dl --version > LATEST_VERSION +install: youtube-dl youtube-dl.1 youtube-dl.bash-completion + install -m 755 --owner root --group root youtube-dl /usr/local/bin/ + install -m 644 --owner root --group root youtube-dl.1 /usr/local/man/man1 + install -m 644 --owner root --group root youtube-dl.bash-completion /etc/bash_completion.d/youtube-dl + +release: + @if [ -z "$$version" ]; then echo 'ERROR: specify version number like this: make release version=1994.09.06'; exit 1; fi + @if [ ! -z "`git tag | grep "$$version"`" ]; then echo 'ERROR: version already present'; exit 1; fi + @if [ ! -z "`git status --porcelain`" ]; then echo 'ERROR: the working directory is not clean; commit or stash changes'; exit 1; fi + @sed -i "s/__version__ = '.*'/__version__ = '$$version'/" youtube_dl/__init__.py + make all + git add -A + git commit -m "release $$version" + git tag -m "Release $$version" "$$version" + +.PHONY: all install release + +youtube-dl: youtube_dl/*.py + zip --quiet --junk-paths youtube-dl youtube_dl/*.py + echo '#!/usr/bin/env python' > youtube-dl + cat youtube-dl.zip >> youtube-dl + rm youtube-dl.zip + +youtube-dl.exe: youtube_dl/*.py + bash devscripts/wine-py2exe.sh build_exe.py -readme: +README.md: youtube-dl @options=$$(COLUMNS=80 ./youtube-dl --help | sed -e '1,/.*General Options.*/ d' -e 's/^\W\{2\}\(\w\)/## \1/') && \ header=$$(sed -e '/.*# OPTIONS/,$$ d' README.md) && \ footer=$$(sed -e '1,/.*# FAQ/ d' README.md) && \ @@ -15,36 +38,13 @@ readme: echo '# FAQ' >> README.md && \ echo "$${footer}" >> README.md -man-page: +youtube-dl.1: README.md pandoc -s -w man README.md -o youtube-dl.1 -bash-completion: +youtube-dl.bash-completion: README.md @options=`egrep -o '(--[a-z-]+) ' README.md | sort -u | xargs echo` && \ content=`sed "s/opts=\"[^\"]*\"/opts=\"$${options}\"/g" youtube-dl.bash-completion` && \ echo "$${content}" > youtube-dl.bash-completion -compile: - zip --quiet --junk-paths youtube-dl youtube_dl/*.py - echo '#!/usr/bin/env python' > youtube-dl - cat youtube-dl.zip >> youtube-dl - rm youtube-dl.zip - -exe: - bash devscripts/wine-py2exe.sh build_exe.py - -install: - install -m 755 --owner root --group root youtube-dl /usr/local/bin/ - install -m 644 --owner root --group root youtube-dl.1 /usr/local/man/man1 - install -m 644 --owner root --group root youtube-dl.bash-completion /etc/bash_completion.d/youtube-dl - -release: - @if [ -z "$$version" ]; then echo 'ERROR: specify version number like this: make release version=1994.09.06'; exit 1; fi - @if [ ! -z "`git tag | grep "$$version"`" ]; then echo 'ERROR: version already present'; exit 1; fi - @if [ ! -z "`git status --porcelain`" ]; then echo 'ERROR: the working directory is not clean; commit or stash changes'; exit 1; fi - @sed -i "s/__version__ = '.*'/__version__ = '$$version'/" youtube_dl/__init__.py - make all - git add -A - git commit -m "release $$version" - git tag -m "Release $$version" "$$version" - -.PHONY: all update-latest readme man-page bash-completion compile exe install release +LATEST_VERSION: youtube-dl + ./youtube-dl --version > LATEST_VERSION From 225dceb0468a0608e9805479b927f6fb8cb94067 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 25 Sep 2012 23:56:01 +0200 Subject: [PATCH 6/7] moved make release to devscripts/release.sh --- Makefile | 12 +----------- devscripts/posix-locale.sh | 0 devscripts/release.sh | 11 +++++++++++ devscripts/wine-py2exe.sh | 0 4 files changed, 12 insertions(+), 11 deletions(-) mode change 100644 => 100755 devscripts/posix-locale.sh create mode 100755 devscripts/release.sh mode change 100644 => 100755 devscripts/wine-py2exe.sh diff --git a/Makefile b/Makefile index 26c85b578..c167d01c4 100644 --- a/Makefile +++ b/Makefile @@ -5,17 +5,7 @@ install: youtube-dl youtube-dl.1 youtube-dl.bash-completion install -m 644 --owner root --group root youtube-dl.1 /usr/local/man/man1 install -m 644 --owner root --group root youtube-dl.bash-completion /etc/bash_completion.d/youtube-dl -release: - @if [ -z "$$version" ]; then echo 'ERROR: specify version number like this: make release version=1994.09.06'; exit 1; fi - @if [ ! -z "`git tag | grep "$$version"`" ]; then echo 'ERROR: version already present'; exit 1; fi - @if [ ! -z "`git status --porcelain`" ]; then echo 'ERROR: the working directory is not clean; commit or stash changes'; exit 1; fi - @sed -i "s/__version__ = '.*'/__version__ = '$$version'/" youtube_dl/__init__.py - make all - git add -A - git commit -m "release $$version" - git tag -m "Release $$version" "$$version" - -.PHONY: all install release +.PHONY: all install youtube-dl: youtube_dl/*.py zip --quiet --junk-paths youtube-dl youtube_dl/*.py diff --git a/devscripts/posix-locale.sh b/devscripts/posix-locale.sh old mode 100644 new mode 100755 diff --git a/devscripts/release.sh b/devscripts/release.sh new file mode 100755 index 000000000..75f8ec8eb --- /dev/null +++ b/devscripts/release.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +if [ -z "$1" ]; then echo "ERROR: specify version number like this: $0 1994.09.06"; exit 1; fi +version="$1" +if [ ! -z "`git tag | grep "$version"`" ]; then echo 'ERROR: version already present'; exit 1; fi +if [ ! -z "`git status --porcelain`" ]; then echo 'ERROR: the working directory is not clean; commit or stash changes'; exit 1; fi +sed -i "s/__version__ = '.*'/__version__ = '$version'/" youtube_dl/__init__.py +make all +git add -A +git commit -m "release $version" +git tag -m "Release $version" "$version" \ No newline at end of file diff --git a/devscripts/wine-py2exe.sh b/devscripts/wine-py2exe.sh old mode 100644 new mode 100755 From 0e841bdc54c68076d82c29d541683eb844d19794 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Wed, 26 Sep 2012 00:10:39 +0200 Subject: [PATCH 7/7] add PREFIX option to make install --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c167d01c4..21b346905 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ all: youtube-dl youtube-dl.exe README.md youtube-dl.1 youtube-dl.bash-completion LATEST_VERSION +PREFIX=/usr/local install: youtube-dl youtube-dl.1 youtube-dl.bash-completion - install -m 755 --owner root --group root youtube-dl /usr/local/bin/ - install -m 644 --owner root --group root youtube-dl.1 /usr/local/man/man1 + install -m 755 --owner root --group root youtube-dl $(PREFIX)/bin/ + install -m 644 --owner root --group root youtube-dl.1 $(PREFIX)/man/man1 install -m 644 --owner root --group root youtube-dl.bash-completion /etc/bash_completion.d/youtube-dl .PHONY: all install