Skip to content

Commit

Permalink
Failed to decode response error
Browse files Browse the repository at this point in the history
Solution - 0xced#531
  • Loading branch information
edcastparesh committed May 28, 2021
1 parent 543edad commit baebe7b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions XCDYouTubeKit/XCDYouTubeVideoOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ - (void) startNextRequest
NSString *eventLabel = [self.eventLabels objectAtIndex:0];
[self.eventLabels removeObjectAtIndex:0];

NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"el": eventLabel, @"ps": @"default" };
NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"el": eventLabel, @"ps": @"default", @"html5" : @1 };
NSString *queryString = XCDQueryStringWithDictionary(query);
NSURL *videoInfoURL = [NSURL URLWithString:[@"https://www.youtube.com/get_video_info?" stringByAppendingString:queryString]];
[self startRequestWithURL:videoInfoURL type:XCDYouTubeRequestTypeGetVideoInfo];
Expand All @@ -129,6 +129,7 @@ - (void) startNextRequest
- (void) startWatchPageRequest
{
NSDictionary *query = @{ @"v": self.videoIdentifier, @"hl": self.languageIdentifier, @"has_verified": @YES, @"bpctr": @9999999999 };

NSString *queryString = XCDQueryStringWithDictionary(query);
NSURL *webpageURL = [NSURL URLWithString:[@"https://www.youtube.com/watch?" stringByAppendingString:queryString]];
[self startRequestWithURL:webpageURL type:XCDYouTubeRequestTypeWatchPage];
Expand Down Expand Up @@ -305,8 +306,8 @@ - (void) handleJavaScriptPlayerWithScript:(NSString *)script
{
NSString *eurl = [@"https://youtube.googleapis.com/v/" stringByAppendingString:self.videoIdentifier];
NSString *sts = self.embedWebpage.sts ?: self.webpage.sts ?: @"";
NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"eurl": eurl, @"sts": sts};
NSString *queryString = XCDQueryStringWithDictionary(query);
NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"eurl": eurl, @"sts": sts, @"html5" : @1 };
NSString *queryString = XCDQueryStringWithDictionary(query);
NSURL *videoInfoURL = [NSURL URLWithString:[@"https://www.youtube.com/get_video_info?" stringByAppendingString:queryString]];
[self startRequestWithURL:videoInfoURL type:XCDYouTubeRequestTypeGetVideoInfo];
}
Expand Down

0 comments on commit baebe7b

Please sign in to comment.