XCDYouTubeKit: No longer works: XCDYouTubeVideoErrorDomain error -3

Has google changed their API?

sample video I’m trying:

https://www.youtube.com/watch?v=MkU8v1genz0
2021-05-24 15:08:01.085443-0700 ADD[13367:365927] [XCDYouTubeKit] Failed to decode response from https://www.youtube.com/get_video_info?el=embedded&hl=en&ps=default&video_id=MkU8v1genz0 (response.textEncodingName = utf-8, data.length = 0)

2021-05-24 15:08:01.086579-0700 ADD[13367:365927] [XCDYouTubeKit] Video operation finished with error: The operation couldn’t be completed. 
(XCDYouTubeVideoErrorDomain error -3.)
Domain: XCDYouTubeVideoErrorDomain
Code:   -3
User Info: {
}

I see -3 has this note: Returned when an empty response is returned. This may indicate that YouTube has blocked requests from your IP address because of overuse.

Would be curious if others are seeing this as I don’t use this enough to be blocked.

Thanks, Ryan

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 22

Commits related to this issue

Most upvoted comments

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,@“html5” : @1, @“c"😡"TVHTML5”, @“cver”:@6.20180913};

Modification for line 361: NSDictionary *query = @{ @“video_id”: self.videoIdentifier, @“hl”: self.languageIdentifier, @“el”: eventLabel, @“ps”: @“default” , @“html5” : @1,@“html5” : @1, @“c"😡"TVHTML5”, @“cver”:@6.20180913};

@devbest555 where exactly?

Need to make little modification in “XCDYouTubeVideoOperation.m” For make this Fix cause the api we are using in isn’t working for me(may be Api is depricated or something else i don’t know)

File : XCDYouTubeVideoOperation.m

Modification for line 151: NSDictionary *query = @{ @“id”: self.videoIdentifier};

Modification for line 153: NSURL *videoInfoURL = [NSURL URLWithString:[@“https://www.googleapis.com/youtube/v3/videos?part=id%2C+snippet&key={YOUR_API_KEY_HERE}” stringByAppendingString:queryString]];

you can get your api key from google console “YouTube Data API v3”

Yes, stop using this lib, it’s doomed anyway. Use the youtube-ios-player-helper instead.

Livestreams worked for me using the above fix

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 };

It’s worked for me. Thank bro!

Thank @hArshpb11 this fixed for me…