jdf76 / plugin.video.youtube

Kodi's Youtube Plugin -- Please Check the forums before submitting an issue
https://ytaddon.page.link/forum
390 stars 116 forks source link

Personal API Keys are required #736

Open feuille2lune opened 4 years ago

feuille2lune commented 4 years ago

Since today I'm unable to playing any video on Corelec 9.2.1.

It seems that this youtube extension project is on the way to be deleted in Google's API access.

there is the traceback when I lanch a video :

                                        Traceback (most recent call last):
                                          File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/default.py", line 15, in <module>
                                            runner.run(__provider__)
                                          File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/runner.py", line 60, in run
                                            __RUNNER__.run(provider, context)
                                          File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/impl/xbmc/xbmc_runner.py", line 33, in run
                                            results = provider.navigate(context)
                                          File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/abstract_provider.py", line 99, in navigate
                                            result = method(context, re_match)
                                          File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/register_provider_path.py", line 19, in wrapper
                                            return func(*args, **kwargs)
                                          File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/provider.py", line 749, in on_play
                                            return yt_play.play_video(self, context)
                                          File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/yt_play.py", line 86, in play_video
                                            use_play_data=playback_history)
                                          File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/utils.py", line 411, in update_play_info
                                            video_data = resource_manager.get_videos([video_id])
                                          File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/resource_manager.py", line 138, in get_videos
                                            result.update(self._update_videos(list_of_50, live_details))
                                          File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/resource_manager.py", line 121, in _update_videos
                                            if self.handle_error(json_data):
                                          File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/resource_manager.py", line 240, in handle_error
                                            raise Exception(error_message)
                                        Exception: Error reason: |accessNotConfigured| with message: |Project 294899064488 has been scheduled for deletion and cannot be used for API calls. Visit https://console.developers.google.com/iam-admin/projects?pendingDeletion=true to undelete the project.|
                                        -->End of Python script error report<--

2020-02-17 19:19:46.590 T:4092208976 ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.youtube/play/?video_id=dMvn1D5aTY8]

jackojmi commented 4 years ago

Finaly got it to work. Don't know where the error was, something with my old existing project in the Google API I guess.

* Removed youtube plugin with all data from KODI via the KODI GUI.

* removed directories on KODI box
  .kodi/userdata/addon_data/plugin.video.youtube
  .kodi/addons/plugin.video.youtube

* Deleted my old project in Google API (I experimented with API keys before. You dont have to do this if you never registered an API key before.)

* Created a new project in the Google API.
  (My old key I created for testing years ago didnt work, throwing the accessNotConfigured error.)

* Generated Keys in the Google API

* Reinstalled Youtube on KODI

* Setup keys in api_keys.json

* set youtube.allow.dev.keys to false in settings.xml

* Rebooted my KODI box

* Started Youtube addon

* did the google.com/device setup twice

* BAM! it works

what a ride.......

Just want to add what worked for me after trying and failing several times:

For me the critical step was UNchecking "allow developer keys" in Youtube's settings - API section. Did not consider this until I saw it mentioned in the post above. Thanks

daggs1-zz commented 4 years ago

I have never used google code api, I've tried to create one and after all is done, I get this error:

2020-03-02 22:24:41.217 T:3451306864   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.IndexError'>
                                            Error Contents: list index out of range
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/default.py", line 15, in <module>
                                                runner.run(__provider__)
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/runner.py", line 60, in run
                                                __RUNNER__.run(provider, context)
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/impl/xbmc/xbmc_runner.py", line 33, in run
                                                results = provider.navigate(context)
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/abstract_provider.py", line 99, in navigate
                                                result = method(context, re_match)
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/abstract_provider.py", line 132, in _internal_root
                                                return self.on_root(context, re_match)
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/provider.py", line 1485, in on_root
                                                playlists = resource_manager.get_related_playlists(channel_id='mine')
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/resource_manager.py", line 183, in get_related_playlists
                                                result = self._update_channels([channel_id])
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/resource_manager.py", line 50, in _update_channels
                                                channel_id = items[0]['id']
                                            IndexError: list index out of range
                                            -->End of Python script error report<--
2020-03-02 22:24:41.461 T:3463574384   ERROR: GetDirectory - Error getting plugin://plugin.video.youtube/
2020-03-02 22:24:41.473 T:4086857744   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.youtube/) failed

how can I fix this?

anxdpanic commented 4 years ago

@daggs1 Install the latest alpha: https://github.com/jdf76/plugin.video.youtube/releases/tag/6.7.0-dev

daggs1-zz commented 4 years ago

@daggs1 Install the latest alpha: https://github.com/jdf76/plugin.video.youtube/releases/tag/6.7.0-dev

thanks, it worked.

adamsbuilds commented 4 years ago

is there just some work around to not have to do personal api yet? all i need it to do is play videos from other kodi addons.

Seto-A commented 4 years ago

@anxdpanic My problem is not being able to watch movie trailers from the Information context menu of a movie. I went ahead and created personal API per your tutorial, added my personal API, client ID, etc. to YouTube, signed in to YouTube OK, -- BUT still cannot watch movie trailers. Nothing happens when I click on the Trailer button.

I then installed YouTube 6.7.0 Beta per your suggestion a few posts back to @daggs1 , but still cannot watch trailers.

The only thing perhaps non-standard with my Kodi installation is that I have installed the PORTABLE version due to space restrictions on my drive C:

Below are the errors from the log file when I try to watch a trailer. Can you please advise me what is wrong in my case? Thank you!

edit: @anxdpanic removed log snippet

anxdpanic commented 4 years ago

@Seto-A No where in that snippet was YouTube called to do anything. You also have banned add-ons, remove those add-ons and open a new issue with a complete log with debug logging enabled for further support.

israel-lugo commented 4 years ago

Disclaimer: I am an engineer who works for Google. I am not affiliated with YouTube and have no special insight or authority into the specific process affecting this addon. The post below is my own personal opinion.

I got an email from google saying all the old Youtube keys will be deleted. So I deleted all the old projects linked to the old keys. Since google is going to delete it for me in 4 days anyways. You guys will need to create your own key which there are instructions in the first page of the forum.

It seems to me that YouTube is simply trying to perform an audit of your addon, to make sure that it respects the software development principles, i.e. that your software respects user's privacy, doesn't collect data in secret, gives users control, doesn't promote harassment, etc. This is to protect us, your users. It is also particularly important in light of all the recent public controversies surrounding YouTube, e.g. complaints of individual content creators being harassed due to their sexual orientation, videos depicting children in sexually suggestive environments, etc.

Have you tried responding to their request, and explaining that this project is a client-side browser that allows people to view content? You could offer to provide them with a way of testing the software, and/or looking at the code.

Developer API keys are not meant as authentication tokens for individual users. They are meant to authenticate the software (i.e. the YouTube Kodi addon).

The workaround currently being widely advertised is horribly broken. By asking people to generate thousands of developer API keys, you are effectively just masking the fact that we are all users of your software. We will appear as thousands of independent software developers, when we are all merely users of the one program which you develop.

The only reason this works at all is because it makes YouTube blind to the fact that your software is being used by thousands of people, i.e. that all these new "developer" API keys are actually using the same software. Which in turn makes it basically impossible for them to do any audit of the legitimacy of the code.

Please, do not do this. Work with YouTube to get your program reviewed, rather than breaking their audit process by having 10,000 people pose as 10,000 separate developers.

anxdpanic commented 4 years ago

@israel-lugo See, https://github.com/jdf76/plugin.video.youtube/issues/736#issuecomment-587850599 The short of it, the only way to be compliant for verification is for the add-on to not exist. Many features break TOS, including the most primary feature... playback.

Also a large portion of users have been using personal api keys for years, this isn't new to the add-on.

I would definitely prefer the add-on be verfied, and this issue be resolved in that way. I just don't see that being possible, hope I'm wrong.

VGerris commented 4 years ago

works for me. make sure you have a project and that you use the same email account in the box as the one you set API keys on. I used method 1, filling in the settings directly in the field. thanks

Yamakaky commented 4 years ago

Also @israel-lugo, I assume the API key has rate-limiting in the free version that isn't compatible with the scope of this plugin? I think it was the case for NewPipe.

axelsimon commented 4 years ago

Please, do not do this. Work with YouTube to get your program reviewed, rather than breaking their audit process by having 10,000 people pose as 10,000 separate developers

If i may add to this, i'm not really fond of each of us having yet another unique identifier with Google, in the form this time of an API key (yes, i know, many other variables in our setups can be used to uniquely identify us). But further to this general point, if we want to add-on to have any weight with Google, we want all its users to clearly be coming to Youtube "from" the same piece of software, not to dilute the userbase into hundreds or thousands of "unique software projects".

That being said, considering @anxdpanic, the situation doesn't look great. Even with all the users showing up under one API key, i don't imagine there are millions of us watching Youtube videos via a Kodi add-on. Are the TOS that crap that they essentially make plugin.video.youtube "not allowed" to playback videos?

linuxdevhub commented 4 years ago

Thanks @anxdpanic, I followed your steps and Kodi Youtube Addon is working again now. If anyone need video workaround how to fix this problem then you can watch this video: https://youtu.be/DcgXSxPkbvY

trottit commented 4 years ago

@feuille2lune Please keep your keys private. I removed the image, please delete the image and recreate a new project. I'm not able to go over the steps atm to check them. The guide was very recently created, but if things have changed you'll have to see if you can obtain the appropriate keys still and just use the guide as reference.

trottit commented 4 years ago

Thanks for that ,will give it a try as I have tried everything else shows the search list and finds but trys to play for a second without success.