-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails more often #501
Comments
Not sure whether we have same issue. Error Domain=XCDYouTubeVideoErrorDomain Code=-2 "Video unavailable" UserInfo={NSURL=https://www.youtube.com/get_video_info?el=embedded&hl=en&ps=default&video_id=ZpkkUVlyTyw, NSLocalizedDescription=Video unavailable, AllowedCountries={( |
Here's one more link: Also fails occasionally with the same error [XCDYouTubeKit] Video operation finished with error: Video unavailable Playback failed three times in a row, then played well a couple times.. Curious case and it may be hard to catch or even investigate what the problem is. |
The way i see this issue being debugged:
Too bad i am not an objective-c developer. I hope someone can do this to help resolving this issue. |
I am pretty sure this issue from a similar php repo is the same problem and they solved it. |
Seems to be that get_vieo_info embed page returns: |
Test Video:
|
I've finally been able to replicate this issue. It seems that sometimes the embedded page needs to be fetched as last resort. |
Can everyone try the changes I made in the
|
@SoneeJohn thank you for your efforts. I have setup a test app that includes both the old method (master branch) and your new method (develop branch) and i did 12 tests, here are the results: error message for the old method error message for the one failure of the new method An observation: In the case where both succeeded, they took the same time. In the case where the old method fails, the new method takes extra time to finish, which is because of an extra request to the embed endpoint, correct? I think it is safe to say that this resolves the issue. |
With more testing, i got two crashes with this message. Happened twice in nearly 20 tries. 2020-10-26 22:48:21.357691+0300 testing[3781:149955] *** Assertion failure in -[XCDYouTubeClient getVideoWithIdentifier:cookies:customPatterns:completionHandler:], XCDYouTubeClient.m:69 2020-10-26 22:48:21.360662+0300 testing[3781:149955] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Both |
Can you give me the full console output when this happened? |
@MhmdSalah I made some additional changes can you update to the latest commit (be sure to clean you build folder) |
Here is a full log for the crash: https://pastebin.com/ySGmWHyw |
Should address failing in 0xced#501
Here is a full dump of my last 22 tests: https://pastebin.com/VMxFeG8v One important observation is: in the one failure for the new method, the old method actually worked and the new method returned the country error with a list of AllowedCountries that actually includes my country. |
Thanks! I see what was the last request, did you change the |
Thanks! That last error might be due to a HTTP 429 error. I will update the library to better report these. |
Yes i did. |
@MhmdSalah Just updated again with some new changes. |
now it does not work anymore. Takes to many times to get a song or it gets a crash
|
Did you try the |
thanks. it works fine. is there any way for this library to adapt any changes from YouTube? |
@SoneeJohn Thanks for the effort! The lastest |
@SoneeJohn |
* Adaptation to YouTube API change (#501) * New `XCDYouTubeErrorUnknown` error code (#484, #491) * New `XCDYouTubeErrorTooManyRequests` error code ([comment](#501 (comment))) * Improve error message for `XCDYouTubeErrorNoStreamAvailable` code * Remove platforms in Swift Package Manager (#496)
Hello @SoneeJohn and Thank you for your efforts. I just wanted to give you heads up that starting today, the old version (anything before 2.15.0) has a 100% failure rate. Meanwhile, the new update is working correctly. |
Should address failing in 0xced#501
* Adaptation to YouTube API change (0xced#501) * New `XCDYouTubeErrorUnknown` error code (0xced#484, 0xced#491) * New `XCDYouTubeErrorTooManyRequests` error code ([comment](0xced#501 (comment))) * Improve error message for `XCDYouTubeErrorNoStreamAvailable` code * Remove platforms in Swift Package Manager (0xced#496)
Hello there.
I noticed that as of recently, the main function "getVideoWithIdentifier" fails more often returning error with code -2 "NoStreamAvailable".
This is not a 100% case, as it seems to happen often but not always. I implemented a temporary solution by retrying for 2 times when it fails.
I know about youtube that when they implement a change to their system, it is rolled partially in such manner and it will most likely break XCDYouTubeKit when they fully roll the new changes.
On a side note, the main repo for youtube-dl has been taken down. Do you think this lib could follow? do you have any plans if this happens?
The text was updated successfully, but these errors were encountered: