1 # Copyright 1999-2021 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{8..10} )
7 inherit bash-completion-r1 distutils-r1 readme.gentoo-r1
9 DESCRIPTION="Download videos from YouTube.com (and more sites...)"
10 HOMEPAGE="https://youtube-dl.org/ https://github.com/ytdl-org/youtube-dl/"
11 SRC_URI="https://youtube-dl.org/downloads/${PV}/${P}.tar.gz"
14 LICENSE="public-domain"
15 KEYWORDS="amd64 arm ~arm64 ~hppa ppc ppc64 ~riscv x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-solaris"
19 dev-python/pycryptodome[${PYTHON_USEDEP}]
22 distutils_enable_tests nose
25 sed -i -e '/flake8/d' Makefile || die
26 distutils-r1_src_prepare
33 python_install_all() {
36 newbashcomp youtube-dl.bash-completion youtube-dl
38 insinto /usr/share/zsh/site-functions
39 newins youtube-dl.zsh _youtube-dl
41 insinto /usr/share/fish/vendor_completions.d
44 distutils-r1_python_install_all
46 rm -r "${ED}"/usr/etc || die
47 rm -r "${ED}"/usr/share/doc/youtube_dl || die
51 if ! has_version media-video/ffmpeg; then
52 elog "${PN} works fine on its own on most sites. However, if you want"
53 elog "to convert video/audio, you'll need media-video/ffmpeg."
54 elog "On some sites - most notably YouTube - videos can be retrieved in"
55 elog "a higher quality format without sound. ${PN} will detect whether"
56 elog "ffmpeg is present and automatically pick the best option."
58 if ! has_version media-video/rtmpdump; then
60 elog "Videos or video formats streamed via RTMP protocol can only be"
61 elog "downloaded when media-video/rtmpdump is installed."
63 if ! has_version media-video/mplayer && ! has_version media-video/mpv; then
65 elog "Downloading MMS and RTSP videos requires either media-video/mplayer"
66 elog "or media-video/mpv to be installed."
68 if ! has_version media-video/atomicparsley; then
70 elog "Install media-video/atomicparsley if you want ${PN} to embed thumbnails"
71 elog "from the metadata into the resulting MP4/M4A files."