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
2 changes: 1 addition & 1 deletion YoutubeExtractor/ExampleApplication/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private static void DownloadVideo(IEnumerable<VideoInfo> videoInfos)
private static void Main()
{
// Our test youtube link
const string link = "http://www.youtube.com/watch?v=O3UBOOZw-FE";
const string link = "https://www.youtube.com/watch?v=YQHsXMglC9A";

/*
* Get the available video formats.
Expand Down
2 changes: 1 addition & 1 deletion YoutubeExtractor/YoutubeExtractor/Decipherer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static string DecipherWithVersion(string cipher, string cipherVersion)
funcName = "\\" + funcName; //Due To Dollar Sign Introduction, Need To Escape
}

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

Expand Down
6 changes: 0 additions & 6 deletions YoutubeExtractor/YoutubeExtractor/DownloadUrlResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace YoutubeExtractor
public static class DownloadUrlResolver
{
private const string RateBypassFlag = "ratebypass";
private const int CorrectSignatureLength = 81;
private const string SignatureQuery = "signature";

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

private static string GetDecipheredSignature(string htmlPlayerVersion, string signature)
{
if (signature.Length == CorrectSignatureLength)
{
return signature;
}

return Decipherer.DecipherWithVersion(signature, htmlPlayerVersion);
}

Expand Down