Closed askpng closed 1 month ago
did you add --filesystem=~/.var/app/org.mozilla.firefox/.mozilla
to mpv flatpak? I don't see it in the commands above
With or without explicit access to filesystem=host
, host-os
, host-etc
, and home
or manual specification of the Firefox Flatpak folder via Flatpak I still get these errors. Previously it was working just with cookies-from-browser
passed from Firefox to MPV, without needing to modify filesystem permissions on Flatpak.
> flatpak run --command=mpv io.mpv.Mpv '[URL]' --ytdl-raw-options=cookies-from-browser=firefox:~/.var/app/org.mozilla.firefox/.mozilla/firefox
[ytdl_hook] ERROR: could not find firefox cookies database in '/var/home/mel/.var/app/org.mozilla.firefox/.mozilla/firefox'
[ytdl_hook] youtube-dl failed: unexpected error occurred
Failed to recognize file format.
Exiting... (Errors when loading file)
When using ytdl-raw-options="cookies-from-browser firefox:~/.var/app/org.mozilla.firefox/.mozilla"
in the mpv.config
file:
> flatpak run --command=mpv io.mpv.Mpv '[URL]' --config-dir=~/.var/app/io.mpv.Mpv/config/mpv/mpv.conf
[ytdl_hook] ERROR: [youtube] WATCHCODE: The following content is not available on this app.. Watch on the latest version of YouTube.
[ytdl_hook] youtube-dl failed: unexpected error occurred
Failed to recognize file format.
Exiting... (Errors when loading file)
With or without explicit access to filesystem=host, host-os, host-etc, and home or manual specification of the Firefox Flatpak folder via Flatpak I still get these errors
Please post flatpak run --filesystem=~/.var/app/org.mozilla.firefox/.mozilla --command=mpv io.mpv.Mpv '[URL]' --ytdl-raw-options=cookies-from-browser=firefox:~/.var/app/org.mozilla.firefox/.mozilla/firefox
anything else else isn't supposed to work - home or host are irrelevant.
Gotcha. Working now with membership-only video link:
flatpak run --filesystem=~/.var/app/org.mozilla.firefox/.mozilla --command=mpv io.mpv.Mpv '[URL]' --ytdl-raw-options=cookies-from-browser=firefox:~/.var/app/org.mozilla.firefox/.mozilla/firefox
(+) Video --vid=1 (*) (vp9 1920x1080 60.000fps)
(+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
Subs --sid=1 --slang=live_chat 'json' (null) (external)
File tags:
Uploader: [CHANNEL NAME]
Channel_URL: [URL]
AO: [pipewire] 48000Hz stereo 2ch floatp
VO: [gpu] 1920x1080 yuv420p
(Paused) AV: 00:00:03 / 00:29:28 (0%) A-V: 0.000 Dropped: 3 Cache: 7.9s/1MB
Exiting... (Quit)
Thanks a bunch for pointing me to the right direction! Did something recently change that affected this? I don't recall ever having to set filesystem to the Firefox dir up until now.
Add.: --ytdl-raw-options=cookies-from-browser=firefox
also simply works too, following the yt-dlp
2024.04.09 changelog. Could this be the cause?
Glad it worked for you. mpv has limited filesystem access. so, one needs to give access to the required directory, here sandboxed mpv and yt-dlp required access to --filesystem=~/.var/app/org.mozilla.firefox/.mozilla.
Weird, I actually don't recall ever having to explicitly specify the filesystem path before to get browser cookies to work! But it's working now so all's well. Thanks so much for the assistance!
Issue
Flatpak MPV is not recognizing Firefox browser cookies for YouTube via
--ytdl-raw-options=cookies-from-browser=firefox
,-ytdl-raw-options=cookies-from-browser=firefox:~/.var/app/org.mozilla.firefox/.mozilla/firefox
. Works fine in the Pacman & AUR version of Flatpak.Additionally, when
--ytdl-raw-options=cookies-from-browser=firefox
is used, Flathub MPV refuses to play regular YouTube videos that start withhttps://
. If replaced withytdl://
, regular video plays. When attempting to play membership-only videos withytdl://
,[ytdl_hook] ERROR: [youtube] WATCHCODE: The following content is not available on this app.. Watch on the latest version of YouTube.
happens.Additional info
Was working just fine until about a month ago (April 19-20), during which I could use Flatpak MPV and Celluloid to watch membership-only videos on YouTube. Recently refreshed my computer and tried to restore
mpv.conf
+ adjust--cookies-from-browser firefox:~/.var/app/org.mozilla.firefox/.mozilla/firefox
fromyt-dlp
config into Flatpak MPV and Celluloid config, but getting theatderr: ERROR: could not find firefox cookies database in '/var/home/$USER/.var/app/org.mozilla.firefox/.mozilla/firefox'
and errors that follow. Also happening in Celluloid.yt-dlp
added the Firefox flatpak directory by default on their 2024.04.09 release. Could this be related?I initially thought this could be a formatting error, but I'm unable to get the right entry format for
--ytdl-raw-options=cookies-from-browser
no matter what combination I try. If it is indeed a formatting error, can you point me to the right format?Steps to reproduce with logs attached
Regular videos
Flatpak:
flatpak run --command=mpv io.mpv.Mpv -v "https://[URL]" --ytdl-raw-options=cookies-from-browser=firefox:~/.var/app/org.mozilla.firefox/.mozilla/firefox
Pacman/AUR:
mpv -v "https://[URL]" --ytdl-raw-options=cookies-from-browser=firefox:~/.var/app/org.mozilla.firefox/.mozilla/firefox
withmpv
from pacman ormpv-full-git
from AURMembership-only videos
Flatpak:
flatpak run --command=mpv io.mpv.Mpv -v "ytdl://[URL]" --ytdl-raw-options=cookies-from-browser=firefox:~/.var/app/org.mozilla.firefox/.mozilla/firefox
Pacman/AUR
mpv -v "https://[URL]" --ytdl-raw-options=cookies-from-browser=firefox:~/.var/app/org.mozilla.firefox/.mozilla/firefox
withmpv
from pacman ormpv-full-git
from AURVersion info
Flatpak
pacman
AUR