This repository was archived by the owner on Sep 28, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ namespace YoutubeExtractor
1212 /// </summary>
1313 public static class DownloadUrlResolver
1414 {
15- private const string RateBypassFlag = "ratebypass=yes " ;
15+ private const string RateBypassFlag = "ratebypass" ;
1616 private const int CorrectSignatureLength = 81 ;
1717 private const string SignatureQuery = "signature" ;
1818
@@ -104,9 +104,6 @@ public static IEnumerable<VideoInfo> GetDownloadUrls(string videoUrl, bool decry
104104 {
105105 DecryptDownloadUrl ( info ) ;
106106 }
107-
108- //Add the ratebypass parameter to the url. This is optional but greatly speeds up downloads
109- info . DownloadUrl += "&" + RateBypassFlag ;
110107 }
111108
112109 return infos ;
@@ -206,6 +203,10 @@ private static IEnumerable<ExtractionInfo> ExtractDownloadUrls(JObject json)
206203 url = HttpHelper . UrlDecode ( url ) ;
207204 url = HttpHelper . UrlDecode ( url ) ;
208205
206+ IDictionary < string , string > parameters = HttpHelper . ParseQueryString ( url ) ;
207+ if ( ! parameters . ContainsKey ( RateBypassFlag ) )
208+ url += string . Format ( "&{0}={1}" , RateBypassFlag , "yes" ) ;
209+
209210 yield return new ExtractionInfo { RequiresDecryption = requiresDecryption , Uri = new Uri ( url ) } ;
210211 }
211212 }
You can’t perform that action at this time.
0 commit comments