YoutubeExtractor
YoutubeExtractor copied to clipboard
Speed up for YoutubeExtractor.Decipherer class
static Dictionary<string, string> _Ciphers = new Dictionary<string, string>();
static string GetJs(string cipherVersion)
{
string jsUrl = string.Format("http://s.ytimg.com/yts/jsbin/player-{0}.js", cipherVersion);
lock (_Ciphers)
{
if (_Ciphers.ContainsKey(cipherVersion))
return _Ciphers[cipherVersion];
string js = HttpHelper.DownloadString(jsUrl);
_Ciphers.Add(cipherVersion, js);
return js;
}
}
public static string DecipherWithVersion(string cipher, string cipherVersion)
{
string js = GetJs(cipherVersion);
//Find "C" in this: var A = B.sig||C (B.s)
........
........
im not sure what your doing here for i am learning using youtube api to bring items in and if sig is required i use this to decode.i have learned to keep a string of the js returned by the call because the sigs change in each item so only one call is required for each video for all formats
@thehighboy
im not sure what your doing
You are right...
Player source code is 1-2mb on average
when i see your lock, i think you boosted more then buffering the json^^