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

Occasionally GetVideoInfoAsync throws "Could not get video context" #38

Closed
Tyrrrz opened this issue Jul 3, 2017 · 7 comments
Closed
Labels

Comments

@Tyrrrz
Copy link
Owner

Tyrrrz commented Jul 3, 2017

Seems to be random and very rare. I wonder what's going on.

@Tyrrrz Tyrrrz added the bug label Jul 3, 2017
@SlowLogicBoy
Copy link
Contributor

I noticed that too, however I wasn't able to catch on which videos and why yet.

@Tyrrrz
Copy link
Owner Author

Tyrrrz commented Jul 4, 2017

Just set a breakpoint on the exception and started querying video infos in an endless loop. Came back from lunch to check what's wrong. Looks like it can't extract the player version.
https://pastebin.com/V71jRCYx <- here's the HTML of the /embed/ watch page.
Youtube basically shows an error and suggests to watch the video on its full watch page. We use the embed watch page because it circumvents age-restrictions and other blocks.

@Tyrrrz
Copy link
Owner Author

Tyrrrz commented Jul 4, 2017

The actual player version doesn't seem to be there when the error happens.

@Tyrrrz
Copy link
Owner Author

Tyrrrz commented Jul 4, 2017

One solution I see is to keep refreshing the page until it doesn't show an error (the error seems to be rare anyway) or until it hits an internal limit of retries (like 10 or something).
@TheInsaneBro do you have any input on this?

@BrunoZell
Copy link
Contributor

Uhm, yeah. I once had a parse exception on like three videos. I don't really know why, but when I wanted to create an issue, the error was no more in these video ids. Sounds quite similar, however it hasn't said anything about the video context if I remember correctly.

@Tyrrrz
Copy link
Owner Author

Tyrrrz commented Jul 4, 2017

Hmm. I hope it's the same error.
I'll "fix" it by requesting the page a few times before giving up, then run the endless loop again and see how it holds up.

@Tyrrrz
Copy link
Owner Author

Tyrrrz commented Jul 4, 2017

Ok it works fine. It never exceeds two retries and the retries seem to occur about once in 20 requests.

@Tyrrrz Tyrrrz closed this as completed in 2e67d38 Jul 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants