Kodi Community Forum

Full Version: YouTube Plug-in Thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Instead of using a "pool" of API's would it be possible to:

At first run, the Youtube addon:

1. Allows the user to login.
2. Goes through activation.
3. Initiates a script that interacts with the google credentials page.
4. Creates a API key + secret for the user's google login.
5. Imports that API key + secret into the Youtube addon "API key section".

This way each user has his or her own key without having to create it themselves manually.
Not really, each API key is tied to a google account. The API key is designed for the Client and not for the end user. just think of how many keys you would need to make for say 5,000 users.

There is a way to do it, i just have to figure out how. For now the way Version 5 does it will work.

Thanks
Jeff

(2016-04-05, 04:36)kgoerbig Wrote: [ -> ]Instead of using a "pool" of API's would it be possible to:

At first run, the Youtube addon:

1. Allows the user to login.
2. Goes through activation.
3. Initiates a script that interacts with the google credentials page.
4. Creates a API key + secret for the user's google login.
5. Imports that API key + secret into the Youtube addon "API key section".

This way each user has his or her own key without having to create it themselves manually.
Quote:My feeling is that the "default" sort is probably how YouTube sends the data with no manipulation. YouTube simply sends it in reverse chronological order. The sorting in the addon is completely broken, so if you choose anything other than default, it goes crazy. But that's just my guess, I didn't look at the code. I just know it's broken.

@rodalpho
If you klick in your webbrowser in Youtube at Subscriptions, the sorting should be the same like in kodi. Can you confirm that? Maybe some pictures would be helpful Smile
I checked this yesterday at my installation on Windows and all seems fine to me.

Quote:So you believe the only proper way to sort by date is "default" sort, and selecting "sort by date" should sort completely out of order? And also, that the sorting should simply break on later pages. Is that what you're saying?
Yes. After sorting with sorting tool from confluence, the sorting was broken. I don't look if I could find a schema.
(2016-04-02, 19:47)jdf76 Wrote: [ -> ]Change Log:

5.1.20.7 (2016-04-04)
[add] 'Use random key pool' in add-on settings gui by misty01
[upd] All string.po for new random key pool functionality
[add] Random key pool by ntdrt, modified by misty01
[add] API keys used for random key pool by Kolifanes
[add] Greek Translation by twilight0
[upd] Italian translation by DjDiabolik
[fix] Typos in German translation by philippbeckmann
[fix] Typos in addon.xml -- jdf
[upd] Reworked main page just a little bit. took out donation work since it's no longer maintained by bromix.

Can't we also update the other files to reflect the new mgmt, but also acknowledge bromix's original contribution?
@h0d3nt3uf3l: Yes, obviously it works fine on youtube.com, and if you select "default sort, ascending" in the youtube addon it works too. What doesn't work is explicitly sorting by date inside the youtube kodi addon, in the "my subscriptions" view.

So by "yes" you are stating that you think sorting in the addon should not work? That is what you truly believe? Can you explain your reasoning, please?

@jdf76: IMO, the best way to handle this is the following process.
  1. Generate a pool of API keys. Like 100 of them-- probably take a couple hours of annoying effort creating google accounts and keys. People in the forum can help doing 5 apiece, make it a communal effort. Save that pool on github.

  2. On first run, the addon downloads the API key pool and a blacklist file from github

  3. When the user first signs in, the addon randomly selects one key from the pool that is not in the blacklist

  4. If the key starts to fail due to any reason including API limits, the addon:
    a) Submits a report on the overused key to a google form, which appends it to the blacklist file
    b) Refreshes (re-downloads) the API key pool and blacklist file from github
    c) Prompts the user to sign back in to get a new key

  5. Done!

Then whenever the blacklist gets long, altruistic volunteers can simply register more API keys and submit them to another google form for the addon maintainers to append to the master pool. It's a self-sustaining process. That shouldn't happen often because one API key can handle a fair number of requests-- remember two API keys could handle every Kodi user in the entire world until like 5PM at night.
@rodalpho
Its surely not impossible but it's a bit difficult I think because of the connection to the skin. I see what I can do. Maybe the video object only need the date and time as special property, so the skin can read and proceed it. I'll keep on working on it, know I have another view at this problem Smile
I think google would notice 1 account with 100 API keys. Honestly there has got to be a better way to do this than just creating new keys and asking people to create their own key. I just need to sit down and watch the plugin work and figure out how it runs and how it interacts with youtube.com and also figure out how youtube.com using these API keys, mainly because i don't see a reason why it should need 2 hello's when the youtube.com/tv one only uses 1.

Since version 5 works ok right now, I would like to sit down and just watch the plugin work. I need to do a repo tonight, so right now my steps are

1. Make Repo
2. dissect youtube
3. Update short range problem
4. Make long range fix

etc etc etc

Thanks
jeff



(2016-04-05, 15:46)rodalpho Wrote: [ -> ]@jdf76: IMO, the best way to handle this is the following process.
  1. Generate a pool of API keys. Like 100 of them-- probably take a couple hours of annoying effort creating google accounts and keys. People in the forum can help doing 5 apiece, make it a communal effort. Save that pool on github.

  2. On first run, the addon downloads the API key pool and a blacklist file from github

  3. When the user first signs in, the addon randomly selects one key from the pool that is not in the blacklist

  4. If the key starts to fail due to any reason including API limits, the addon:
    a) Submits a report on the overused key to a google form, which appends it to the blacklist file
    b) Refreshes (re-downloads) the API key pool and blacklist file from github
    c) Prompts the user to sign back in to get a new key

  5. Done!

Then whenever the blacklist gets long, altruistic volunteers can simply register more API keys and submit them to another google form for the addon maintainers to append to the master pool. It's a self-sustaining process. That shouldn't happen often because one API key can handle a fair number of requests-- remember two API keys could handle every Kodi user in the entire world until like 5PM at night.
I'm not going to remove bromix as the author because he wrote the plugin. Until i deem the plugin has changed enough, i may change the author, but i wont change the files un-necessarily.

thank you,
Jeff

(2016-04-05, 15:37)twilight0 Wrote: [ -> ]
(2016-04-02, 19:47)jdf76 Wrote: [ -> ]Change Log:

5.1.20.7 (2016-04-04)
[add] 'Use random key pool' in add-on settings gui by misty01
[upd] All string.po for new random key pool functionality
[add] Random key pool by ntdrt, modified by misty01
[add] API keys used for random key pool by Kolifanes
[add] Greek Translation by twilight0
[upd] Italian translation by DjDiabolik
[fix] Typos in German translation by philippbeckmann
[fix] Typos in addon.xml -- jdf
[upd] Reworked main page just a little bit. took out donation work since it's no longer maintained by bromix.

Can't we also update the other files to reflect the new mgmt, but also acknowledge bromix's original contribution?
(2016-04-05, 03:28)MetalChris Wrote: [ -> ]
(2016-04-05, 03:21)paksen Wrote: [ -> ]I must be all horked up. I've got 5.1.20.5 installed. I don't get a login option but do see login failed errors. I have uninstalled and re-installed. Tried the setup wizard which only seemed to ask for language and region settings (and United States was missing from the regions). It seems you folks are working furiously on getting this up and running and I can certainly wait a few more days. I just want to know, what all do I have to delete after I uninstall the plugin to get a fresh clean start?

Thanks in advance

Paksen

Delete the plugin.video.youtube folder in the addon_data folder. The addon_data folder is located in your userdata folder.

Thanks. That did the trick.
Thanks!

Thanks to Jeff (jdf76) and all who are working on this. I'm happy to have YouTube back on my OSMC.
(2016-04-05, 18:35)jdf76 Wrote: [ -> ]I think google would notice 1 account with 100 API keys. Honestly there has got to be a better way to do this than just creating new keys and asking people to create their own key. I just need to sit down and watch the plugin work and figure out how it runs and how it interacts with youtube.com and also figure out how youtube.com using these API keys, mainly because i don't see a reason why it should need 2 hello's when the youtube.com/tv one only uses 1.
It doesn't need 2 hellos for any given action-- the two keys are used by different parts of the addon. I vaguely remember Bromix saying logged-in search used one, logged-in everything else the other, and not logged-in used a third. This was done to address API limits.

They would definitely notice 1 account with 100 keys-- I didn't even realize you could create more than one key per account. I assumed you would need 100 separate google accounts.

I doubt there's any way to get around this. Google doesn't want anyone to use the API for general purpose YouTube applications, because they allow users to download video, don't show google's branding, and don't show their ads. They create apps for iOS and android, and want everybody else to use their HTML5 web application at https://youtube.com/tv.
On the development-site from google there is a Quota Calculator. Maybe interesting.

@rodalpho
I saw in the code that bromix used a youtube.com/tv-link to get the json from the "My Subscriptions" (think this dont use Quota?)
In this informations you get with this methode, there is "1 day ago" / "2 weeks ago" the only hint of the submittion-date. To get the date and time from the uploading, we had to get it from each video seperately.
This request cost 3 quota, for 50 vids per page = 150 for 3 pages = 450 for 200 users = 90000.
I don't found the current limits of the quotas, did anybody know these? Don't want to produce a quota-killer-code Big Grin
great job you re doing on the addon
5.1.20.5 still working well for me
but I found kind of issue when I change region using addon wizard I can't access to popular right now section with message "unkhnown kind " but with default region it worked
I have kodi jarvis on win7 laptop
do you have any idea ?
thanks
Zombi,

Thanks for the information. I'll look into that, but usually the "unknown kind" issue is dealing with the API. Which region did you have that issue with?

Thanks
Jeff

(2016-04-05, 23:55)Zombi Wrote: [ -> ]great job you re doing on the addon
5.1.20.5 still working well for me
but I found kind of issue when I change region using addon wizard I can't access to popular right now section with message "unkhnown kind " but with default region it worked
I have kodi jarvis on win7 laptop
do you have any idea ?
thanks
I tried different regions Tunisia , France don't work but worldwide and uk work fine than the weird thing when i tried french language with france region it worked english lg wit uk and world work but english with france don't work and french with world don't work but dutch with nederland worked

(2016-04-05, 23:58)jdf76 Wrote: [ -> ]Zombi,

Thanks for the information. I'll look into that, but usually the "unknown kind" issue is dealing with the API. Which region did you have that issue with?

Thanks
Jeff

(2016-04-05, 23:55)Zombi Wrote: [ -> ]great job you re doing on the addon
5.1.20.5 still working well for me
but I found kind of issue when I change region using addon wizard I can't access to popular right now section with message "unkhnown kind " but with default region it worked
I have kodi jarvis on win7 laptop
do you have any idea ?
thanks