Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update video_info.py #217

Merged
merged 1 commit into from
Oct 15, 2021
Merged

Update video_info.py #217

merged 1 commit into from
Oct 15, 2021

Conversation

RNavega
Copy link
Contributor

@RNavega RNavega commented Oct 15, 2021

This fixes live video playback after those new API changes. There was a typo in the code that was causing the live stream headers to get mangled.

This doesn't yet fix age-gated videos.

@anxdpanic anxdpanic merged commit 64a8384 into anxdpanic:master Oct 15, 2021
@anxdpanic
Copy link
Owner

@RNavega I simplified things here, #218 looks like the included v1 key works with the endpoint.

I will see about adding dual login back, so we can generate a v1 access token again when I have some time. If that's something you're interested in looking at I can help point you to the old implementation, might be able to revert some/all of it.

@RNavega
Copy link
Contributor Author

RNavega commented Oct 16, 2021

@anxdpanic I'll take a look at 218, thank you for taking the time.

I've found out why the OAuth use was broken, it's because our personal API keys aren't allowed to use this internal innertube API that the YT apps use. So we were trying to use it with a token for a different API.

Some brilliant people have charted how to use some of innertube, here are my references:

There could be a complete overhaul of plugin.video.youtube to use this innertube API instead of the old YT Data API like it is now.
The only concern, and I don't know how you'd feel about this, is that we'd all be using the same API key/client secret/client ID taken from the "YT for TV" app as seen in the pytube code, camouflaging as that official app. This might be considered underhanded lol

@anxdpanic
Copy link
Owner

At one time the add-on did use the YouTube for TV API in combination with the data.
It was removed, b7c0c9f

And I've added the API key that we used then, which is already in the files. https://github.com/anxdpanic/plugin.video.youtube/pull/218/files#diff-5ecde54fa534f31c07c435544e8497cb462674901a9d688be492bfbbde50b579R100

API Keys: https://github.com/anxdpanic/plugin.video.youtube/blob/master/resources/lib/youtube_plugin/__init__.py#L12

So that's about all that would be required

@RNavega
Copy link
Contributor Author

RNavega commented Oct 16, 2021

So that's about all that would be required

Oh, if I get what you're saying, even after the user authenticates w/ their own personal YT Data API key, we can get their access token, plus the internal API key to play age-gated videos, access private library (My Subscriptions) etc.
If that works then that'd be awesome.

The only thing left is that I saw someone reporting a problem with lack of subtitles, I'd like to check on that.

@jmh2002
Copy link

jmh2002 commented Oct 16, 2021

Oh, if I get what you're saying, even after the user authenticates w/ their own personal YT Data API key, we can get their access token, plus the internal API key to play age-gated videos, access private library (My Subscriptions) etc. If that works then that'd be awesome.

I think that is how the addon used to work isn't it? And that's why we used to have to sign in / authorise twice? Once via YT for TV to get My Subscriptions, and once via our own API keys to get everything else?

The only thing left is that I saw someone reporting a problem with lack of subtitles, I'd like to check on that.

I'm using Alpha 2 without the latest patch from a few hours ago and I can confirm that there didn't seem to be any change to subtitle functionality.

I have always had subtitles enabled, and they continue to work on Kodi 19.1 with Alpha 1 and 2.

THANKS for all your work here @RNavega

And THANKS to you too of course @anxdpanic

👍👍👍

@anxdpanic
Copy link
Owner

Secondary login add back in #219

It fixes some age-gated videos but not all, haven't had time to test My Channel yet.

@RNavega
Copy link
Contributor Author

RNavega commented Oct 16, 2021

Thanks for porting the old code back in, @anxdpanic.

@anxdpanic
Copy link
Owner

Thankfully, the reverting went pretty smoothly so things went nice and quick 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants