Rafostar / gtuber

C library to fetch media info from websites
https://rafostar.github.io/gtuber/
GNU Lesser General Public License v2.1
9 stars 3 forks source link

YouTube: allow logging in with YouTube account #43

Closed josch closed 1 year ago

josch commented 1 year ago

Hi,

some videos are only visible when logged in with a YouTube account. For example Videos which are marked as 18+. This is a video that is wrongly marked as 18+ to test this:

$ clapper "https://www.youtube.com/watch?v=Dzed6dKwTAE
(com.github.rafostar.Clapper:6706): Clapper-CRITICAL **: 08:19:51.097: Error from element /GstPlayBin3:playbin3/GstURIDecodeBin3:uridecodebin3-0/GstURISourceBin:urisourcebin0/GstGtuberSrc:gtubersrc0: Resource not found.
This video may be inappropriate for some users.
../gst/gst-gtuber/gstgtubersrc.c(891): gst_gtuber_src_create (): /GstPlayBin3:playbin3/GstURIDecodeBin3:uridecodebin3-0/GstURISourceBin:urisourcebin0/GstGtuberSrc:gtubersrc0

Another reason for this to be useful is to access videos that are privately shared with a specific group of users.

Rafostar commented 1 year ago

What browser do you use? Firefox?

josch commented 1 year ago

I can use firefox and chromium. Why do you ask?

Rafostar commented 1 year ago

Why do you ask?

It might be easier (haven't tried with YT yet) to just share cookies from the browser, instead of passing login/password and praying that big G won't ask for captcha verification. For example, we already support reading Firefox cookies database and use it for similar reason in crunchyroll plugin.

josch commented 1 year ago

Sure, just passing a cookie jar to gtuber sounds reasonable to me. :)

Rafostar commented 1 year ago

@josch Create symbolic link to Firefox browser cookies like this one by one:

mkdir -p $HOME/.config/gtuber-0.0
ln -s $HOME/.mozilla/firefox/*.default-release/cookies.sqlite $HOME/.config/gtuber-0.0/cookies.sqlite

And it should work if you signed in on youtube.com in your browser (and staying logged in when closing browser).

Rafostar commented 1 year ago

If you encounter any problems feel free to reopen. For different browsers support (other then Firefox) a different issue would be needed as this would need to be expanded on gtuber level and not within youtube plugin.