skorokithakis / catt

Cast All The Things allows you to send videos from many, many online sources to your Chromecast.
BSD 2-Clause "Simplified" License
3.33k stars 153 forks source link

cookies-from-browser option not working as expected #447

Open mrmabs opened 3 months ago

mrmabs commented 3 months ago

This one has me stumped, but I suspect it's not catt and is in yt-dlp. I am posting here first because running yt-dlp with --cookies-from-browser=firefox does work as intended.

I am running Linux and have used pipx catt to install catt. To test yt-dlp I used pipx yt-dlp and ensured I was running the local pipx version, and not the one on my system.

If I run catt cast -y 'cookies-from-browser=firefox' 'https://www.patreon.com/posts/...., I get:

ERROR: [Patreon] ....: You do not have access to this post.

Running ~/.local/bin/yt-dlp --cookies-from-browser=firefox 'https://www.patreon.com/posts/.... works correctly.

I added -y 'verbose=1' to the catt cli and yt-dlp acknowledges it got the 'cookies-from-browser=firefox' option,

[debug] params: {'verbose': '1', 'cookies-from-browser': 'firefox', 'compat_opts': set(), 'http_headers':....

But unlike when running yt-dlp directly, I do not see:

Extracting cookies from firefox

The versions of yt-dlp I tested above are identical:

[debug] yt-dlp version stable@2024.05.27 from yt-dlp/yt-dlp [12b248ce6] (pip)

mrmabs commented 3 months ago

OK, so I think I have somewhat resolved this, but may still need an update in the documentation for catt. I'll leave this one open, but happy for it to be closed.

It looks like yt-dlp wants 'cookiesfrombrowser=firefox', without the dash (-).

I also spotted a bug in yt-dlp where in cookies.py; it passes the browser_specification string with a "*", and at least in my installation this dereferences to a list for each character in the string, which the function call to _parse_browser_specification is now seven parameters (for 'firefox'), causing an error. I'll open an issue over there if one hasn't been raised already.

I fixed it by removing the '*' and currently watching the video from the previous post.

mrmabs commented 3 months ago

It does look like something that might need fixing in catt, the parameter to the option passed through the api needs to be a tuple.

https://github.com/yt-dlp/yt-dlp/issues/10196#issuecomment-2171928333

skorokithakis commented 3 months ago

Thanks for the investigation! Would you mind opening a PR?