Closed candrapersada closed 1 year ago
~What do you mean combining them? Showing streaming formats and tracks at the same time doesn't make sense as they are different things.~
Edit: I finally realized what was meant further down and made it work.
~Oh the context menu. Sorry I missed that at first and thought you meant the menu for selecting formats.~
~Here is an excerpt from my input.conf
that might help you. It creates two top level elements for track and stream quality selection. For tracks it creates subelements for video-, audio- and subtitle-track-menu and for streaming formats it has the video- and audio-format-menu.~
# ignore #! Tracks >
# ignore #! Stream Quality >
V script-binding uosc/video #! Tracks > Select video
' script-binding uosc/video #! Tracks >
A script-binding uosc/audio #! Tracks > Select audio
\ script-binding uosc/audio #! Tracks >
S script-binding uosc/subtitles #! Tracks > Select subtitles
F script-binding quality_menu/video_formats_toggle #! Stream Quality > Video
Alt+f script-binding quality_menu/audio_formats_toggle #! Stream Quality > Audio
why include_unknown=yes
not working to change the hls video quality or tracks
I have no idea what you mean, I've just tried include_unknown=yes
and it works just fine for me.
Do you have an example of how it fails?
switch from 1920x1080 to 854x480 doesn't work properly
I've also tested switching to a format that would usually be filtered out with include_unknown=no
and that worked, but depending on the website you might encounter formats that don't work correctly and I might not be able to do something about it even if I knew an the example in question.
Ultimately that script can only display what it gets from youtube-dl/yt-dlp and then set the format for mpv. If I get incorrect information or setting the format doesn't work for whatever reason, there is nothing I can do. mpv itself also relies on youtube-dl/yt-dlp to extract the download url, so it's certainly possible that you encountered a shortcoming of youtube-dl/yt-dlp itself and if you're willing to dig into it a bit, you could open an issue about it on their issue tracker.
Did you by any chance set the ytdl-format
with a per file option?
I remember it failing like that when it got set like that by a different script some months ago.
I've fixed the problem with per file options in the file_local_options branch. Does this work for you?
not working for mpv --referrer="https://gdriveplayer.link/" https://hive.gdriveplayer.link/cFOD7Lf0vS3efI4oPaeSbtYWOCWwxbugEATK5blx9mzwT4lw-TjGV3Y6MxcJ9G1SEKyMTWHJ4wM6jiVVOKIfDQ/_D4l-wWpS2Sg8BmjyMnaJpRHFnhuc2lZRvSj4Cfj0Sg/video.m3u8
Ah I see, it fails because it requires a "Referer" header. I'm surprised that you even had options to choose from, because this script didn't add the header and without that yt-dlp failed for me.
But having to modify the builtin script is a shitty solution, so here is a better one.
I've pushed a new commit to the file_local_options branch. Running mpv with --ytdl-raw-options-append=add-header="Referer:https://gdriveplayer.link/"
works now.
what does [ffmpeg] https: HTTP error 404 Not Found mean
mpv --ytdl-raw-options-append=add-header="Referer:https://gdriveplayer.link/" https://hive.gdriveplayer.link/cFOD7Lf0vS3efI4oPaeSbtYWOCWwxbugEATK5blx9mzwT4lw-TjGV3Y6MxcJ9G1SEKyMTWHJ4wM6jiVVOKIfDQ/_D4l-wWpS2Sg8BmjyMnaJpRHFnhuc2lZRvSj4Cfj0Sg/video.m3u8
[ffmpeg] https: HTTP error 404 Not Found
Failed to open https://hive.gdriveplayer.link/l2LQM46woKinxKA8uF2_EuSGr5UYoHv09J_P6F6qOrcmdP7DSH35i-is3NRm4YHbmL18verZdx4fwK5ZJbtYeA/YBrrzi8FujGiurpOb07fUnka-eKGJil_ypqxUzQc4UI/video.m3u8.
(+) Video --vid=1 (h264 480x360 24.000fps)
(+) Audio --aid=1 (aac 2ch 48000Hz)
[quality_menu] fetching available formats...
That message is harmless in this case. It appears because mpv first tries to open the link with ffmpeg, but since it doesn't get the "Referer" header it can't open it, then it falls back to the ytdl_hook. Keep in mind that quality-menu only works when mpv uses the ytdl_hook, so while passing --referrer=
will make that message go away, that will also prevent you from changing the format via quality-menu.
You can tell mpv to try ytdl before ffmpeg by passing --script-opts-append=ytdl_hook-try_ytdl_first=yes
, but with that certain links might take longer to open then they otherwise would (e.g. direct links to .mp4 and such).
so why include_unknown=yes
not working to change the hls video quality or tracks from ffmpeg
quality-menu works by setting the ytdl-format
option of mpv, which, as the name suggests, is specific to youtube-dl/yt-dlp.
I'm not aware of a similar option for the ffmpeg code path, but since opening it via ffmpeg will add the different formats as tracks, you can switch between them by changing the video track.
As the menu works now with your video, I'll consider this solved.
how to use User-Agent in --ytdl-raw-options-append=add-header="Referer:https://gdriveplayer.link/"
how to use User-Agent in
--ytdl-raw-options-append=add-header="Referer:https://gdriveplayer.link/"
Purely based on looking at the man page, I'd say --ytdl-raw-options-append=add-header="User-Agent:UA"
.
You can have arbitrarily many --ytdl-raw-options-append=
options, so just add one for each header you want to add.
what I mean is how to use the header User-Agent+Referer
That's why I said you can have that multiple times.
--ytdl-raw-options-append=add-header="Referer:https://gdriveplayer.link/" --ytdl-raw-options-append=add-header="User-Agent:UA"
mpv --ytdl-raw-options-append=add-header="Referer:https://gdriveplayer.link/" --ytdl-raw-options-append=add-header="User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36" https://hive.gdriveplayer.link/XQMBENUxXwjmL3_e-WLtxriJd8y0w02h4X0kOz4Pw2c3ClHE3wZyDzb5lFYyRBDiBV_cw_txjpFrrjfzvsjAeA/VEd9m4bviG1nehygjwk_R0YsRa5pb0WcwQvXwjCy0_8/video.m3u8
[ytdl_hook] ERROR: [generic] None: Unable to download webpage: HTTP Error 404: Not Found (caused by <HTTPError 404: 'Not Found'>); please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
[ytdl_hook] youtube-dl failed: unexpected error occurred
Huh, turns out that "list" is actually map... sounds like a flaw in mpv to me.
To work around that you can try using the specific options for ytdl instead of the generic "add-header"
--ytdl-raw-options-append=referer="https://gdriveplayer.link/" --ytdl-raw-options-append=user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
can you combine the audio and video track Streaming m3u or m3u8 with audio and video youtube quality in the Context Menu