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

Commit ec58da9

Browse files
committed
Merge pull request #151 from ovnisoftware/master
Applied Kimmax's issue #150 fix
2 parents 3b6165f + 6126488 commit ec58da9

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

YoutubeExtractor/YoutubeExtractor/Decipherer.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ internal static class Decipherer
99
{
1010
public static string DecipherWithVersion(string cipher, string cipherVersion)
1111
{
12-
string jsUrl = string.Format("http://s.ytimg.com/yts/jsbin/html5player-{0}.js", cipherVersion);
12+
string jsUrl = string.Format("http://s.ytimg.com/yts/jsbin/player-{0}.js", cipherVersion);
1313
string js = HttpHelper.DownloadString(jsUrl);
1414

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

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

3029
string idReverse = "", idSlice = "", idCharSwap = ""; //Hold name for each cipher method

YoutubeExtractor/YoutubeExtractor/DownloadUrlResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ private static string GetDecipheredSignature(string htmlPlayerVersion, string si
230230

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

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

0 commit comments

Comments
 (0)