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

Honor mpv HTTP headers when streaming videos #266

Closed
LiteracyFanatic opened this issue Dec 19, 2019 · 5 comments
Closed

Honor mpv HTTP headers when streaming videos #266

LiteracyFanatic opened this issue Dec 19, 2019 · 5 comments

Comments

@LiteracyFanatic
Copy link

Some streaming sites require certain HTTP headers to be set in order to play properly. For example, using plain MPV, mpv 'https://twist.moe/anime/trigun/[a-s]_trigun_-_01_-_the_$$60_billion_man__rs2_[590CCDF8].mp4' fails but mpv --referrer 'https://twist.moe/' 'https://twist.moe/anime/trigun/[a-s]_trigun_-_01_-_the_$$60_billion_man__rs2_[590CCDF8].mp4' works fine. I've tried adding --referrer 'https://twist.moe/' to the player arguments in the settings window, but syncplay still fails to load the video.

@Et0h
Copy link
Contributor

Et0h commented Apr 3, 2020

I have no idea how the mpv referrer system works, so you might need to do some more research and figure out how to implement it yourself (or find someone who can) if you want this feature.

@Et0h Et0h added the help wanted Anyone willing to help can fix/implement this label Sep 19, 2020
@Et0h
Copy link
Contributor

Et0h commented Oct 24, 2020

@LiteracyFanatic Does running Syncplay 1.6.7 and under 'Player Arguments' specifying referrer=URL work?

@LiteracyFanatic
Copy link
Author

Unfortunately it still doesn't work. I've attached a log file. This line stood out to me.

player >> ['loadfile', 'https://twist.moe/anime/trigun/[a-s]_trigun_-_01_-_the_$$60_billion_man__rs2_[590CCDF8].mp4']

Maybe this needs to be handled from lua. Perhaps loading a URL from lua doesn't respect the command line options.
log.txt

@Skrity
Copy link

Skrity commented Jan 20, 2021

It works but something happens with quotes that breaks it.

If I put referrer=https://twist.moe/ into arguments exactly like this it works, if you put quotes around the website mpv seem to inherit them and put them into the variable which presumably breaks parsing on mpv/ffmpeg's end.
Dunno if problem is in syncplay or mpv, but seems like a serialization issue.

This doesn't happen when you put referrer="https://twist.moe/" into mpv.conf or use input.conf binding w cycle-values referrer "https://twist.moe/" "".

To check this enable mpv console and do show-text ${referrer}. The referrer variable shouldn't contain any quotes.

@Et0h
Copy link
Contributor

Et0h commented Mar 3, 2021

I've not tested your particular use case but I have added some code to strip quotation marks from the beginning and end of per-player arguments which hopefully resolves any Syncplay-side issues with handling player arguments (5c3982f).

@Et0h Et0h closed this as completed Mar 3, 2021
@daniel-123 daniel-123 removed the help wanted Anyone willing to help can fix/implement this label Mar 6, 2021
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

4 participants