christoph-heinrich / mpv-quality-menu

A userscript for MPV that allows you to change the streamed video and audio quality (ytdl-format) on the fly.
GNU General Public License v2.0
144 stars 4 forks source link

Quality-menu doesn't make use of --cookies-from-browser #31

Closed GunGunGun closed 1 year ago

GunGunGun commented 1 year ago

For Bilibili.tv, the only way to get 1080p even higher is to pass cookies from web browser (with an account logging in) to MPV, it works with MPV and I got 1080p+:

image

But somehow, quality-menu doesn't show 1080p+:

image

Is threre a way to force quality-menu to use --cookies-from-browser for consistency ?

christoph-heinrich commented 1 year ago

How are you passing that option? --ytdl-raw-options=cookies-from-browser= should definitely work. You can check how ytdl gets called in the verbose log (e.g. --log-file=log.txt), there should be a line calling ytdl with command: ....

It's possible that the formats are not shown because it's not clear if those formats are video or audio formats. To make sure they aren't hidden, try the option include_unknown=yes.

GunGunGun commented 1 year ago

How are you passing that option? --ytdl-raw-options=cookies-from-browser= should definitely work. You can check how ytdl gets called in the verbose log (e.g. --log-file=log.txt), there should be a line calling ytdl with command: ....

It's possible that the formats are not shown because it's not clear if those formats are video or audio formats. To make sure they aren't hidden, try the option include_unknown=yes.

I use this cmd mpv https://www.bilibili.com/video/BV1ot411y7Q3/ --ytdl-raw-options-append=cookies-from-browser=firefox:D:\PB\Data\profilet

And I do have include_unknown=yes

The result is still the same with mpv https://www.bilibili.com/video/BV1ot411y7Q3/ --ytdl-raw-options-append=cookies-from-browser=firefox:D:\PB\Data\profilet --log-file=qualitymenu.txt

image

Attached my log file: qualitymenu.txt

So it doesn't work somehow.

The command is:

[ 10.534][v][quality_menu] calling youtube-dl with command: yt-dlp --no-warnings --no-playlist -J https://www.bilibili.com/video/BV1ot411y7Q3/ --no-match-filter [ 10.534][d][quality_menu] Running: yt-dlp --no-warnings --no-playlist -J https://www.bilibili.com/video/BV1ot411y7Q3/ --no-match-filter

Update:

It works if I modify quality-menu.lua: local command = { ytdl.path, "--no-warnings", "--no-playlist", "-J", "--cookies-from-browser", "firefox:D:\\PB\\Data\\profilet", url } image

But I guess this is too extreme for end-use, I would prefer to have an option to force cookies in quality-menu.conf

christoph-heinrich commented 1 year ago

You're using an outdated version of quality-menu, the last release gained the feature to pass ytdl-raw-options to ytdl.

GunGunGun commented 1 year ago

You're using an outdated version of quality-menu, the last release gained the feature to pass ytdl-raw-options to ytdl.

Ah, my bad, yeah I just checked my version is outdated: -- quality-menu 3.1.1 - 2023-Feb-04

This "not issue" is now solved, thanks!