UCSCLibrary / YouTubeImport

This Omeka plugin adds the ability to import Youtube videos into Omeka as items while preserving as much metadata as possible
8 stars 10 forks source link

Youtube quota exceeded #34

Open Bertagit opened 4 years ago

Bertagit commented 4 years ago

After some time we load youtube videos the plugin stop with an error, the youtube quota for the api key is exceeded, updating the key in the /helpers/import.php solve the error. I think theat the key must be a configuration parameter, like video dimensions, in omeka backend, this will avoid the error will appears by the user and every user will use his own api key

Bubbletalk commented 4 years ago

Hi there Bertagit : ) I see you are experiencing a similar issue :

Error importing video. Error calling GET https://www.googleapis.com/youtube/v3/videos?part=id%2Csnippet%2CcontentDetails%2Cplayer%2Cstatus%2CrecordingDetails&id=ACX993ZmEI0&maxResults=1&key=AIzaSyDI8ApsA7MBIK4M1Ubs9k4-Rk7_KOeYJ5w: (403) The request cannot be completed because you have exceeded your quota.

What is the getting started quota? I was using YouTube Import Plugin v1.1.11 without any issues until recently. I configured the display options as suggested 640 X 360 / 100%, but still the same issue. I then updated to v1.3 but the error persists. I'm using the Omeka Thanks, Roy Theme. I have not installed any other new plugins. Any suggestions for how to fix? Please : )

Bertagit commented 4 years ago

Hi Bubbletalk, there is only one solution to solve the issue but you need to modify a configuration file of the plugin.

  1. You need a valid google account;
  2. Login with your google acocunt into Google API dashboard ;
  3. Find the Youtube Data API V3 and open it;
  4. Now you can create a personal key for your google account, click on ENABLE;
  5. In the left menu click on "Credentials" (the last menu label), and "Create credentials"
  6. After this you will have an API Key, you need that in the successive steps

Now you need to have access at your omeka instalaltion. Go to the _omeka_installationdir/plugins/YouTubeImport/helpers ; in this directory you have only one file named import.php, open it with a editor and find the line where the variable $youtube_api_key is defined public static $youtube_api_key = ' the-youtube-key ' Now you have to replace the existing key with to one generated at the step 5 and save; now go to your omeka admin panel and you can use the Youtube plugin.

The problem is the default key used by plugin, every google API service, like youtube, associate a key to a quota, if every one who have the plugin use the same key the quota is shared between every user, if you generate your key you have your own quota. I hope this can help

Bubbletalk commented 4 years ago

Many Thanks Bertagit : ) This fix works perfectly!!!! Add Credentials to your project: YouTube Data API V3 Under where will you be calling the data from? I chose: Web Server, Under what data will you be accessing? I chose: Public Data

Your Step by Step instructions are much appreciated : ) The YouTube Import Plugin is a fantastic plugin : ) Keeps my database lightweight and speeds up the process of inputting data for each field in the record : ) Hats off to you Bertagit for figuring it out : )

Bubbletalk commented 4 years ago

Hi Bertagit, I've posted a link to your fix for the YouTube Import Plugin on my post "Tunnelvision"on the omeka forum: https://forum.omeka.org/t/youtube-import-video-plugin-error/11391 Many Thanks : )

tomroguk commented 1 year ago

I've followed the instructions to create and update the import.php file with my own API Key but still getting this error.

Error importing video. Error calling GET https://www.googleapis.com/youtube/v3/videos?part=id%2Csnippet%2CcontentDetails%2Cplayer%2Cstatus%2CrecordingDetails&id=-hw4UOL7yNY&maxResults=1&key=[My API ky]: (403) The request cannot be completed because you have exceeded your quota.

Are there any other updates I should make or can try to get this working? Many thanks