0xced / XCDYouTubeKit

YouTube video player for iOS, tvOS and macOS
MIT License
2.92k stars 626 forks source link

getVideoWithIdentifier return XCDYouTubeVideoErrorDomain error #534

Open akoruk opened 3 years ago

akoruk commented 3 years ago

Hello,

XCDYouTubeClient.default().getVideoWithIdentifier(videoID)

This method above always returns error XCDYouTubeVideoErrorDomain with code -3. I think Youtube API changed something.

Do you know anything about it?

Alanko5 commented 3 years ago

duplicate with: https://github.com/0xced/XCDYouTubeKit/issues/530 https://github.com/0xced/XCDYouTubeKit/issues/527 fix: https://github.com/0xced/XCDYouTubeKit/pull/526

drwjf commented 3 years ago

https://github.com/ytdl-org/youtube-dl/issues/29086

get_vid_info is shut-downing.

Oleh-Poremskyy commented 3 years ago

HI, the error appears again on my side - Error Domain=XCDYouTubeVideoErrorDomain Code=-3 Fix from @hArshpb11 worked< but again :(

armendh commented 3 years ago

https://stackoverflow.com/a/67629882 Updating query in XCDYouTubeVideoOperation.m seems to work for now..

NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"el": eventLabel, @"ps": @"default", @"html5" : @"1", @"eurl": [@"https://youtube.googleapis.com/v/" stringByAppendingString:self.videoIdentifier],@"c": @"TVHTML5", @"cver": @"6.20180913"};

Oleh-Poremskyy commented 3 years ago

https://stackoverflow.com/a/67629882 Updating query in XCDYouTubeVideoOperation.m seems to work for now..

`NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"el": eventLabel, @"ps": @"default", @"html5" : @"1", @"eurl": [@"https://youtube.googleapis.com/v/" stringByAppendingString:self.videoIdentifier],@"c": @"TVHTML5", @"cver": @"6.20180913"};

it seems that the updated request is now working on my side. I hope it will continue to work. @armendh Thank you very much )

cbg-dev-k commented 3 years ago

This also seems to fix it on my end (for now...). Good find @armendh!

philmmoore commented 3 years ago

Yep can confirm this fixed it for me too thanks @armendh

philmmoore commented 3 years ago

I've created a PR here: https://github.com/alexeichhorn/XCDYouTubeKit/pull/3 though you could install the fix by updating your podfile with:

pod 'XCDYouTubeKit', git: 'git@github.com:hinge-agency/XCDYouTubeKit.git', branch: 'fix/issue-534- XCDYouTubeVideoErrorDomain-error-code-3'
Oleh-Poremskyy commented 3 years ago

@philmmoore great, thanks, good luck

akoruk commented 3 years ago

Great solution. It works for me as well 🎉
PS: pod update did not work. https://github.com/0xced/XCDYouTubeKit/issues/534#issuecomment-864047166

I just changed line value 151. in XCDYouTubeVideoOperation.m to this below.

NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"el": eventLabel, @"ps": @"default", @"html5" : @"1", @"eurl": [@"https://youtube.googleapis.com/v/" stringByAppendingString:self.videoIdentifier],@"c": @"TVHTML5", @"cver": @"6.20180913"};

devbest555 commented 3 years ago

same issue. common videos works fine but "LIVE NOW" videos didn't work

gonzo-oin commented 3 years ago

I've created a PR here: alexeichhorn#3 though you could install the fix by updating your podfile with:

pod 'XCDYouTubeKit', git: 'git@github.com:hinge-agency/XCDYouTubeKit.git', branch: 'fix/issue-534- XCDYouTubeVideoErrorDomain-error-code-3'

I use this line to make pod update works

pod 'XCDYouTubeKit', :git => 'https://github.com/hinge-agency/XCDYouTubeKit.git', :branch => 'fix/issue-534-XCDYouTubeVideoErrorDomain-error-code-3
devbest555 commented 3 years ago

I've created a PR here: alexeichhorn#3 though you could install the fix by updating your podfile with:

pod 'XCDYouTubeKit', git: 'git@github.com:hinge-agency/XCDYouTubeKit.git', branch: 'fix/issue-534- XCDYouTubeVideoErrorDomain-error-code-3'

I use this line to make pod update works

pod 'XCDYouTubeKit', :git => 'https://github.com/hinge-agency/XCDYouTubeKit.git', :branch => 'fix/issue-534-XCDYouTubeVideoErrorDomain-error-code-3

did you test the "LIVE NOW" videos ? could you test the project with youtube videoID "azl07uA79pA"? Even though I didn't get the Error but video doesn't load because streamURL=nil for live videos. any idea for live videos?

hArshpb11 commented 3 years ago

HI, the error appears again on my side - Error Domain=XCDYouTubeVideoErrorDomain Code=-3 Fix from @hArshpb11 worked< but again :(

https://github.com/0xced/XCDYouTubeKit/issues/530#issuecomment-849851958

devbest555 commented 3 years ago

live videoIDs : hartiIFC1s4, azl07ua79pa can you test these videos in your side using XDCYouTubeVideoKit?

markdegrootnl commented 3 years ago

PR #536 seems the best hotfix for now, but we need a long-term solution for this.

devbest555 commented 3 years ago

PR #536 seems the best hotfix for now, but we need a long-term solution for this.

So, finally, can you play the live videos(hartiIFC1s4, azl07ua79pa) using XCDYoutubekit?

markdegrootnl commented 3 years ago

The second video is no longer valid. The first one does not play, the player just keeps on loading.

devbest555 commented 3 years ago

@markdegrootnl Thank you for your information. first, second videos are playing in the web browser and also those are playing in ios app using ios-youtube-player-helper library. thoes videos doesn't play in only XCDYoutubeVideokit. do you have any idea?

DuyBui-Everfit commented 3 years ago

https://stackoverflow.com/a/67629882 Updating query in XCDYouTubeVideoOperation.m seems to work for now..

NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"el": eventLabel, @"ps": @"default", @"html5" : @"1", @"eurl": [@"https://youtube.googleapis.com/v/" stringByAppendingString:self.videoIdentifier],@"c": @"TVHTML5", @"cver": @"6.20180913"};

This also works for me

DuyBui-Everfit commented 3 years ago

https://stackoverflow.com/a/67629882 Updating query in XCDYouTubeVideoOperation.m seems to work for now.. NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"el": eventLabel, @"ps": @"default", @"html5" : @"1", @"eurl": [@"https://youtube.googleapis.com/v/" stringByAppendingString:self.videoIdentifier],@"c": @"TVHTML5", @"cver": @"6.20180913"};

This also works for me

This solution is not completely fixed, sometimes it works, sometime not.

Kiu212 commented 3 years ago

I followed 2 modifications from another closed issue to fix the live broadcast cannot be played problem. https://github.com/0xced/XCDYouTubeKit/issues/538 It seems like the hotfix is worked again.

  1. XCDYouTubeVideoOperation.m self.eventLabels = [[NSMutableArray alloc] initWithArray:@[ @"embedded", @"detailpage" ]]; --->> [Edit] self.eventLabels =[[NSMutableArray alloc] init];
  2. XCDYouTubeVideo.m NSString httpLiveStream = info[@"hlsvp"] ?: XCDHTTPLiveStreamingStringWithString(playerResponse); --->> [Edit] NSString httpLiveStream = info[@"hlsvp"] ?: XCDHTTPLiveStreamingStringWithString(playerResponse); if(httpLiveStream.length == 0){ httpLiveStream = info[@"streamingData"][@"hlsManifestUrl"]; }

But this is resulting in another issue, the user info for upcoming live stream will return error: XCDYouTubeVideoErrorDomain: -2 instead of remaining start time. And I opened this issue already.https://github.com/0xced/XCDYouTubeKit/issues/541 Please help~

CharlyVaiMX commented 3 years ago

Hello folks! seems that Again this is not working, i can't play videos on iOS. even with the latest modifications to the line 152, seems that again the URL schema has change, since i can't decode the response.

Any ideas?

CharlyVaiMX commented 3 years ago

Hello folks! seems that Again this is not working, i can't play videos on iOS. even with the latest modifications to the line 152, seems that again the URL schema has change, since i can't decode the response.

Any ideas?

Somehow this is working again...

KaranMehta3984 commented 3 years ago

@CharlyVaiMX Have you got any solution?