-
Notifications
You must be signed in to change notification settings - Fork 3k
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
ytdl-raw-options can't pass multiple http headers #6492
Comments
Oops, I was actually thinking of |
I'm afraid, youtube-dl doesn't have that one. I even bothered re-checking:
MPV has But even if such options existed, it's not a solution, 'cos I need to pass more or less 5 of them. mpv '--ytdl-raw-options='`
`'add-header="'"'"'Host: video.sibnet.ru'"'"'",'`
`'add-header="'"'"'User-Agent: '"$useragent'"'",'`
`'add-header="'"'"'Accept: */*'"'"'",'`
`'add-header="'"'"'Referer: '"$URL'"'",'`
`'add-header="'"'"'Range: bytes=0-'"'"'",'`
`'verbose='` ` "$URL" Seems like ether mpv should treat those options not as key-value-dictionary, or make an exception for Or at least it should be mentioned in manpages, I think. |
You should be able to configure those headers/proxy settings/etc together in a conf file for youtube-dl, right? If you're able to do it in ytdl, just pass that conf file into mpv's raw options instead of everything separate—I had some issues getting my settings working across OSes until I got a config loading and its been smooth since. Example sourcing the ytdl conf: # Youtube-dl can locate this path
ytdl-raw-options=config-location="~//.config//mpv//youtube-dl.conf"
# Not on mpv's interpolated paths though
# ytdl-raw-options=config-location="~~//youtube-dl.conf" And here's my best guess on how to do the headers: # idk if the header quotation/backticking was functional or just ASCII art
--add-header Host: video.sibnet.ru
--add-header User-Agent: $useragent
--add-header Accept: */*
--add-header Referer: $URL
--add-header Range: bytes=0-
# You'll still get verbose output to the terminal from youtube-dl
# while running in mpv, might be useful if you're still having
# issues later
# (also running mpv w/ --msg-level=all=fatal,ytdl_hook=trace )
--verbose |
^the above config has problems with parsing, this one worked
|
seems like this can be worked around. |
mpv version and platform
Arch Linux
mpv 0.29.1 Copyright © 2000-2018 mpv/MPlayer/mplayer2 projects
built on Sun Dec 9 16:21:27 CET 2018
Reproduction steps
Side story: I was trying to workaround problems with sibnet.ru videos using this suggestion:
ytdl-org/youtube-dl#18182 (comment)
It works with youtube-dl, so I tried passing those headers to mpv.
Example that sets two headers:
Expected behavior
Multiple headers are passed to ytdl_hook.
Actual behavior
Only one header is passed. I assume it is due to options being stored in dictionary, and multiple values with same key override each other.
Log file
The text was updated successfully, but these errors were encountered: