Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #151 from ovnisoftware/master
Browse files Browse the repository at this point in the history
Applied Kimmax's issue #150 fix
  • Loading branch information
flagbug committed Nov 17, 2015
2 parents 3b6165f + 6126488 commit ec58da9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions YoutubeExtractor/YoutubeExtractor/Decipherer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal static class Decipherer
{
public static string DecipherWithVersion(string cipher, string cipherVersion)
{
string jsUrl = string.Format("http://s.ytimg.com/yts/jsbin/html5player-{0}.js", cipherVersion);
string jsUrl = string.Format("http://s.ytimg.com/yts/jsbin/player-{0}.js", cipherVersion);
string js = HttpHelper.DownloadString(jsUrl);

//Find "C" in this: var A = B.sig||C (B.s)
Expand All @@ -22,9 +22,8 @@ public static string DecipherWithVersion(string cipher, string cipherVersion)
funcName = "\\" + funcName; //Due To Dollar Sign Introduction, Need To Escape
}

string funcBodyPattern = @"(?<brace>{([^{}]| ?(brace))*})"; //Match nested angle braces
string funcPattern = string.Format(@"{0}\(\w+\){1}", @funcName, funcBodyPattern); //Escape funcName string
var funcBody = Regex.Match(js, funcPattern).Groups["brace"].Value; //Entire sig function
string funcPattern = @"var " + @funcName + @"=function\(\w+\)\{.*?\};"; //Escape funcName string
var funcBody = Regex.Match(js, funcPattern).Value; //Entire sig function
var lines = funcBody.Split(';'); //Each line in sig function

string idReverse = "", idSlice = "", idCharSwap = ""; //Hold name for each cipher method
Expand Down
2 changes: 1 addition & 1 deletion YoutubeExtractor/YoutubeExtractor/DownloadUrlResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private static string GetDecipheredSignature(string htmlPlayerVersion, string si

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

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

Expand Down

0 comments on commit ec58da9

Please sign in to comment.