Skip to content

Commit

Permalink
Fallback to signatureCipher if needed
Browse files Browse the repository at this point in the history
I cannot replicate this myself, however, some users have reported page requests that contain `signatureCipher` instead of `cipher`.  See ytdl-org/youtube-dl#25188

Note the page dump at https://pastebin.com/m6dRwg1f is in base64 and needs to be decoded to search for the `signatureCipher` keys.
  • Loading branch information
SoneeJohn committed May 8, 2020
1 parent 21d2b8d commit 815ba5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion XCDYouTubeKit/XCDYouTubeVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ - (instancetype) initWithIdentifier:(NSString *)identifier info:(NSDictionary *)
{
stream = XCDDictionaryWithQueryString((NSString *)streamQuery);
}
NSDictionary *alternativeStreamInfo = XCDDictionaryWithQueryString(stream[@"cipher"]);
NSDictionary *alternativeStreamInfo = XCDDictionaryWithQueryString(stream[@"cipher"]) == nil? XCDDictionaryWithQueryString(stream[@"signatureCipher"]) : XCDDictionaryWithQueryString(stream[@"cipher"]);
NSString *alternativeURLString = alternativeStreamInfo[@"url"];

NSString *scrambledSignature = stream[@"s"] == nil? alternativeStreamInfo[@"s"] : stream[@"s"];
Expand Down

0 comments on commit 815ba5a

Please sign in to comment.