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

Getting "An error occurred. Please try again later. [...]" frequently. #60

Closed
mzso opened this issue Oct 5, 2017 · 17 comments
Closed

Comments

@mzso
Copy link

mzso commented Oct 5, 2017

Hi!

I've been getting this recently, maybe maia-yt has a hand in it, because I started experiencing it in roughly the same timeframe as I've been using maia.
It seems to happen after a youtube tab was idle for a while. Either a video page or after opening a video from an idle search page.

Here's an example of YT's debug info:

{
  "ns": "yt",
  "el": "detailpage",
  "cpn": "NRNsCIK4jCwxH__e",
  "ver": 2,
  "cmt": "0",
  "fs": "0",
  "rt": "22.407",
  "euri": "",
  "lact": 5,
  "cl": "",
  "mos": 0,
  "state": "80",
  "volume": 21,
  "c": "WEB",
  "cver": "1.20171004",
  "cplayer": "UNIPLAYER",
  "cbr": "Firefox",
  "cbrver": "56.0",
  "cos": "Windows",
  "cosver": "6.3",
  "hl": "en_US",
  "cr": "HU",
  "len": "0",
  "fexp": "23700224,23700451,23700586,23702322,23702700,23703266,23703840,23704161,23704248,23704745,23705218,23705739,23706129,9410705,9422596,9431754,9441152,9449243,9463611,9463830,9466594,9467502,9471239,9474594,9476026,9476327,9477103,9477113,9480475,9483010,9484238,9484473,9485000,9488038",
  "vct": "0.000",
  "vd": "NaN",
  "vpl": "",
  "vbu": "",
  "vpa": "true",
  "vsk": "false",
  "ven": "false",
  "vpr": "1",
  "vrs": "0",
  "vns": "0",
  "vec": "null",
  "vvol": "0.21",
  "creationTime": 3084666.865,
  "totalVideoFrames": 0,
  "droppedVideoFrames": 0,
  "corruptedVideoFrames": 0,
  "debug_error": {
    "errorCode": "api.invalidparam",
    "errorDetail": "invalidVideodata.1",
    "message": "An error occurred. Please try again later.",
    "messageKey": "YTP_ERROR_GENERIC_WITHOUT_LINK"
  },
  "relative_loudness": "NaN",
  "user_qual": "small",
  "0sz": false,
  "op": "",
  "yof": false,
  "dis": "",
  "gpu": "ANGLE_(NVIDIA_GeForce_GTS_450_Direct3D11_vs_5_0_ps_5_0)",
  "cgr": true,
  "debug_playbackQuality": "unknown",
  "debug_date": "Thu Oct 05 2017 15:20:51 GMT+0200"
}
@YePpHa
Copy link
Owner

YePpHa commented Oct 5, 2017

I've not experienced this but I'm also on Chrome and not Firefox. Next time you get this bug could you go to the developer console and post the content of the console here. Remember to allow for verbose logs otherwise most of the debug logging of Maia wont show up.

@alindt
Copy link

alindt commented Oct 7, 2017

I'm on Chromium and I get this too from time to time.

YouTube Debug Info:

{
  "cpn": "gzTdGIRDVsFRuwNU",
  "vct": "0.000",
  "vd": "NaN",
  "vpl": "",
  "vbu": "",
  "vpa": "true",
  "vsk": "false",
  "ven": "false",
  "vpr": "1",
  "vrs": "0",
  "vns": "0",
  "vec": "null",
  "vvol": "1",
  "state": "80",
  "debug_error": {
    "errorCode": "api.invalidparam",
    "errorDetail": "invalidVideodata.1",
    "message": "An error occurred. Please try again later.",
    "messageKey": "YTP_ERROR_GENERIC_WITHOUT_LINK"
  },
  "relative_loudness": "NaN",
  "user_qual": "hd720",
  "0sz": false,
  "op": "",
  "yof": false,
  "dis": "",
  "gpu": "Mesa_DRI_Intel(R)_Ivybridge_Mobile_",
  "cgr": true,
  "debug_playbackQuality": "unknown",
  "debug_date": "Sat Oct 07 2017 07:34:09 GMT+0300 (EEST)"
}

Verbose console log: www.youtube.com-1507350240030.log

@YePpHa
Copy link
Owner

YePpHa commented Oct 7, 2017

Interesting, I would assume it has something to do with the updateVideoData that causes the issue. It was the last API call being made to the player before the error occurred. I currently do not log the arguments that's being passed only the that it has been called.

I'm not sure what can cause updateVideoData to throw the global api.invalidparam error. However, I might extend the logging of API calls to allow for logging of arguments.

@alindt
Copy link

alindt commented Oct 7, 2017

Maybe is has something to do with ad blocking?
@mzso, are you using adblockers?

@YePpHa
Copy link
Owner

YePpHa commented Oct 7, 2017

Hmm, not sure. I have adblocking enabled by default (though I also have uBlock Origin enabled). If you experience this again could you try to enter the following into the console and post the result here:

document.querySelector("#movie_player").getVideoData()

@alindt
Copy link

alindt commented Oct 7, 2017

yt

@YePpHa
Copy link
Owner

YePpHa commented Oct 7, 2017

It seems like I intercept the updateVideoData API call and pass the first argument to the rest of Maia. All the modules will then modify the data and return the modified data that will be sent to the YouTube player. In most cases it will contain the video data as in what in ytplayer.config.args. However, in some cases it will just contain { 'rvs': ... } as it updates the video feed on the right side.

I will be making some restriction so that the data will only be modified if video_id is defined in the data object. Hopefully, this will fix the issue, but I have currently no way of testing this.

Test version with the restriction: maia.user.js.zip

@alindt
Copy link

alindt commented Oct 7, 2017

@YePpHa, I've set up TeamViewer on a machine where the issue appears so you can test hands-on.
Please check your email.

@mzso
Copy link
Author

mzso commented Oct 7, 2017

@YePpHa commented on 2017. okt. 7. 19:49 CEST:

It seems like I intercept the updateVideoData API call and pass the first argument to the rest of Maia. All the modules will then modify the data and return the modified data that will be sent to the YouTube player. In most cases it will contain the video data as in what in ytplayer.config.args. However, in some cases it will just contain { 'rvs': ... } as it updates the video feed on the right side.

I will be making some restriction so that the data will only be modified if video_id is defined in the data object. Hopefully, this will fix the issue, but I have currently no way of testing this.

Test version with the restriction: maia.user.js.zip

Cool. I'll check back if it happens again.

@mzso
Copy link
Author

mzso commented Oct 8, 2017

@YePpHa commented on 2017. okt. 5. 15:44 CEST:

I've not experienced this but I'm also on Chrome and not Firefox. Next time you get this bug could you go to the developer console and post the content of the console here. Remember to allow for verbose logs otherwise most of the debug logging of Maia wont show up.

I still got this. But instead when I started playback quickly after opening a video from a search page. (The loading fo the page, may or may not have finished. I can't say.)

Though I didn't have anything in the log. Do I have to have it open before (aka all the time)?
Which section is relevant? (In FF) Logging? Server? Net? (I had security and logging disabled.)
I might have had it disabled, I get a lot of noise in general due to all the addons and userscripts.

Anyway I have the youtube debug info:

{
  "ns": "yt",
  "el": "detailpage",
  "cpn": "B08qs6nEFXfStTj8",
  "ver": 2,
  "cmt": "0",
  "fs": "0",
  "rt": "56.831",
  "euri": "",
  "lact": 4,
  "cl": "",
  "mos": 0,
  "state": "80",
  "volume": 41,
  "c": "WEB",
  "cver": "1.20171005",
  "cplayer": "UNIPLAYER",
  "cbr": "Firefox",
  "cbrver": "56.0",
  "cos": "Windows",
  "cosver": "6.3",
  "hl": "en_US",
  "cr": "HU",
  "len": "0",
  "fexp": "23700224,23700451,23700586,23702322,23702700,23703266,23703286,23703840,23704161,23704248,23704745,23705739,23706129,9410705,9422596,9431754,9439830,9449243,9463830,9466594,9467502,9471239,9474594,9475644,9476026,9476327,9477103,9477113,9480475,9483010,9484238,9484473,9485000,9488038",
  "vct": "0.000",
  "vd": "NaN",
  "vpl": "",
  "vbu": "",
  "vpa": "true",
  "vsk": "false",
  "ven": "false",
  "vpr": "1",
  "vrs": "0",
  "vns": "0",
  "vec": "null",
  "vvol": "0.41",
  "creationTime": 60889.855,
  "totalVideoFrames": 0,
  "droppedVideoFrames": 0,
  "corruptedVideoFrames": 0,
  "debug_error": {
    "errorCode": "api.invalidparam",
    "errorDetail": "invalidVideodata.1",
    "message": "An error occurred. Please try again later.",
    "messageKey": "YTP_ERROR_GENERIC_WITHOUT_LINK"
  },
  "relative_loudness": "NaN",
  "user_qual": "hd1080",
  "0sz": false,
  "op": "",
  "yof": false,
  "dis": "",
  "gpu": "ANGLE_(NVIDIA_GeForce_GTS_450_Direct3D11_vs_5_0_ps_5_0)",
  "cgr": true,
  "debug_playbackQuality": "unknown",
  "debug_date": "Sun Oct 08 2017 07:51:41 GMT+0200"
}

@mzso
Copy link
Author

mzso commented Oct 8, 2017

Well I got this when filtering for "maia".
Not sure if it helps. (I loaded this github page before copying, so I suppose that's why it appears in the log)
console-maia.txt

@mzso
Copy link
Author

mzso commented Oct 8, 2017

The stupid webconsole doesn't have timecodes, but I think the latest messages were this just now when it happened:

+OnContentLoad :: 11 cysOverlay.js:3101
Hiba a(z) „cursor” értékének értelmezése közben.  A deklaráció el lett dobva.  watch:1:1028
Ismeretlen tulajdonság: „user-select”.  A deklaráció el lett dobva.  reps.css:218:13
A Webkonzol naplózási API-ját (console.log, console.info, console.warn, console.error) letiltotta egy parancsfájl ezen az oldalon.
[App] Player d19f968d-2375-4a98-ba57-b6d6a1a285d3 API -> getPlayerState  maia.user.js:15
GET XHR https://googleads.g.doubleclick.net/pagead/id [1 ms]
POST XHR https://www.youtube.com/youtubei/v1/log_event [HTTP/2.0 200 OK 308 ms]
POST XHR https://www.youtube.com/youtubei/v1/log_interaction [HTTP/2.0 200 OK 1315 ms]
[App] Player d19f968d-2375-4a98-ba57-b6d6a1a285d3 API -> getPlayerState maia.user.js:15
POST XHR https://www.youtube.com/youtubei/v1/log_event [HTTP/2.0 200 OK 219 ms]
[App] Player d19f968d-2375-4a98-ba57-b6d6a1a285d3 API -> getPlayerState maia.user.js:15
POST XHR https://www.youtube.com/youtubei/v1/log_event [HTTP/2.0 200 OK 289 ms]

@mzso
Copy link
Author

mzso commented Oct 8, 2017

It seems to always happen when I search for something. Left click to load a video, then click again to press play. (Enable prevent auto-play=stop)

I ~always use a keyword (bookmark) search in firefox (http://www.youtube.com/results?search_query=%s or http://www.youtube.com/results?filters=hd&lclk=hd&search_query=%s)
So the youtube page is not loaded beforehand. It doesn't happen if I just search by typing in the youtube search field.
EDIT:
It also happens if I simply middle click this link:
https://www.youtube.com/results?search_query=something

So I guess it's related somehow to loading a youtube search url directly.

@YePpHa
Copy link
Owner

YePpHa commented Oct 8, 2017

@mzso thank you for that. I was able to recreate the issue.

@YePpHa
Copy link
Owner

YePpHa commented Oct 8, 2017

I found the code responsible for the issue.

The issue is that I for some reason prevent loadVideoByPlayerVars from being called if the player is ready.

if (this._ready[id] && (name === "loadVideoByPlayerVars" || name === "cueVideoByPlayerVars")) {
  logger.debug("Player stopped API %s from being called.", name);
  delete this._ready[id];
  return { value: undefined };
}

Edit: the reason was that if I didn't prevent it, it would load the video twice in the player (caused video preview/thumbnail to flicker).

@YePpHa YePpHa closed this as completed in 9c75438 Oct 8, 2017
@YePpHa
Copy link
Owner

YePpHa commented Oct 8, 2017

Fix will be available at https://github.com/YePpHa/maia-yt/releases/tag/v0.1-alpha.7

@mzso
Copy link
Author

mzso commented Oct 8, 2017

@YePpHa commented on 2017. okt. 8. 19:48 CEST:

Fix will be available at https://github.com/YePpHa/maia-yt/releases/tag/v0.1-alpha.7

Great!
I can't reproduce anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants