0xced / XCDYouTubeKit

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

Can Not Play video any more - XCDYouTubeVideoErrorDomain Code=-3 #525 #526

Open jatin19121990 opened 3 years ago

jatin19121990 commented 3 years ago

Fixed Issue #525 - Can Not Play video any more - XCDYouTubeVideoErrorDomain Code=-3 #525

kirian commented 3 years ago

It works correctly in our project, thank you so much! 👌

pausenabre commented 3 years ago

Tested. It seems to work! 👍

arcs- commented 3 years ago

Works!

JLPenaLopez commented 3 years ago

It's Great!, please guys, merge the pull request, thanks a lot!

amadorera commented 3 years ago

It works correctly 👍

ardavydov commented 3 years ago

Can you make a release?

huynguyencong commented 3 years ago

It works for me. Thank you!

meffistofel commented 3 years ago

Can you help me? i am reinstall pod - dont work i write this line in code on my own - dont workd What wrong?

rodineijf commented 3 years ago

Can you help me? i am reinstall pod - dont work i write this line in code on my own - dont workd What wrong?

I think that it hasn't been published yet. I've changed the reference of XCDYouTubeKit to the branch of the PR owner. It isn't a definitive solution, but it helped me to fix my app for now.

eg: pod 'XCDYouTubeKit', :git => 'https://github.com/jatin19121990/XCDYouTubeKit', :branch => 'hotfix/Can-Not-Play-video-any-more---XCDYouTubeVideoErrorDomain-Code=-3-#525'

BTW it works fine!

baksogen commented 3 years ago

Thank you! It works correctly 👍

ghost commented 3 years ago

When can we expect this to be published?

tungdangplus commented 3 years ago

How to fix this problem bros ??????

ios-dev-rep commented 3 years ago

problem was fixed https://github.com/0xced/XCDYouTubeKit/pull/526

tungdangplus commented 3 years ago

problem was fixed

526

But how to do with podfile ??

ios-dev-rep commented 3 years ago
pod 'XCDYouTubeKit', git: 'https://github.com/jatin19121990/XCDYouTubeKit', branch: 'hotfix/Can-Not-Play-video-any-more---XCDYouTubeVideoErrorDomain-Code=-3-#525', submodules: true
ghost commented 3 years ago

This works but there is no official release yet!!!

abomadi commented 3 years ago

Please merge and release

Sridharan15 commented 3 years ago

Can anyone say why it didn't work previously and why I need to add those new changes?

jaydeepk3 commented 3 years ago
pod 'XCDYouTubeKit', git: 'https://github.com/jatin19121990/XCDYouTubeKit', branch: 'hotfix/Can-Not-Play-video-any-more---XCDYouTubeVideoErrorDomain-Code=-3-#525', submodules: true

this fixed for me but i have multiple videos in some video still coming XCDYouTubeVideoErrorDomain Code=-3 this error

cbg-dev-k commented 3 years ago

We're also getting reports of videos not playing since ~yesterday.

As @drwjf mentioned on #534, it seems the html5 parameter is no longer a valid workaround for the get_video_info API.

In another library (streamlink issues#3795) they're moving away from this API entirely, but I don't know if this is at all possible for YoutubeKit.

chwastek commented 3 years ago
pod 'XCDYouTubeKit', git: 'https://github.com/jatin19121990/XCDYouTubeKit', branch: 'hotfix/Can-Not-Play-video-any-more---XCDYouTubeVideoErrorDomain-Code=-3-#525', submodules: true

this fixed for me but i have multiple videos in some video still coming XCDYouTubeVideoErrorDomain Code=-3 this error

Tried that yesterday, not working unfortunately 😓

ardavydov commented 3 years ago

Yep, few days ago sometimes videos are just not playing.

dpwilhelmsen commented 3 years ago

It seems that youtube is slowly deprecating this api. However, there is a combination of parameters that has it working for me.

https://github.com/dpwilhelmsen/XCDYouTubeKit/commit/523a63f694eca438f72a295c54abf4f2640da1a1

diff --git a/XCDYouTubeKit/XCDYouTubeVideoOperation.m b/XCDYouTubeKit/XCDYouTubeVideoOperation.m
index be4ce9e..714bed3 100644
--- a/XCDYouTubeKit/XCDYouTubeVideoOperation.m
+++ b/XCDYouTubeKit/XCDYouTubeVideoOperation.m
@@ -149,7 +149,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", @"c": @"IOS", @"cver": @"16.05.7"};
                NSString *queryString = XCDQueryStringWithDictionary(query);
                NSURL *videoInfoURL = [NSURL URLWithString:[@"https://www.youtube.com/get_video_info?" stringByAppendingString:queryString]];
                [self startRequestWithURL:videoInfoURL type:XCDYouTubeRequestTypeGetVideoInfo];
@@ -358,7 +358,7 @@ - (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};
+               NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"eurl": eurl, @"sts": sts, @"html5" : @"1", @"c": @"IOS", @"cver": @"16.05.7"};
                NSString *queryString = XCDQueryStringWithDictionary(query);
                NSURL *videoInfoURL = [NSURL URLWithString:[@"https://www.youtube.com/get_video_info?" stringByAppendingString:queryString]];
                [self startRequestWithURL:videoInfoURL type:XCDYouTubeRequestTypeGetVideoInfo];

This is tested and works with both regular videos and live streams.

ghost commented 3 years ago

It seems that youtube is slowly deprecating this api. However, there is a combination of parameters that has it working for me.

dpwilhelmsen@523a63f

diff --git a/XCDYouTubeKit/XCDYouTubeVideoOperation.m b/XCDYouTubeKit/XCDYouTubeVideoOperation.m
index be4ce9e..714bed3 100644
--- a/XCDYouTubeKit/XCDYouTubeVideoOperation.m
+++ b/XCDYouTubeKit/XCDYouTubeVideoOperation.m
@@ -149,7 +149,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", @"c": @"IOS", @"cver": @"16.05.7"};
                NSString *queryString = XCDQueryStringWithDictionary(query);
                NSURL *videoInfoURL = [NSURL URLWithString:[@"https://www.youtube.com/get_video_info?" stringByAppendingString:queryString]];
                [self startRequestWithURL:videoInfoURL type:XCDYouTubeRequestTypeGetVideoInfo];
@@ -358,7 +358,7 @@ - (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};
+               NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"eurl": eurl, @"sts": sts, @"html5" : @"1", @"c": @"IOS", @"cver": @"16.05.7"};
                NSString *queryString = XCDQueryStringWithDictionary(query);
                NSURL *videoInfoURL = [NSURL URLWithString:[@"https://www.youtube.com/get_video_info?" stringByAppendingString:queryString]];
                [self startRequestWithURL:videoInfoURL type:XCDYouTubeRequestTypeGetVideoInfo];

This is tested and works with both regular videos and live streams.

Any pod version for this fix?

nikolaenkoag commented 3 years ago

It seems that youtube is slowly deprecating this api. However, there is a combination of parameters that has it working for me. dpwilhelmsen@523a63f

diff --git a/XCDYouTubeKit/XCDYouTubeVideoOperation.m b/XCDYouTubeKit/XCDYouTubeVideoOperation.m
index be4ce9e..714bed3 100644
--- a/XCDYouTubeKit/XCDYouTubeVideoOperation.m
+++ b/XCDYouTubeKit/XCDYouTubeVideoOperation.m
@@ -149,7 +149,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", @"c": @"IOS", @"cver": @"16.05.7"};
                NSString *queryString = XCDQueryStringWithDictionary(query);
                NSURL *videoInfoURL = [NSURL URLWithString:[@"https://www.youtube.com/get_video_info?" stringByAppendingString:queryString]];
                [self startRequestWithURL:videoInfoURL type:XCDYouTubeRequestTypeGetVideoInfo];
@@ -358,7 +358,7 @@ - (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};
+               NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"eurl": eurl, @"sts": sts, @"html5" : @"1", @"c": @"IOS", @"cver": @"16.05.7"};
                NSString *queryString = XCDQueryStringWithDictionary(query);
                NSURL *videoInfoURL = [NSURL URLWithString:[@"https://www.youtube.com/get_video_info?" stringByAppendingString:queryString]];
                [self startRequestWithURL:videoInfoURL type:XCDYouTubeRequestTypeGetVideoInfo];

This is tested and works with both regular videos and live streams.

Any pod version for this fix?

It works for me - pod 'XCDYouTubeKit', :git => 'https://github.com/dpwilhelmsen/XCDYouTubeKit', :branch => 'hotfix/fix-get-video-info-error'

NikKovIos commented 3 years ago

This helped me too https://github.com/0xced/XCDYouTubeKit/issues/525#issuecomment-843923468

devguy221 commented 3 years ago

pod 'XCDYouTubeKit', :git => 'https://github.com/dpwilhelmsen/XCDYouTubeKit', :branch => 'hotfix/fix-get-video-info-error', submodules: true

This works for me.

coachdesign commented 3 years ago

It seems that youtube is slowly deprecating this api. However, there is a combination of parameters that has it working for me. dpwilhelmsen@523a63f

diff --git a/XCDYouTubeKit/XCDYouTubeVideoOperation.m b/XCDYouTubeKit/XCDYouTubeVideoOperation.m
index be4ce9e..714bed3 100644
--- a/XCDYouTubeKit/XCDYouTubeVideoOperation.m
+++ b/XCDYouTubeKit/XCDYouTubeVideoOperation.m
@@ -149,7 +149,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", @"c": @"IOS", @"cver": @"16.05.7"};
                NSString *queryString = XCDQueryStringWithDictionary(query);
                NSURL *videoInfoURL = [NSURL URLWithString:[@"https://www.youtube.com/get_video_info?" stringByAppendingString:queryString]];
                [self startRequestWithURL:videoInfoURL type:XCDYouTubeRequestTypeGetVideoInfo];
@@ -358,7 +358,7 @@ - (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};
+               NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"eurl": eurl, @"sts": sts, @"html5" : @"1", @"c": @"IOS", @"cver": @"16.05.7"};
                NSString *queryString = XCDQueryStringWithDictionary(query);
                NSURL *videoInfoURL = [NSURL URLWithString:[@"https://www.youtube.com/get_video_info?" stringByAppendingString:queryString]];
                [self startRequestWithURL:videoInfoURL type:XCDYouTubeRequestTypeGetVideoInfo];

This is tested and works with both regular videos and live streams.

Any pod version for this fix?

It works for me - pod 'XCDYouTubeKit', :git => 'https://github.com/dpwilhelmsen/XCDYouTubeKit', :branch => 'hotfix/fix-get-video-info-error'

I tried this fix, but it doesn't work.


<CATransformLayer: 0x6000038770c0> - changing property masksToBounds in transform-only layer, will have no effect
<CATransformLayer: 0x6000038720e0> - changing property masksToBounds in transform-only layer, will have no effect
<CATransformLayer: 0x600003884840> - changing property masksToBounds in transform-only layer, will have no effect
[] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
[plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600003884bc0> F8BB1C28-BAE8-11D6-9C31-00039315CD46
<CATransformLayer: 0x600003872d00> - changing property masksToBounds in transform-only layer, will have no effect
<CATransformLayer: 0x60000386bf20> - changing property masksToBounds in transform-only layer, will have no effect
<CATransformLayer: 0x600003884840> - changing property allowsGroupBlending in transform-only layer, will have no effect
<CATransformLayer: 0x600003872d00> - changing property allowsGroupBlending in transform-only layer, will have no effect```
mirco1000 commented 2 years ago

hello, pod 'XCDYouTubeKit', :git => 'https://github.com/dpwilhelmsen/XCDYouTubeKit', :branch => 'hotfix/fix-get-video-info-error' not working for me please give a working pod version

Pgmr-sagar commented 2 years ago

hello, pod 'XCDYouTubeKit', :git => 'https://github.com/dpwilhelmsen/XCDYouTubeKit', :branch => 'hotfix/fix-get-video-info-error' not working for me please give a working pod version

Now getting -2 XCDYouTubeVideoErrorDomain error -2 Need urgent fix or i think i'll get fired 🥲