该命令可以在没有proxy
参数的情况下获取视频标题,请在我的vps上运行。
url="https://www.youtube.com/watch?v=znmQ7oMiQrM&list=PLUkh9m2BorqnKWu0g5ZUps_CbQ-JGtbI9&index=1"
youtube-dl -o "/tmp/%(title)s.%(ext)s" --write-auto-sub --yes-playlist $url
上述命令的输出信息。
[info] Writing video subtitles to: /tmp/Session 1 - Introduction to Valuation.en.vtt
[download] Destination: /tmp/Session 1 - Introduction to Valuation.mp4
它可以获取视频字幕,现在要添加proxy
参数,可以在我的本地PC上运行。
url="https://www.youtube.com/watch?v=znmQ7oMiQrM&list=PLUkh9m2BorqnKWu0g5ZUps_CbQ-JGtbI9&index=1"
youtube-dl -o "/tmp/%(title)s.%(ext)s" --proxy "socks5://127.0.0.1:1080/" --write-auto-sub --yes-playlist $url
我只添加proxy
参数,其他所有参数保持不变,则得到以下输出:
WARNING: Unable to extract video title
[youtube] znmQ7oMiQrM: Looking for automatic captions
[info] Writing video subtitles to: /tmp/_.en.vtt
[download] Destination: /tmp/_.f248.webm
它可以下载没有标题的视频作为下载的视频,为什么自变量proxy
的操作不同,为什么要在我的vps上运行很重要?
添加v
自变量以详细显示所有信息。
youtube-dl -v --write-pages -o "/tmp/%(title)s.%(ext)s" --proxy "socks5://127.0.0.1:1080/" --write-auto-sub --yes-playlist $url
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--write-pages', '-o', '/tmp/%(title)s.%(ext)s', '--proxy', 'socks5://127.0.0.1:1080/', '--write-auto-sub', '--yes-playlist', 'https://www.youtube.com/watch?v=znmQ7oMiQrM&list=PLUkh9m2BorqnKWu0g5ZUps_CbQ-JGtbI9&index=1']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.07.16
[debug] Python version 3.5.3 (CPython) - Linux-4.9.0-9-amd64-x86_64-with-debian-9.9
[debug] exe versions: ffmpeg 3.2.14-1, ffprobe 3.2.14-1
[debug] Proxy map: {'https': 'socks5://127.0.0.1:1080/', 'http': 'socks5://127.0.0.1:1080/'}
[youtube:playlist] Downloading playlist PLUkh9m2BorqnKWu0g5ZUps_CbQ-JGtbI9 - add --no-playlist to just download video znmQ7oMiQrM
[youtube:playlist] PLUkh9m2BorqnKWu0g5ZUps_CbQ-JGtbI9: Downloading webpage
[youtube:playlist] Saving request to PLUkh9m2BorqnKWu0g5ZUps_CbQ-JGtbI9_https_-_www.youtube.com_playlistlist=PLUkh9m2BorqnKWu0g5ZUps_CbQ-JGtbI9_disable_polymer=true.dump
[download] Downloading playlist: Valuation
[youtube:playlist] playlist Valuation: Downloading 25 videos
[download] Downloading video 1 of 25
[youtube] znmQ7oMiQrM: Downloading webpage
[youtube] Saving request to znmQ7oMiQrM_https_-_www.youtube.com_watchhas_verified=1_bpctr=9999999999_v=znmQ7oMiQrM_disable_polymer=true_hl=en_gl=US.dump
[youtube] znmQ7oMiQrM: Downloading video info webpage
[youtube] Saving request to znmQ7oMiQrM_https_-_www.youtube.com_get_video_infohl=en_gl=US_video_id=znmQ7oMiQrM_disable_polymer=true_eurl=_ps=default_el=embedded.dump
WARNING: Unable to extract video title
[youtube] znmQ7oMiQrM: Looking for automatic captions
[debug] Default format spec: bestvideo+bestaudio/best
[info] Writing video subtitles to: /tmp/_.en.vtt
[debug] Invoking downloader on 'https://r4---sn-a5msen7l.googlevideo.com/videoplayback?expire=1565674517&ei=tPdRXZy-MND8kgbJ7JrwCQ&ip=65.49.218.106&id=o-APXnQrHHHHttAI0VI1FjI3xIZNQKXoAcTffCZvbDaowF&itag=248&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-a5msen7l%2Csn-a5mekne7&ms=au%2Crdu&mv=m&mvi=3&pl=20&initcwndbps=1261250&mime=video%2Fwebm&gir=yes&clen=123038403&dur=974.431&lmt=1540749282657199&mt=1565652704&fvip=1&keepalive=yes&c=WEB&txp=5432432&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRQIgWW_UbLJqGcCIkKNgYhCKSWEDpC_ND_4c-_e9LSbAMkACIQDKZNf_b01YjtrNllZFNq_dL7GX5bX6CM5jsgiaqw0JZQ%3D%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIgFkroUYnazUgzoaBbuU1Ot4vu81LmQex7WfJoNhsNx6kCIQCCIeMh_wo0F2bUysi0P9yJCZBh9g9XfxKQpZMGvYKw6A%3D%3D&ratebypass=yes'
[download] Destination: /tmp/_.f248.webm
答案 0 :(得分:4)
最近从update到youtube-dl到similar issues;尝试新版本:
$ youtube-dl --update
$ youtube-dl --version
2019.08.13
如果那不能解决您的问题,您可以尝试geo-restriction options或file a bug report与开发人员和 提供对您的vpn,vps,代理等的访问权限,以便他们可以对其进行调试。
答案 1 :(得分:1)
sudo pip3 install-升级youtube-dl