Issues with YouTube Player: [ERROR] [youtubePlayer.js] YoutubeVideo::exception


#1

PhantomBot Version: 2.4.2 (Revision: 5c75a7b2)
Operating System: Linux
Java Version: 1.8.0_65-b17
Browser and Version (for Panel Support): Browser: Firefox and Chrome / Panel Version: 1.2 (BETA)
Stock PhantomBot: Yes

I’ve noticed multiple posts where users are having similar issues, but I have yet to find an answer other than “have you acquired the YouTube API key?” then the post is closed. I’m genuinely interested if this is going to be fixed, something that is legitimately wrong with how the API key for YouTube is being procured, or if this is something that we will just need to live with in the future. I may not have exhausted my searching, so if this has been addressed elsewhere, please forward me there.

I am receiving the following errors whenever I attempt to add any video via the !songrequest:

Console:

[01-04-2019 @ 21:37:13.882 GMT] [♫] YouTube Player is connected! [♫]
[01-04-2019 @ 21:37:14.206 GMT] [ERROR] [youtubePlayer.js:109] YoutubeVideo::exception: This video is not allowed to be embedded (ID: vY_kyk8yL9U)
[01-04-2019 @ 21:37:14.256 GMT] [ERROR] [youtubePlayer.js:116] YoutubeVideo::exception: This video is not allowed to be embedded (ID: q_Wk_dn-jEg)
[01-04-2019 @ 21:37:14.299 GMT] [ERROR] [youtubePlayer.js:123] YoutubeVideo::exception: This video is not allowed to be embedded (ID: 5WRZ-bC5XzE)
[01-04-2019 @ 21:37:14.341 GMT] [ERROR] [youtubePlayer.js:130] YoutubeVideo::exception: This video is not allowed to be embedded (ID: 9Y5CCHacHfk)
[01-04-2019 @ 21:37:15.693 GMT] [ERROR] [init.js:325] (hook.call, yTPlayerState, ./systems/youtubePlayer.js) No data returned.
[01-04-2019 @ 21:37:31.540 GMT] [♫] YouTube Player is disconnected! [♫]

Yes, I have my own YouTube API and I have added it to the botlogin.txt in the config folder. I’m not sure if I am supposed to place it within the YouTube player configuration as well or not but per the note at the top of that file it says that it will be auto-generated when the bot starts.

My question again, do we need to just forget about song requests on PhantomBot? If so, is there a way to disable the !songrequests so I can setup a standalone bot to handle it? Not attempting to be rude, but it is extremely frustrating.


#2

BantomPhot hit me on the side and asked:

Did you try !ytp clearcache in twitch chat?

I did and received the following output:

Chat:

SippyCup540: !ytp clearcache
Bot: @SippyCup540, This will remove all cached YouTube Player IDs. If you are sure, run !ytp clearcache now
SippyCup540: !ytp clearcache now
Bot: @SippyCup540, YouTube Player ID cache has been cleared.

Console:

[01-04-2019 @ 22:31:42.128 GMT] sippycup540: !ytp clearcache now
[01-04-2019 @ 22:31:42.160 GMT] [CHAT] @SippyCup540, YouTube Player ID cache has been cleared.
[01-04-2019 @ 22:31:49.242 GMT] [♫] YouTube Player is connected! [♫]
[01-04-2019 @ 22:31:50.049 GMT] [ERROR] [youtubePlayer.js:109] YoutubeVideo::exception: This video is not allowed to be embedded (ID: vY_kyk8yL9U)
[01-04-2019 @ 22:31:50.343 GMT] [ERROR] [youtubePlayer.js:116] YoutubeVideo::exception: This video is not allowed to be embedded (ID: q_Wk_dn-jEg)
[01-04-2019 @ 22:31:50.720 GMT] [ERROR] [init.js:325] (hook.call, yTPlayerState, ./systems/youtubePlayer.js) No data returned.
[01-04-2019 @ 22:31:50.734 GMT] [ERROR] [youtubePlayer.js:123] YoutubeVideo::exception: This video is not allowed to be embedded (ID: 5WRZ-bC5XzE)
[01-04-2019 @ 22:31:51.041 GMT] [ERROR] [youtubePlayer.js:130] YoutubeVideo::exception: This video is not allowed to be embedded (ID: 9Y5CCHacHfk)

It appears that this didn’t clear the cache, but I did notice this error is showing up each time I open the YouTube player:

01-04-2019 @ 22:24:14.773 GMT] [ERROR] [init.js:325] (hook.call, yTPlayerState, ./systems/youtubePlayer.js) No data returned.

Could this be the issue? All I’m seeing is a black screen with a swirling purple circle when I open the YouTube.


#3

A newer Nightly Build displays more information about the error. My guess is that your YouTube API key is incorrect and so when being checked, an error occurs, and all that is returned is that the video is not embeddable.

For example. this is with the Nightly Build that provides more information. Note that I messed up my key (you won’t see the additional error messages unless on the new Nightly):

[01-04-2019 @ 17:36:28.382 MST] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTubeAPIv3 Error: [Domain] usageLimits [Reason] keyInvalid
[01-04-2019 @ 17:36:28.384 MST] [ERROR] [youtubePlayer.js:743] YoutubeVideo::exception: This video is not allowed to be embedded (ID: vY_kyk8yL9U)
[01-04-2019 @ 17:36:28.422 MST] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTubeAPIv3 Error: [Domain] usageLimits [Reason] keyInvalid
[01-04-2019 @ 17:36:28.424 MST] [ERROR] [youtubePlayer.js:743] YoutubeVideo::exception: This video is not allowed to be embedded (ID: q_Wk_dn-jEg)
[01-04-2019 @ 17:36:28.465 MST] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTubeAPIv3 Error: [Domain] usageLimits [Reason] keyInvalid
[01-04-2019 @ 17:36:28.467 MST] [ERROR] [youtubePlayer.js:743] YoutubeVideo::exception: This video is not allowed to be embedded (ID: 5WRZ-bC5XzE)
[01-04-2019 @ 17:36:28.507 MST] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTubeAPIv3 Error: [Domain] usageLimits [Reason] keyInvalid
[01-04-2019 @ 17:36:28.509 MST] [ERROR] [youtubePlayer.js:743] YoutubeVideo::exception: This video is not allowed to be embedded (ID: 9Y5CCHacHfk)
[01-04-2019 @ 17:36:28.548 MST] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTubeAPIv3 Error: [Domain] usageLimits [Reason] keyInvalid
[01-04-2019 @ 17:36:28.550 MST] [ERROR] [youtubePlayer.js:743] YoutubeVideo::exception: This video is not allowed to be embedded (ID: jOY1sjlJ6A8)
[01-04-2019 @ 17:36:28.889 MST] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTubeAPIv3 Error: [Domain] usageLimits [Reason] keyInvalid
[01-04-2019 @ 17:36:28.929 MST] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTubeAPIv3 Error: [Domain] usageLimits [Reason] keyInvalid
[01-04-2019 @ 17:36:28.967 MST] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTubeAPIv3 Error: [Domain] usageLimits [Reason] keyInvalid
[01-04-2019 @ 17:36:29.010 MST] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTubeAPIv3 Error: [Domain] usageLimits [Reason] keyInvalid
[01-04-2019 @ 17:36:29.049 MST] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTubeAPIv3 Error: [Domain] usageLimits [Reason] keyInvalid

#4

First, thank you IllusionaryOne for your reply.

That’s what it would appear, but I even clicked the “copy” option in the browser to ensure that it was correct. I placed it in the botlogin.txt beside youtubekey= and even let it regenerate the ytauth and ytauthro keys on the next reboot. Still no joy.


#5

I would recommend trying the latest nightly then which provides more information in the error output.

You can install it into a new directory, copy your config/ folder, and give it a go. Then swap back to your stable version of PhantomBot.


#6

Will attempt that now and report back. Thank you for your help!


#7

Welcome! Sorry for the painful ask of trying to use a nightly to get better debugging/error information. Something we discovered at one point when having the round of key issues last month and added in more information to help troubleshoot.


#8

Quite alright. I’ll gladly walk through troubleshooting Hell so to speak if it saves another from having to do the same!


#9

@IllusionaryOne

Output from the Nightly Build appears to tell the tale!

Console:

 [01-05-2019 @ 00:48:25.137 GMT] [♫] YouTube Player is connected! [♫]
[01-05-2019 @ 00:48:25.690 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:25.760 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:25.823 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:25.876 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:25.935 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:25.942 GMT] [ERROR] [youtubePlayer.js:109] YoutubeVideo::exc                                                                                             eption: This video is not allowed to be embedded (ID: vY_kyk8yL9U)
[01-05-2019 @ 00:48:26.089 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.160 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.224 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.284 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.351 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.369 GMT] [ERROR] [youtubePlayer.js:116] YoutubeVideo::exc                                                                                             eption: This video is not allowed to be embedded (ID: q_Wk_dn-jEg)
[01-05-2019 @ 00:48:26.534 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.593 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.647 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.683 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.704 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.754 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.784 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.793 GMT] [ERROR] [youtubePlayer.js:123] YoutubeVideo::exc                                                                                             eption: This video is not allowed to be embedded (ID: 5WRZ-bC5XzE)
[01-05-2019 @ 00:48:26.813 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.875 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.938 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.941 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:26.944 GMT] [ERROR] [onEvent()@ScriptEventManager.java:79] F                                                                                             ailed to dispatch event tv.phantombot.event.ytplayer.YTPlayerStateEvent
[01-05-2019 @ 00:48:27.003 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:27.068 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:27.133 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:27.196 GMT] [ERROR] [GetData()@YouTubeAPIv3.java:130] YouTub                                                                                             eAPIv3 Error: [Domain] usageLimits [Reason] accessNotConfigured
[01-05-2019 @ 00:48:27.204 GMT] [ERROR] [youtubePlayer.js:130] YoutubeVideo::exc                                                                                             eption: This video is not allowed to be embedded (ID: 9Y5CCHacHfk)

Whatever the accessNotConfigured seems to be the reasoning behind it. However, I am able to get into the YouTube player now which is lovely! I wasn’t able to get that far before. Hopefully I can mess with the API on Google’s side to correct this. Are there any specific settings that I need to look for? I followed the API key retrieval guide but perhaps I missed something.

Thanks again for your assistance!


#10

It may be that YouTube API is not setup for the key. It should look something like this:

Dashboard:

Credentials:

Open the Credential:

Also, if you are using any access restrictions, double check those (some folks link it to only an IP).

If it still doesn’t work, delete your key. Make sure that the YouTube Data API is enabled and create a new API key. See if that helps. Sometimes Google loses the link between the key and the API type.


#11

Other possibilities:


#12

@IllusionaryOne:

Sooo looks like I have bigger issues over on the Google API side of things… Looks like they’ve limited my API usage. Using my streaming email address, I generated another key and am now able to utilize the player on the Nightly. However, it seems the video’s I’m requesting are getting error 150’d (unable to embed) even still due to copyright, country, or uploader restrictions.

I am able to play songs that aren’t restricted, however, I’m curious as to how Song Requests are being accomplished with the StreamLab’s bot (I know you cannot speak to their methods) as that bot seems to allow pretty much anything and everything to be played. My best guess is it’s loading the .mp3 or .m4a directly by some other means (possibly python’s youtube-dl). But alas, this issue is resolved!

Recap:

  • Issue with YouTube Player not accepting any songs nor loading when clicked.
  • Tested with Nightly build to gain logs that showed issue with API key access restrictions
  • Solution was to use a separate account to generate a new API key all together as the original account has been limited by the amount of queries it can process (thanks Google).

Again, @IllusionaryOne, thank you for your assistance!


#13

It could be that they are downloading the files and playing them, which is against the YouTube TOS, hence why we don’t. There are definitely bots that ignore that part of the TOS but we try to keep things on the up and up.

Glad you were able to get it working. I was using three accounts at one point to spread around my quotas. Also glad that the extra information in the Nightly helped track it down! That will be in the next stable at least!