0xced/XCDYouTubeKit

Unable to play youtube video in iOS app

dipubright opened this issue · 10 comments

Getting fail to decode response with below logs
[XCDYouTubeKit] Failed to decode response from https://www.youtube.com/get_video_info?el=embedded&hl=en&ps=default&video_id=-VmaT7ChiYs (response.textEncodingName = utf-8, data.length = 0)
2021-05-25 13:09:58.729299+0530 HealthKart[6512:163267] [XCDYouTubeKit] Video operation finished with error: The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error -3.)
Domain: XCDYouTubeVideoErrorDomain
Code: -3

Version (2.15.2)

duplicate of #530
duplicate of #525

+1

Need to make little modification in "XCDYouTubeVideoOperation" For make this Fix.
Replac line number 152,361 with new one that i have listedout at bottom.

File : XCDYouTubeVideoOperation

line: 152
line: 361

Modification for line 152: NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"el": eventLabel, @"ps": @"default", @"html5" : @1 };

Modification for line 361: NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"eurl": eurl, @"sts": sts, @"html5" : @1 };

HI is anyone having problems with this again? I did these changes about a month ago but as of lately no longer work.

@Tsquared86 yes, it's broken again for me as well

Yep

Yes. Did anyone find a solution for it?

I replace the line 152 in "XCDYouTubeVideoOperation.m" with
NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"el": eventLabel, @"ps": @"default", @"html5" : @"1" };

and le line 154 in "XCDYouTubeVideoOperation.m" with
NSURL *videoInfoURL = [NSURL URLWithString:[@"https://www.youtube.com/get_video_info?eurl=https%3A%2F%2Fyoutube.googleapis.com%2Fv%2Fonz2k4zoLjQ&c=TVHTML5&cver=6.20180913&" stringByAppendingString:queryString]];

I followed this link
https://stackoverflow.com/questions/67615278/get-video-info-youtube-endpoint-suddenly-returning-404-not-found

There is a PR here that addresses it:
#539

I am having the same issue... does any one found any solution or can suggest any other option?