1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=(python{2_7,3_4,3_5,3_6})
6 inherit bash-completion-r1 distutils-r1 readme.gentoo-r1
8 DESCRIPTION="Download videos from YouTube.com (and more sites...)"
9 HOMEPAGE="https://rg3.github.com/youtube-dl/"
10 SRC_URI="http://youtube-dl.org/downloads/${PV}/${P}.tar.gz"
12 LICENSE="public-domain"
14 KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
15 IUSE="+offensive test"
18 dev-python/setuptools[${PYTHON_USEDEP}]
22 test? ( dev-python/nose[coverage(+)] )
27 python_prepare_all() {
28 if ! use offensive; then
29 sed -i -e "/..version../s|'$|+gentoo.no.offensive.sites'|g" \
30 youtube_dl/version.py || die
31 # these have single line import statements
33 alphaporno anysex behindkink camwithher chaturbate eporner
34 eroprofile extremetube foxgay goshgay hellporno hentaistigma
35 hornbunny keezmovies lovehomeporn mofosex motherless myvidster
36 porn91 porncom pornflip pornhd pornotube pornovoisines pornoxo
37 ruleporn sexu slutload spankbang spankwire sunporno thisav tube8
38 vporn watchindianporn xbef xnxx xtube xvideos xxxymovies youjizz
41 # these have multi-line import statements
43 drtuber fourtube pornhub redtube tnaflix xhamster
45 # do single line imports
47 -e $( printf '/%s/d;' ${xxx[@]} ) \
48 youtube_dl/extractor/extractors.py \
51 # do multiple line imports
53 -e $( printf '/%s/,/)/d;' ${mxxx[@]} ) \
54 youtube_dl/extractor/extractors.py \
58 -e $( printf '/%s/d;' ${mxxx[@]} ) \
59 youtube_dl/extractor/generic.py \
63 $( printf 'youtube_dl/extractor/%s.py ' ${xxx[@]} ) \
64 $( printf 'youtube_dl/extractor/%s.py ' ${mxxx[@]} ) \
65 test/test_age_restriction.py \
71 distutils-r1_python_prepare_all
75 distutils-r1_src_compile
82 python_install_all() {
86 newbashcomp ${PN}.bash-completion ${PN}
88 insinto /usr/share/zsh/site-functions
89 newins youtube-dl.zsh _youtube-dl
91 insinto /usr/share/fish/completions
94 distutils-r1_python_install_all
96 rm -r "${ED}"/usr/etc || die
97 rm -r "${ED}"/usr/share/doc/youtube_dl || die
99 elog "youtube-dl(1) / https://bugs.gentoo.org/355661 /"
100 elog "https://github.com/rg3/youtube-dl/blob/master/README.md#faq :"
102 elog "${PN} works fine on its own on most sites. However, if you want"
103 elog "to convert video/audio, you'll need avconf (media-video/libav) or"
104 elog "ffmpeg (media-video/ffmpeg). On some sites - most notably YouTube -"
105 elog "videos can be retrieved in a higher quality format without sound."
106 elog "${PN} will detect whether avconv/ffmpeg is present and"
107 elog "automatically pick the best option."
110 elog "Videos or video formats streamed via RTMP protocol can only be"
111 elog "downloaded when rtmpdump (media-video/rtmpdump) is installed."
112 elog "Downloading MMS and RTSP videos requires either mplayer"
113 elog "(media-video/mplayer) or mpv (media-video/mpv) to be installed."