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

[BUG] Adding YouTube URL not working #39

Open
adripo opened this issue Oct 4, 2023 · 8 comments
Open

[BUG] Adding YouTube URL not working #39

adripo opened this issue Oct 4, 2023 · 8 comments

Comments

@adripo
Copy link

adripo commented Oct 4, 2023

Add YouTube URL and Check for new videos not working anymore since September 2023.

I checked the config file and found out that the url saved to retrieve video/playlist details returns a 403 error. Maybe that could be the issue.

{
            "URL": "https://www.googleapis.com/youtube/v3/videos?part=contentDetails%2Csnippet&hl=en&id=2ZSHzwkeGSI",
            "Flags": 0,
            "PlaylistID": "{325AD8B6-1855-42E7-A0A4-8A81FFA08DDE}",
            "GroupName": "YouTube"
        },
{
  "error": {
    "code": 403,
    "message": "The request is missing a valid API key.",
    "errors": [
      {
        "message": "The request is missing a valid API key.",
        "domain": "global",
        "reason": "forbidden"
      }
    ],
    "status": "PERMISSION_DENIED"
  }
}
@adripo

This comment was marked as outdated.

@adripo
Copy link
Author

adripo commented Oct 4, 2023

Nevermind, I found out the issue.

The API key used in this project exceeded request quota. I get the following response if I do the request with the default api key:

{
  "error": {
    "code": 403,
    "message": "The request cannot be completed because you have exceeded your \u003ca href=\"/youtube/v3/getting-started#quota\"\u003equota\u003c/a\u003e.",
    "errors": [
      {
        "message": "The request cannot be completed because you have exceeded your \u003ca href=\"/youtube/v3/getting-started#quota\"\u003equota\u003c/a\u003e.",
        "domain": "youtube.quota",
        "reason": "quotaExceeded"
      }
    ]
  }
}

I think the best solution should be to allow users to use their own api key, maybe by adding a textbox in the preferences. what do you think?

@adripo adripo changed the title [BUG] Adding YouTube URL not working since September 2023 [BUG] Adding YouTube URL not working Oct 4, 2023
@cloewen8
Copy link
Contributor

cloewen8 commented Dec 4, 2023

I think the best solution should be to allow users to use their own api key, maybe by adding a textbox in the preferences. what do you think?

I'm working on a pull request for this. Did you ever end up looking into this further?

I noticed all of the endpoints I could find that use the API key, could instead use an OAuth 2.0 token. The plugin even uses OAuth already in some places. If this was to spread out the API quota allowance, I would imagine more of the API requests would be cached, but caching is prevented entirely (Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\n).

Edit: Did more research, did not realize OAuth and the API Key used the same quota. I can absolutely add a Key field to options, including the Client ID and Secret for OAuth (not sure if having the same client and a different key would set off Google security).

@adripo
Copy link
Author

adripo commented Dec 6, 2023

@cloewen8 I temporary solved the issue by manually generating an api key on my account and changing it in the dll.

This is the value that I replaced in mine, without touching client_id or client_secret:
https://github.com/AdrianEddy/AIMPYouTube/blob/master/Config.h#L13

@cloewen8
Copy link
Contributor

cloewen8 commented Dec 6, 2023

without touching client_id or client_secret

In testing I noticed some calls would not work unless the OAuth and key where from the same projects. In those cases I'd have to use the build-in key (I'm providing an option to supply a custom client).

@AdrianEddy
Copy link
Owner

I recompiled from latest master, but I haven't checked it, I don't use AIMP anymore
Please check and let me know if it works
aimp_YouTube_v1.8.zip

@sickplanet
Copy link

Working perfectly now with my own developer keys. thanks!

@adripo
Copy link
Author

adripo commented Jun 22, 2024

Thanks, it works fine with v1.8. You can close the issue once this version is officially released.

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

No branches or pull requests

4 participants