calzoneman / sync

Node.JS Server and JavaScript/HTML Client for synchronizing online media
Other
1.45k stars 235 forks source link

Fix '/youtube/v3/search was not found' in config sample #895

Closed AlexandriaOL closed 3 years ago

AlexandriaOL commented 3 years ago

What it says on the tin. Fix the sample curl request so it doesn't error.

calzoneman commented 3 years ago

The existing one works fine:

$ export YOUTUBE_API_KEY='<snip>'
$ curl "https://www.googleapis.com/youtube/v3/search?key=$YOUTUBE_API_KEY&part=id&maxResults=1&q=test+video&type=video"
{
  "kind": "youtube#searchListResponse",
  "etag": "xDGVEwA4PHypG4tDJboOkldp5dg",
  "nextPageToken": "CAEQAA",
  "regionCode": "US",
  "pageInfo": {
    "totalResults": 1000000,
    "resultsPerPage": 1
  },
  "items": [
    {
      "kind": "youtube#searchResult",
      "etag": "s5Kj5v_Hspi8H8OifxluVhM7tTY",
      "id": {
        "kind": "youtube#video",
        "videoId": "LXb3EKWsInQ"
      }
    }
  ]
}

If you received an error, perhaps your key is configured incorrectly.

calzoneman commented 3 years ago

The documentation also suggests that https://www.googleapis.com/youtube/v3/search is the correct URL.

screenshot-2021-01-08_19-54-31

AlexandriaOL commented 3 years ago

Yeah, turns out there's a difference between getting the API key directly through apis and services -> youtube v3 data api -> credentials (which doesn't work) as opposed to apis and services -> credentials :/