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

Commit 27be8a8

Browse files
authored
Merge pull request #195 from Kimmax/upstreamMaster
Fixes #194
2 parents f610fae + 76820c2 commit 27be8a8

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

YoutubeExtractor/ExampleApplication/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private static void DownloadVideo(IEnumerable<VideoInfo> videoInfos)
8888
private static void Main()
8989
{
9090
// Our test youtube link
91-
const string link = "http://www.youtube.com/watch?v=O3UBOOZw-FE";
91+
const string link = "https://www.youtube.com/watch?v=YQHsXMglC9A";
9292

9393
/*
9494
* Get the available video formats.

YoutubeExtractor/YoutubeExtractor/Decipherer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static string DecipherWithVersion(string cipher, string cipherVersion)
2222
funcName = "\\" + funcName; //Due To Dollar Sign Introduction, Need To Escape
2323
}
2424

25-
string funcPattern = @funcName + @"=function\(\w+\)\{.*?\},"; //Escape funcName string
25+
string funcPattern = @"(?!h\.)" + @funcName + @"=function\(\w+\)\{.*?\}"; //Escape funcName string
2626
var funcBody = Regex.Match(js, funcPattern, RegexOptions.Singleline).Value; //Entire sig function
2727
var lines = funcBody.Split(';'); //Each line in sig function
2828

YoutubeExtractor/YoutubeExtractor/DownloadUrlResolver.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace YoutubeExtractor
1313
public static class DownloadUrlResolver
1414
{
1515
private const string RateBypassFlag = "ratebypass";
16-
private const int CorrectSignatureLength = 81;
1716
private const string SignatureQuery = "signature";
1817

1918
/// <summary>
@@ -226,11 +225,6 @@ private static string GetAdaptiveStreamMap(JObject json)
226225

227226
private static string GetDecipheredSignature(string htmlPlayerVersion, string signature)
228227
{
229-
if (signature.Length == CorrectSignatureLength)
230-
{
231-
return signature;
232-
}
233-
234228
return Decipherer.DecipherWithVersion(signature, htmlPlayerVersion);
235229
}
236230

0 commit comments

Comments
 (0)