Skip to content
This repository was archived by the owner on Sep 28, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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