flagbug / YoutubeExtractor

A .NET library, that allows to download videos from YouTube and/or extract their audio track (currently only for flash videos).
816 stars 374 forks source link

Not working again #335

Open kelvinRosa opened 5 years ago

kelvinRosa commented 5 years ago

I noticed that youtubedl is working normal, how can i do the same steps here?

kelvinRosa commented 5 years ago

I think i fixed, change "http://s.ytimg.com/yts/jsbin/player_{0}.js" or "http://s.ytimg.com/yts/jsbin/player-{0}.js" to "http://s.ytimg.com/yts/jsbin/player_ias-{0}.js"

and GetHtml5PlayerVersion function to:

private static string GetHtml5PlayerVersion(JObject json) { var regex = new Regex(@"player_ias-(.+?).js");

        string js = json["assets"]["js"].ToString();

        Match match = regex.Match(js);
        if (match.Success) return match.Result("$1");

        regex = new Regex(@"player-(.+?).js");

        return regex.Match(js).Result("$1");
    }