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 · 13 comments
Open

[BUG] Adding YouTube URL not working #39

adripo opened this issue Oct 4, 2023 · 13 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.

@laughtingman
Copy link

Comrades, so what about the possibility to add keys to the settings tab of the plugin? As I understand it would solve all the problems. Now you can't use the plugin if you don't know how to build a project from sources.

@sickplanet
Copy link

sickplanet commented Nov 16, 2024

Comrades, so what about the possibility to add keys to the settings tab of the plugin? As I understand it would solve all the problems. Now you can't use the plugin if you don't know how to build a project from sources.

Now you can't read properly what @AdrianEddy said above, apparently 🤏:

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

@laughtingman
Copy link

laughtingman commented Nov 16, 2024

Comrades, so what about the possibility to add keys to the settings tab of the plugin? As I understand it would solve all the problems. Now you can't use the plugin if you don't know how to build a project from sources.

Now you can't read properly what @AdrianEddy said above, apparently 🤏:

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

But there is no x64 build in this archive and it is not in the releases section…

Ok, I reinstalled AIMP to 32bit and yes, the 1.8 version workes with key property. Thank you.

@cloewen8
Copy link
Contributor

But there is no x64 build in this archive and it is not in the releases section…

What is needed to get a x64 build working? I'd be interested in contributing.

I no longer use this plugin, but feel it is very important in the Aimp ecosystem.

@AdrianEddy
Copy link
Owner

x64 build is available here #30 (comment)

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

5 participants