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

GetHtml5PlayerVersion #324

Open AlenToma opened 6 years ago

AlenToma commented 6 years ago

Hi i notice that GetHtml5PlayerVersion fail sometime i fixed the problem with a new regexp you may be intressted. this is the new regexp i implemented

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

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

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