Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpv cannot play youtube video #2937

Closed
caikechao opened this issue Mar 13, 2016 · 9 comments
Closed

mpv cannot play youtube video #2937

caikechao opened this issue Mar 13, 2016 · 9 comments

Comments

@caikechao
Copy link

I heard that mpv can play youtube video by passing the url directly to mpv. So I tried but got no luck.

My system information

OS: Arch Linux 
Kernel: x86_64 Linux 4.4.5-1-ARCH
Resolution: 3840x1080
DE: Gnome 
WM: GNOME Shell

The mpv version

mpv 0.16.0 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
 built on Mon Feb 29 16:27:06 CET 2016
ffmpeg library versions:
   libavutil       55.17.103
   libavcodec      57.24.102
   libavformat     57.25.100
   libswscale      4.0.100
   libavfilter     6.31.100
   libswresample   2.0.101
ffmpeg version: 3.0

When I try to open a youtube test video with mpv https://www.youtube.com/watch\?v\=C0DPdy98e4c in my terminal, I got the following out put:

Playing: https://www.youtube.com/watch?v=C0DPdy98e4c
[ffmpeg] httpproxy: Protocol not on whitelist 'http,https,tls,rtp,tcp,udp,crypto'!
Failed to open https://r2---sn-i3beln7k.googlevideo.com/videoplayback?id=0b40cf772f7c7b87&itag=141&source=youtube&requiressl=yes&mm=31&mn=sn-i3beln7k&pl=18&mv=m&ms=au&nh=IgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE&ratebypass=yes&mime=audio/mp4&gir=yes&clen=561998&lmt=1407412024362085&dur=17.600&signature=391C391F81E808699FBE31C4314C9BEBC7062326.51EC669545766E9F2D79E61CF8379D00D759F28B&mt=1457833545&upn=6NPrl28q0WE&key=dg_yt0&sver=3&fexp=9412859,9416126,9418403,9420452,9422596,9423488,9423661,9423662,9424581,9424823,9425396,9427705,9428702,9429821,9430829,9431118&ip=137.189.90.217&ipbits=0&expire=1457855267&sparams=ip,ipbits,expire,id,itag,source,requiressl,mm,mn,pl,mv,ms,nh,ratebypass,mime,gir,clen,lmt,dur.
Can not open external file https://r2---sn-i3beln7k.googlevideo.com/videoplayback?id=0b40cf772f7c7b87&itag=141&source=youtube&requiressl=yes&mm=31&mn=sn-i3beln7k&pl=18&mv=m&ms=au&nh=IgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE&ratebypass=yes&mime=audio/mp4&gir=yes&clen=561998&lmt=1407412024362085&dur=17.600&signature=391C391F81E808699FBE31C4314C9BEBC7062326.51EC669545766E9F2D79E61CF8379D00D759F28B&mt=1457833545&upn=6NPrl28q0WE&key=dg_yt0&sver=3&fexp=9412859,9416126,9418403,9420452,9422596,9423488,9423661,9423662,9424581,9424823,9425396,9427705,9428702,9429821,9430829,9431118&ip=137.189.90.217&ipbits=0&expire=1457855267&sparams=ip,ipbits,expire,id,itag,source,requiressl,mm,mn,pl,mv,ms,nh,ratebypass,mime,gir,clen,lmt,dur.
[ffmpeg] httpproxy: Protocol not on whitelist 'http,https,tls,rtp,tcp,udp,crypto'!
Failed to open https://r2---sn-i3beln7k.googlevideo.com/videoplayback?id=0b40cf772f7c7b87&itag=133&source=youtube&requiressl=yes&mm=31&mn=sn-i3beln7k&pl=18&mv=m&ms=au&nh=IgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE&ratebypass=yes&mime=video/mp4&gir=yes&clen=503705&lmt=1407412011429135&dur=16.521&signature=574BE0F66981BA2CB7B6D83220FEE5DE88C2858C.76DDB444894740D0A9072BC82BEB6CCC0E2006DD&mt=1457833545&upn=6NPrl28q0WE&key=dg_yt0&sver=3&fexp=9412859,9416126,9418403,9420452,9422596,9423488,9423661,9423662,9424581,9424823,9425396,9427705,9428702,9429821,9430829,9431118&ip=137.189.90.217&ipbits=0&expire=1457855267&sparams=ip,ipbits,expire,id,itag,source,requiressl,mm,mn,pl,mv,ms,nh,ratebypass,mime,gir,clen,lmt,dur.

Is this a bug of mpv or ffmpeg? Is this error related to my proxy setting?

Thanks very much!

@wiiaboo
Copy link
Member

wiiaboo commented Mar 13, 2016

Try adding --demuxer-lavf-o=protocol_whitelist=[http,https,tls,rtp,tcp,udp,crypto,httpproxy] to mpv options.

@caikechao
Copy link
Author

@wiiaboo Thanks for your response. But I got the same error.

mpv --demuxer-lavf-o=protocol_whitelist=[http,https,tls,rtp,tcp,udp,crypto,httpproxy] https://www.youtube.com/watch\?v\=C0DPdy98e4c
Playing: https://www.youtube.com/watch?v=C0DPdy98e4c
[ffmpeg] httpproxy: Protocol not on whitelist 'http,https,tls,rtp,tcp,udp,crypto'!
Failed to open https://r2---sn-i3beln7k.googlevideo.com/videoplayback?id=0b40cf772f7c7b87&itag=141&source=youtube&requiressl=yes&nh=IgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE&mm=31&mn=sn-i3beln7k&mv=m&ms=au&pl=18&ratebypass=yes&mime=audio/mp4&gir=yes&clen=561998&lmt=1407412024362085&dur=17.600&fexp=9405964,9416126,9420452,9422596,9423661,9423662,9425283,9425945,9426524,9426788,9426942,9427678,9428222,9428771,9429254,9429808&key=dg_yt0&signature=7D060D90B55CAFE974CDCA06CF9F65C048624F33.47A6F65DC3D11FEEE95E201042646DB9FA0C8946&mt=1457838777&upn=l--fs1RL6VI&sver=3&ip=137.189.90.217&ipbits=0&expire=1457860434&sparams=ip,ipbits,expire,id,itag,source,requiressl,nh,mm,mn,mv,ms,pl,ratebypass,mime,gir,clen,lmt,dur.
Can not open external file https://r2---sn-i3beln7k.googlevideo.com/videoplayback?id=0b40cf772f7c7b87&itag=141&source=youtube&requiressl=yes&nh=IgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE&mm=31&mn=sn-i3beln7k&mv=m&ms=au&pl=18&ratebypass=yes&mime=audio/mp4&gir=yes&clen=561998&lmt=1407412024362085&dur=17.600&fexp=9405964,9416126,9420452,9422596,9423661,9423662,9425283,9425945,9426524,9426788,9426942,9427678,9428222,9428771,9429254,9429808&key=dg_yt0&signature=7D060D90B55CAFE974CDCA06CF9F65C048624F33.47A6F65DC3D11FEEE95E201042646DB9FA0C8946&mt=1457838777&upn=l--fs1RL6VI&sver=3&ip=137.189.90.217&ipbits=0&expire=1457860434&sparams=ip,ipbits,expire,id,itag,source,requiressl,nh,mm,mn,mv,ms,pl,ratebypass,mime,gir,clen,lmt,dur.
[ffmpeg] httpproxy: Protocol not on whitelist 'http,https,tls,rtp,tcp,udp,crypto'!
Failed to open https://r2---sn-i3beln7k.googlevideo.com/videoplayback?id=0b40cf772f7c7b87&itag=133&source=youtube&requiressl=yes&nh=IgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE&mm=31&mn=sn-i3beln7k&mv=m&ms=au&pl=18&ratebypass=yes&mime=video/mp4&gir=yes&clen=503705&lmt=1407412011429135&dur=16.521&fexp=9405964,9416126,9420452,9422596,9423661,9423662,9425283,9425945,9426524,9426788,9426942,9427678,9428222,9428771,9429254,9429808&key=dg_yt0&signature=624B1AE448AF6E59720D61FF4DD91C8ED44FAA61.429A99AE6DBAB68769F48C833140DEC5CB04B820&mt=1457838777&upn=l--fs1RL6VI&sver=3&ip=137.189.90.217&ipbits=0&expire=1457860434&sparams=ip,ipbits,expire,id,itag,source,requiressl,nh,mm,mn,mv,ms,pl,ratebypass,mime,gir,clen,lmt,dur.


Exiting... (Errors when loading file)

Just now, I tried VLC Player with vlc https://www.youtube.com/watch\?v\=C0DPdy98e4c. VLC works. But I prefer mpv to VLC ...

@wiiaboo
Copy link
Member

wiiaboo commented Mar 13, 2016

Probably create an issue in FFmpeg's tracker about adding httproxy to the default whitelist.

@caikechao
Copy link
Author

@wiiaboo 👍 I just described my problem and sent an email to the ffmpeg-user mailing list. Hope this problem can be solved soon.

@Hrxn
Copy link
Contributor

Hrxn commented Mar 13, 2016

youtube-dl version?

@ghost ghost added the down-upstream:ffmpeg label Mar 13, 2016
@caikechao
Copy link
Author

@Hrxn Thanks for your response. I just checked the youtube-dl version with:

youtube-dl -v

The output is as follows:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.02.22
[debug] Python version 3.5.1 - Linux-4.4.5-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 3.0, ffprobe 3.0, rtmpdump 2.4
[debug] Proxy map: {'https': 'http://proxy.anonymous.org:8000/', 'ftp': 'http://proxy.annoymous.org:8000/', 'all': 'socks://socks.anonymous.org:1080/', 'no': '127.0.0.1,localhost,127.0.0.0/8,anonymous.org', 'rsync': 'http://proxy.anonymous:8000/', 'http': 'http://proxy.anonymous.org:8000/'}
Usage: youtube-dl [OPTIONS] URL [URL...]

(My proxy addresses are anonymized. ) If you need any other information, please let me know. 😃

@caikechao
Copy link
Author

This was indeed a bug of ffmpeg. I added httpproxy to the default http whitelist (see this commit), compiled the source code and installed my own version of ffmpeg. Everything works normally now.

Thank you all!

@Hrxn
Copy link
Contributor

Hrxn commented Mar 14, 2016

Good news..
Glad that it could be resolved quickly!

@ghost
Copy link

ghost commented Mar 14, 2016

This was just fixed in ffmpeg git master.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants