0xced / XCDYouTubeKit

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

Can't get video in app, but in another app video is successfully playing #476

Closed DmitriiGamberov closed 3 years ago

DmitriiGamberov commented 4 years ago

Hello! 2 applicationcs uses XCDYouTubeKit, in first application all works as expected, but in second (implementation is same) getting error - many many strings of JS in console and then error: Error Domain=XCDYouTubeVideoErrorDomain Code=-2 "(null)" UserInfo={NSURL=https://www.youtube.com/get_video_info?el=detailpage&hl=ru&ps=default&video_id=i6VUQoen_GA}

As you can see videoId is i6VUQoen_GA, but problem is for all videos Both apps using 2.12 version and trying to get video by XCDYouTubeClient.default().getVideoWithIdentifier

dlpigpen commented 4 years ago

The same here. it now is occurring a few videos

SoneeJohn commented 4 years ago

Please update to the latest version of the library and try again.

dlpigpen commented 4 years ago

Please update to the latest version of the library and try again.

I can confirm that version 2.14 still does not work. A few videos work fine but some of the another videos are not.

someziggyman commented 4 years ago

The url you're using is rather strange looking.. using it in browser downloads some "get video info" file with contents of "errorcode=2&status=fail&reason=Invalid+parameters." Just use normal youtube video URL format and you'll be fine https://www.youtube.com/watch?v=i6VUQoen_GA_7D

TrongTran95 commented 4 years ago

Please update to the latest version of the library and try again.

Same problem here. I've updated to newest version but still does not work. Code: XCDYouTubeClient.default().getVideoWithIdentifier("ewpJk50cjTM") { (video, error) in } Error: [XCDYouTubeKit] Video operation finished with error: The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error -2.) Domain: XCDYouTubeVideoErrorDomain Code: -2 User Info: { }

SoneeJohn commented 4 years ago

@TrongTran95 @dlpigpen Please try again and include the full console read out.

dlpigpen commented 4 years ago

XCDYouTubeClient.default().getVideoWithIdentifier("ewpJk50cjTM") { (video, error) in } Error: [XCDYouTubeKit] Video operation finished with error: The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error -2.) Domain: XCDYouTubeVideoErrorDomain Code: -2 User Info: { }

TrongTran95 commented 4 years ago

@TrongTran95 @dlpigpen Please try again and include the full console read out.

Still got same Error: [XCDYouTubeKit] Video operation finished with error: The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error -2.) Domain: XCDYouTubeVideoErrorDomain Code: -2 User Info: { } The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error -2.) [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C39.1:2][0x1107f2d30] get output frames failed, state 8196 [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C39.1:2][0x1107f2d30] get output frames failed, state 8196 TIC Read Status [39:0x0]: 1:57 TIC Read Status [39:0x0]: 1:57

The strange thing is that the percentage of this error was about 90% of the video that I've tested. Please use these video identifier for testing:

By the way, I'm using pod 'XCDYoutubeKit' pod "XCDYouTubeKit", "~> 2.14" is currently not working when I tried to install it => Error: CocoaPods could not find compatible versions for pod "XCDYouTubeKit": In Podfile: XCDYouTubeKit (\~> 2.14) None of your spec sources contain a spec satisfying the dependency: XCDYouTubeKit (~> 2.14).

SoneeJohn commented 4 years ago

@TrongTran95 Can I see your pod file?

TrongTran95 commented 4 years ago

@TrongTran95 Can I see your pod file?


# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target ‘YoutubePlayer’ do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
pod 'Floaty', '~> 4.2.0'
pod "XCDYouTubeKit"
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'FirebaseFirestoreSwift'

pod 'SideMenu'
pod 'SCLAlertView'

Pods for YoutubePlayer

end

SoneeJohn commented 4 years ago

Can you try running pod update XCDYouTubeKit

TrongTran95 commented 4 years ago

Can you try running pod update XCDYouTubeKit

pod update XCDYouTubeKit
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing XCDYouTubeKit 2.14.0 (was 2.13.0 and source changed to `https://cdn.cocoapods.org/` from `trunk`)
Generating Pods project
Integrating client project
Pod installation complete! There are 8 dependencies from the Podfile and 26 total pods installed.

Build and run again but nothing change.

SoneeJohn commented 4 years ago

@TrongTran95 Clean your project and try again. I am able to play all those videos you listed.

TrongTran95 commented 4 years ago

@TrongTran95 Clean your project and try again. I am able to play all those videos you listed.

Thank you very much. I was able to play those videos again after clean and rebuild project.

SRykhletskiy commented 4 years ago

Hi, I have the same error in my iOS app Code: [[XCDYouTubeClient defaultClient] getVideoWithIdentifier:"KB-s_p4eIHE" completionHandler:^(XCDYouTubeVideo video, NSError error) {} Result: Error Domain=XCDYouTubeVideoErrorDomain Code=-2 "(null)" User Info: {}

I'm using pod 'XCDYoutubeKit' current version - 2.14.0