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

Commit a46d929

Browse files
committed
Merge pull request #94 from thesquareof4/master
Added the ratebypass flag to the download url. This drastically speeds u...
2 parents c76edae + f3f48e7 commit a46d929

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

YoutubeExtractor/YoutubeExtractor/DownloadUrlResolver.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace YoutubeExtractor
1212
/// </summary>
1313
public static class DownloadUrlResolver
1414
{
15+
private const string RateBypassFlag = "ratebypass";
1516
private const int CorrectSignatureLength = 81;
1617
private const string SignatureQuery = "signature";
1718

@@ -202,6 +203,10 @@ private static IEnumerable<ExtractionInfo> ExtractDownloadUrls(JObject json)
202203
url = HttpHelper.UrlDecode(url);
203204
url = HttpHelper.UrlDecode(url);
204205

206+
IDictionary<string, string> parameters = HttpHelper.ParseQueryString(url);
207+
if (!parameters.ContainsKey(RateBypassFlag))
208+
url += string.Format("&{0}={1}", RateBypassFlag, "yes");
209+
205210
yield return new ExtractionInfo { RequiresDecryption = requiresDecryption, Uri = new Uri(url) };
206211
}
207212
}

0 commit comments

Comments
 (0)