YoutubeExtractor
YoutubeExtractor copied to clipboard
YoutubeExtractor.YoutubeParseException
Could not parse the Youtube page for URL http://youtube.com/watch?v=DHHY8m3rEzU This may be due to a change of the Youtube page structure. Please report this bug at www.github.com/flagbug/YoutubeExtractor/issues
So YouTube updated their page structure... I have the same error for an other video
It's around line 334 in file DownloadUrlResolver.cs
var dataRegex = new Regex(@"ytplayer\.config\s*=\s*(\{.+?\});", RegexOptions.Multiline);
We need a new regex because of youtube's change.
source: xkcd.com
Seems to be yt.setConfig({
etc. now.
I have the same error too but it's not because of the link ! i tried to convert once and i got the error and then i tried again and i got no error at all.
All I know is that the problem is here: (DownloadUrlResolver.cs) line 231 private static string GetHtml5PlayerVersion(JObject json) { var regex = new Regex(@"player-(.+?).js");
string js = json["assets"]["js"].ToString();
return regex.Match(js).Result("$1");
}
I'm trying to replicate the error again but now i'm having no success. :/
EDIT:
So basically the new change is this: "/yts/jsbin/player_ias-vflUd_hCT/pt_PT/base.js" and the regex was only expecting "/yts/jsbin/player-vflX4ueE4/pt_PT/base.js" .
Does anyone know a good way to change this? I don't know where to find the information to know what kind of information should i expect from this : json["assets"]["js"] .
I have checked your url, which is downloadable. Mine is not somehow. Perhaps because there is this warning just before about the age verify. When I view the html source there is no ytplayer in it... so the regex has no matches
var dataRegex = new Regex(@"ytplayer\.config\s*=\s*(\{.+?\});", RegexOptions.Multiline);
so it throws an exception. Could someone test it with the url I used? https://youtu.be/mIagpKaoxuk or https://www.youtube.com/watch?v=mIagpKaoxuk
@ jphellemons
did you find a work around for your video ?
i tried your link in my app and got "result cannot be called on a failed match" but i do see ytplayer and links are there in source.i think its in the regex not matching like you say.i use vb .net but is similar to yours.
JObject.Parse(New Regex("ytplayer\.config\s*=\s*(\{.+?\});", (RegexOptions.Multiline)).Match(pageSource).Result("$1"))
i did try my first app i wrote and can get links but it uses the youtube info like
http://www.youtube.com/get_video_info?video_id=mIagpKaoxuk and is not efficient at all.
Edit-> yes it is the age verify ,thats why i seen it in my source as i was signed in.
Having the same issue, it ran in the first try but later started to get this exception. I did not get what is wrong.
YoutubeExtractor.YoutubeParseException HResult=0x80131500 Message=Could not parse the Youtube page for URL http://youtube.com/watch?v=Mus0XbaGx0M This may be due to a change of the Youtube page structure. Please report this bug at www.github.com/flagbug/YoutubeExtractor/issues Source=YoutubeExtractor StackTrace: at YoutubeExtractor.DownloadUrlResolver.ThrowYoutubeParseException(Exception innerException, String videoUrl) at YoutubeExtractor.DownloadUrlResolver.GetDownloadUrls(String videoUrl, Boolean decryptSignature) at MP3Head.App.Program.Main(String[] args) in C:\Sources\MP3Head\MP3Head.App\Program.cs:line 28
Inner Exception 1: NotSupportedException: Result cannot be called on a failed Match.
I have the same error too but it's not because of the link ! i tried to convert once and i got the error and then i tried again and i got no error at all.
All I know is that the problem is here: (DownloadUrlResolver.cs) line 231 private static string GetHtml5PlayerVersion(JObject json) { var regex = new Regex(@"player-(.+?).js");
string js = json["assets"]["js"].ToString(); return regex.Match(js).Result("$1"); }
I'm trying to replicate the error again but now i'm having no success. :/
EDIT:
So basically the new change is this: "/yts/jsbin/player_ias-vflUd_hCT/pt_PT/base.js" and the regex was only expecting "/yts/jsbin/player-vflX4ueE4/pt_PT/base.js" .
Does anyone know a good way to change this? I don't know where to find the information to know what kind of information should i expect from this : json["assets"]["js"] .
I had also the same issue but your comment helped me. Just replace the line: var regex = new Regex(@"player-(.+?).js"); to var regex = new Regex(@"player_ias-(.+?).js");
and the program will execute.