Skip to content
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

Closed
MhmdSalah opened this issue Oct 23, 2020 · 26 comments
Closed

Fails more often #501

MhmdSalah opened this issue Oct 23, 2020 · 26 comments

Comments

@MhmdSalah
Copy link

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?

@JmyW
Copy link

JmyW commented Oct 25, 2020

Not sure whether we have same issue.
Start from 2 days ago, it failed more often. Not sure it's because same issue like @MhmdSalah or it's because my upgrade for iOS14.
I play videos one and one. It often got error as following. The rate may be ~2/10 times.
But if I retry the failed video, it becomes well. So, there is no specific video cannot be played, but sometimes extract failed.

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={(
Hungary,
Vietnam,
"New Caledonia",
Burundi,
Andorra,
"Pitcairn Islands",
Guinea,
"Norfolk Island",
Togo,
Eritrea,
Zambia,
Syria,
Mongolia,
Thailand,
Netherlands,
"French Guiana",
India,
Sudan,
Nicaragua,
Tanzania,
Algeria,
Grenada,
Venezuela,
"Dominican Republic",
Turkey,
"New Zealand",
Serbia,
Japan,
Monaco,
Finland,
Paraguay,
Lithuania,
Suriname,
Dominica,
Mauritania,
Armenia,
Panama,
"St. Martin",
Guernsey,
Cambodia,
"Western Sahara",
Azerbaijan,
Gabon,
Macao,
Tonga,
Bhutan,
Lebanon,
"Hong Kong",
"Svalbard & Jan Mayen",
"Falkland Islands",
Montserrat,
"Cura\U00e7ao",
"St. Helena",
Peru,
"Isle of Man",
"Congo - Kinshasa",
Liberia,
Oman,
Ethiopia,
Vanuatu,
Romania,
Nepal,
Norway,
Niger,
"South Sudan",
"So. Georgia & So. Sandwich Isl.",
Turkmenistan,
Germany,
Aruba,
Comoros,
"French Polynesia",
Belgium,
Somalia,
"U.S. Outlying Islands",
"American Samoa",
Albania,
"Sint Maarten",
"Myanmar (Burma)",
Anguilla,
Botswana,
"Faroe Islands",
"Solomon Islands",
Cuba,
Guyana,
Nauru,
"North Macedonia",
"North Korea",
"El Salvador",
Honduras,
Moldova,
Taiwan,
"Equatorial Guinea",
Chile,
Uzbekistan,
Bermuda,
"British Indian Ocean Territory",
Liechtenstein,
Argentina,
Libya,
Tajikistan,
"Costa Rica",
"China mainland",
Canada,
Italy,
"Congo - Brazzaville",
Guam,
Qatar,
Mexico,
"R\U00e9union",
Malaysia,
Cameroon,
Slovakia,
"Cayman Islands",
"\U00c5land Islands",
Iran,
Micronesia,
"San Marino",
Poland,
Maldives,
Cyprus,
Israel,
Uruguay,
Palau,
Belarus,
Bangladesh,
Nigeria,
Russia,
Gibraltar,
"Northern Mariana Islands",
Ireland,
Croatia,
"Timor-Leste",
Brazil,
Barbados,
Colombia,
"Cook Islands",
Portugal,
"Christmas Island",
Bahamas,
Pakistan,
Bolivia,
"Heard & McDonald Islands",
Mali,
Ghana,
"Antigua & Barbuda",
"Sri Lanka",
Iraq,
"South Africa",
Kuwait,
"Puerto Rico",
Czechia,
Gambia,
"Cape Verde",
Latvia,
Fiji,
"Palestinian Territories",
Martinique,
"St. Lucia",
Mayotte,
Iceland,
"British Virgin Islands",
Switzerland,
Singapore,
"Guinea-Bissau",
Austria,
Namibia,
Mauritius,
Benin,
Tokelau,
Afghanistan,
"St. Kitts & Nevis",
Bahrain,
"United States",
Chad,
Brunei,
Angola,
"Papua New Guinea",
"United Arab Emirates",
Kazakhstan,
Spain,
Guatemala,
"Cocos (Keeling) Islands",
"U.S. Virgin Islands",
Eswatini,
Ukraine,
Philippines,
"French Southern Territories",
"S\U00e3o Tom\U00e9 & Pr\U00edncipe",
"South Korea",
Djibouti,
Jamaica,
Slovenia,
Samoa,
Luxembourg,
Tuvalu,
Senegal,
"Wallis & Futuna",
Estonia,
Seychelles,
"Saudi Arabia",
Morocco,
Greece,
Georgia,
Kenya,
Tunisia,
Malta,
"St. Vincent & Grenadines",
"Vatican City",
"Marshall Islands",
Jersey,
"Turks & Caicos Islands",
"St. Barth\U00e9lemy",
Laos,
Ecuador,
Yemen,
Belize,
Malawi,
Antarctica,
Sweden,
Greenland,
"Bosnia & Herzegovina",
Jordan,
Zimbabwe,
"Bouvet Island",
France,
"Trinidad & Tobago",
Mozambique,
Egypt,
"United Kingdom",
Lesotho,
Australia,
Uganda,
Kyrgyzstan,
Denmark,
"Central African Republic",
"Sierra Leone",
Montenegro,
Kiribati,
"Burkina Faso",
Niue,
Guadeloupe,
Indonesia,
Madagascar,
"C\U00f4te d\U2019Ivoire",
"St. Pierre & Miquelon",
Rwanda,
Haiti,
Bulgaria,
"Caribbean Netherlands"
)}})

@someziggyman
Copy link

Here's one more link:
https://youtu.be/dX3k_QDnzHE
or
https://www.youtube.com/watch?v=dX3k_QDnzHE

Also fails occasionally with the same error [XCDYouTubeKit] Video operation finished with error: Video unavailable
Domain: XCDYouTubeVideoErrorDomain
Code: -2

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.

@MhmdSalah
Copy link
Author

Here's one more link:
https://youtu.be/dX3k_QDnzHE
or
https://www.youtube.com/watch?v=dX3k_QDnzHE

Also fails occasionally with the same error [XCDYouTubeKit] Video operation finished with error: Video unavailable
Domain: XCDYouTubeVideoErrorDomain
Code: -2

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:

  • Change the code to print the response from the youtube endpoint
  • Make a copy of a response that is successfully parsed and another response that results in failure.
  • Compare them to find what has changed.

Too bad i am not an objective-c developer. I hope someone can do this to help resolving this issue.

@MhmdSalah
Copy link
Author

I am pretty sure this issue from a similar php repo is the same problem and they solved it.
Athlon1600/youtube-downloader#73

@GEverding
Copy link

Seems to be that get_vieo_info embed page returns: url_encoded_fmt_stream_map=&apiary_host=&.

@GEverding
Copy link

Test Video: pvuN_WvF1to

player_response=%7B%22playabilityStatus%22%3A%7B%22status%22%3A%22UNPLAYABLE%22%2C%22reason%22%3A%22This+video+is+unavailable.%22%2C%22errorScreen%22%3A%7B%22playerErrorMessageRenderer%22%3A%7B%22reason%22%3A%7B%22simpleText%22%3A%22This+video+is+unavailable.%22%7D%2C%22proceedButton%22%3A%7B%22buttonRenderer%22%3A%7B%22style%22%3A%22STYLE_PRIMARY%22%2C%22size%22%3A%22SIZE_DEFAULT%22%2C%22isDisabled%22%3Afalse%2C%22text%22%3A%7B%22simpleText%22%3A%22Watch+on+YouTube%22%7D%2C%22trackingParams%22%3A%22CAUQ8FsiEwi_2LXh-PffAhVC6JwKHY7gCqwop5UD%22%7D%7D%2C%22thumbnail%22%3A%7B%22thumbnails%22%3A%5B%7B%22url%22%3A%22%2F%2Fs.ytimg.com%2Fyts%2Fimg%2Fmeh7-vflGevej7.png%22%2C%22width%22%3A140%2C%22height%22%3A100%7D%5D%7D%2C%22icon%22%3A%7B%22iconType%22%3A%22ERROR_OUTLINE%22%7D%7D%7D%7D%2C%22videoDetails%22%3A%7B%22videoId%22%3A%22dQw4w9WgXcQ%22%2C%22title%22%3A%22Rick+Astley+-+Never+Gonna+Give+You+Up+%28Video%29%22%2C%22lengthSeconds%22%3A%22212%22%2C%22keywords%22%3A%5B%22Rick+Astley%22%2C%22RickAstleyvevo%22%2C%22Rick+Astley+VEVO%22%2C%22vevo%22%2C%22official%22%2C%22Rick+Roll%22%2C%22video%22%2C%22Rick+Astley+full+album%22%2C%22music+video%22%2C%22Rick+Astley+album%22%2C%22hq%22%2C%22rick+astley+official%22%2C%22single%22%2C%22never+gonna+give+you+up%22%2C%22album%22%2C%22together+forever%22%2C%22Never+Gonna+Give+You+Up%22%2C%22Whenever+You+Need+Somebody%22%2C%22take+me+to+your+heart%22%2C%22pop%22%2C%22Sony%22%2C%22Sony+Music%22%2C%22Sony+Music+UK%22%2C%22Legacy%22%2C%22rickrolled%22%2C%22THE+A-Z+OF+YOUTUBE+-+ONLINE+PRO+FILM%22%2C%22Youtube+promo%22%2C%22FLYING+OBJECT%22%2C%22ad%22%2C%2280s%22%2C%22WRECK-IT%22%2C%22RALPH%22%5D%2C%22channelId%22%3A%22UC38IQsAvIsxxjztdMZQtwHA%22%2C%22isOwnerViewing%22%3Afalse%2C%22shortDescription%22%3A%22Rick+Astley+-+Never+Gonna+Give+You+Up+%28Official+Video%29+-+Listen+On+Spotify%3A+http%3A%2F%2Fsmarturl.it%2FAstleySpotify%5CnLearn+more+about+the+brand+new+album+%E2%80%98Beautiful+Life%E2%80%99%3A+https%3A%2F%2FRickAstley.lnk.to%2FBeautifulLifeND%5Cn%5CnBuy+On+iTunes%3A+http%3A%2F%2Fsmarturl.it%2FAstleyGHiTunes%5CnAmazon%3A+http%3A%2F%2Fsmarturl.it%2FAstleyGHAmazon%5Cn%5CnFollow+Rick+Astley%5CnWebsite%3A+http%3A%2F%2Fwww.rickastley.co.uk%2F%5CnTwitter%3A+https%3A%2F%2Ftwitter.com%2Frickastley%5CnFacebook%3A+https%3A%2F%2Fwww.facebook.com%2FRickAstley%2F%5CnInstagram%3A++https%3A%2F%2Fwww.instagram.com%2Fofficialric...%5Cn%5Cn%23RickAstley+%23NeverGonnaGiveYouUp+%23RickAstleyofficial+%23RickAstleyAlbum+%23RickAstleyofficialvideo+%23RickAstleyofficialaudio+%23RickAstleysongs+%23RickAstleyNeverGonnaGiveYouUp+%23WRECKITRALPH2+%23RALPHBREAKSTHEINTERNET%5Cn%5Cn%5CnLyrics%5Cn%5CnWe%27re+no+strangers+to+love%5CnYou+know+the+rules+and+so+do+I%5CnA+full+commitment%27s+what+I%27m+thinking+of%5CnYou+wouldn%27t+get+this+from+any+other+guy%5Cn%5CnI+just+wanna+tell+you+how+I%27m+feeling%5CnGotta+make+you+understand%5Cn%5CnNever+gonna+give+you+up%5CnNever+gonna+let+you+down%5CnNever+gonna+run+around+and+desert+you%5CnNever+gonna+make+you+cry%5CnNever+gonna+say+goodbye%5CnNever+gonna+tell+a+lie+and+hurt+you%5Cn%5CnWe%27ve+known+each+other+for+so+long%5CnYour+heart%27s+been+aching%2C+but%5CnYou%27re+too+shy+to+say+it%5CnInside%2C+we+both+know+what%27s+been+going+on%5CnWe+know+the+game+and+we%27re+gonna+play+it%5Cn%5CnAnd+if+you+ask+me+how+I%27m+feeling%5CnDon%27t+tell+me+you%27re+too+blind+to+see%5Cn%5CnNever+gonna+give+you+up%5CnNever+gonna+let+you+down%5CnNever+gonna+run+around+and+desert+you%5CnNever+gonna+make+you+cry%5CnNever+gonna+say+goodbye%5CnNever+gonna+tell+a+lie+and+hurt+you%5Cn%5CnNever+gonna+give+you+up%5CnNever+gonna+let+you+down%5CnNever+gonna+run+around+and+desert+you%5CnNever+gonna+make+you+cry%5CnNever+gonna+say+goodbye%5CnNever+gonna+tell+a+lie+and+hurt+you%5Cn%5Cn%28Ooh%2C+give+you+up%29%5Cn%28Ooh%2C+give+you+up%29%5CnNever+gonna+give%2C+never+gonna+give%5Cn%28Give+you+up%29%5CnNever+gonna+give%2C+never+gonna+give%5Cn%28Give+you+up%29%5Cn%5CnWe%27ve+known+each+other+for+so+long%5CnYour+heart%27s+been+aching%2C+but%5CnYou%27re+too+shy+to+say+it%5CnInside%2C+we+both+know+what%27s+been+going+on%5CnWe+know+the+game+and+we%27re+gonna+play+it%5Cn%5CnI+just+wanna+tell+you+how+I%27m+feeling%5CnGotta+make+you+understand%5Cn%5CnNever+gonna+give+you+up%5CnNever+gonna+let+you+down%5CnNever+gonna+run+around+and+desert+you%5CnNever+gonna+make+you+cry%5CnNever+gonna+say+goodbye%5CnNever+gonna+tell+a+lie+and+hurt+you%5Cn%5CnNever+gonna+give+you+up%5CnNever+gonna+let+you+down%5CnNever+gonna+run+around+and+desert+you%5CnNever+gonna+make+you+cry%5CnNever+gonna+say+goodbye%5CnNever+gonna+tell+a+lie+and+hurt+you%5Cn%5CnNever+gonna+give+you+up%5CnNever+gonna+let+you+down%5CnNever+gonna+run+around+and+desert+you%5CnNever+gonna+make+you+cry%5CnNever+gonna+say+goodbye%5CnNever+gonna+tell+a+lie+and+hurt+you%5C%22%22%2C%22isCrawlable%22%3Atrue%2C%22thumbnail%22%3A%7B%22thumbnails%22%3A%5B%7B%22url%22%3A%22https%3A%2F%2Fi.ytimg.com%2Fvi%2FdQw4w9WgXcQ%2Fhqdefault.jpg%3Fsqp%3D-oaymwEiCKgBEF5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ%3D%3D%5Cu0026rs%3DAOn4CLA5Omrav45uItUbRsmjEqaPxNlF2w%22%2C%22width%22%3A168%2C%22height%22%3A94%7D%2C%7B%22url%22%3A%22https%3A%2F%2Fi.ytimg.com%2Fvi%2FdQw4w9WgXcQ%2Fhqdefault.jpg%3Fsqp%3D-oaymwEiCMQBEG5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ%3D%3D%5Cu0026rs%3DAOn4CLAZnR3UUWV7JZdULd8cRA63RoAcVQ%22%2C%22width%22%3A196%2C%22height%22%3A110%7D%2C%7B%22url%22%3A%22https%3A%2F%2Fi.ytimg.com%2Fvi%2FdQw4w9WgXcQ%2Fhqdefault.jpg%3Fsqp%3D-oaymwEjCPYBEIoBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE%3D%5Cu0026rs%3DAOn4CLBW5JbJn5nTCNKe8PvMuOqEiuttiQ%22%2C%22width%22%3A246%2C%22height%22%3A138%7D%2C%7B%22url%22%3A%22https%3A%2F%2Fi.ytimg.com%2Fvi%2FdQw4w9WgXcQ%2Fhqdefault.jpg%3Fsqp%3D-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE%3D%5Cu0026rs%3DAOn4CLDOZ1h20ByRP_-2KuQ-l58BHOqkFA%22%2C%22width%22%3A336%2C%22height%22%3A188%7D%5D%7D%2C%22averageRating%22%3A4.8261395%2C%22allowRatings%22%3Atrue%2C%22viewCount%22%3A%22518274858%22%2C%22author%22%3A%22RickAstleyVEVO%22%2C%22isPrivate%22%3Afalse%2C%22isUnpluggedCorpus%22%3Afalse%2C%22isLiveContent%22%3Afalse%7D%2C%22messages%22%3A%5B%7B%22mealbarPromoRenderer%22%3A%7B%22messageTexts%22%3A%5B%7B%22runs%22%3A%5B%7B%22text%22%3A%22Household+sharing+included.+No+complicated+set-up.+Unlimited+DVR+storage+space.+Cancel+anytime.%22%7D%5D%7D%5D%2C%22actionButton%22%3A%7B%22buttonRenderer%22%3A%7B%22style%22%3A%22STYLE_PRIMARY%22%2C%22size%22%3A%22SIZE_DEFAULT%22%2C%22text%22%3A%7B%22runs%22%3A%5B%7B%22text%22%3A%22Try+it+free%22%7D%5D%7D%2C%22navigationEndpoint%22%3A%7B%22clickTrackingParams%22%3A%22CAQQ7G8iEwi_2LXh-PffAhVC6JwKHY7gCqwop5UD%22%2C%22urlEndpoint%22%3A%7B%22url%22%3A%22https%3A%2F%2Ftv.youtube.com%2F%3Futm_source%3Ddmea%5Cu0026utm_medium%3Dnp%5Cu0026utm_campaign%3Ddmea_evglo19h%5Cu0026pid%3Ddmea-acq-u-2evgloh%22%7D%7D%2C%22trackingParams%22%3A%22CAQQ7G8iEwi_2LXh-PffAhVC6JwKHY7gCqwop5UD%22%7D%7D%2C%22dismissButton%22%3A%7B%22buttonRenderer%22%3A%7B%22style%22%3A%22STYLE_BLUE_TEXT%22%2C%22size%22%3A%22SIZE_DEFAULT%22%2C%22text%22%3A%7B%22runs%22%3A%5B%7B%22text%22%3A%22No+thanks%22%7D%5D%7D%2C%22serviceEndpoint%22%3A%7B%22clickTrackingParams%22%3A%22CAMQ7W8iEwi_2LXh-PffAhVC6JwKHY7gCqwop5UD%22%2C%22feedbackEndpoint%22%3A%7B%22feedbackToken%22%3A%22AB9zfpIImwnx78SwNeq9v9wx4FN5MCk_LGJrCv3W9eJKJCIwXmlv7dfuSEoeZ3QNADjzLPe86siKXPjEYBzhNsHUN9OsXxL8zN5QOhs7qcx8HC3XxpFe48gHEbeCQR3IyPImEpKe1IXLxabH4EJq6uxECTLy0CLZIw%22%2C%22uiActions%22%3A%7B%22hideEnclosingContainer%22%3Atrue%7D%7D%7D%2C%22trackingParams%22%3A%22CAMQ7W8iEwi_2LXh-PffAhVC6JwKHY7gCqwop5UD%22%7D%7D%2C%22triggerCondition%22%3A%22TRIGGER_CONDITION_POST_AD%22%2C%22style%22%3A%22STYLE_MESSAGE%22%2C%22trackingParams%22%3A%22CAIQ42kYACITCL_YteH4998CFULonAodjuAKrCinlQM%3D%22%2C%22impressionEndpoints%22%3A%5B%7B%22clickTrackingParams%22%3A%22CAIQ42kYACITCL_YteH4998CFULonAodjuAKrCinlQM%3D%22%2C%22feedbackEndpoint%22%3A%7B%22feedbackToken%22%3A%22AB9zfpLLZgqavsDgeHfhSLUP9qccwJ9RUt6rAXxPBxdLvaWnLYxCr5nWnqedNr57pRlUJGgQ8eV_008z9T6FVZIIDSSMX-lr58pB0fnNC9nSvP2aqrZ1Ph-eTw1fIrFGnFQHSolzi4ESKKd9pi0CqQ_vmRU_1NVXJQ%22%2C%22uiActions%22%3A%7B%22hideEnclosingContainer%22%3Afalse%7D%7D%7D%5D%2C%22isVisible%22%3Atrue%2C%22messageTitle%22%3A%7B%22runs%22%3A%5B%7B%22text%22%3A%22YouTube+TV+-+No+long+term+contract%22%7D%5D%7D%7D%7D%5D%2C%22adSafetyReason%22%3A%7B%22isEmbed%22%3Atrue%2C%22isRemarketingEnabled%22%3Atrue%2C%22isFocEnabled%22%3Atrue%7D%7D&ssl=1&errordetail=0&length_seconds=212&token=1&cr=US&tmi=1&innertube_api_version=v1&enablecsi=1&no_get_video_log=1&external_play_video=1&status=fail&csi_page_type=embed&root_ve_type=51879&timestamp=1547835550&author=RickAstleyVEVO&innertube_api_key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&errorcode=150&cver=1.20190117&gapi_hint_params=m%3B%2F_%2Fscs%2Fabc-static%2F_%2Fjs%2Fk%3Dgapi.gapi.en.FG3dTgKD_wc.O%2Frt%3Dj%2Fd%3D1%2Frs%3DAHpOoo_ZNd1Q_9wfB-oUWsMjMFF_7HQbqA%2Fm%3D__features__&xhr_apiary_host=youtubei.youtube.com&ldpj=-6&player_error_log_fraction=1.0&reason=This+video+is+unavailable.&innertube_context_client_version=1.20190117&account_playback_token=QUFFLUhqbDZKMU45Z2Q0UVdILXdETUJSc2RhT1BXQWVoUXxBQ3Jtc0tudEpMclNscllZMDc1ckFzdFhGWEFjcDBvUHByTUpUcTRUSmxkSlVGRHRtQk5ZLUFTZlZKVzY0Rng2RmlwTlFCVlJ3Vlg3Rm11V2d0VV9XYU9iaGM4cGxzUUxYYlk1STEzSGEwNmJEemFfZTNzNjkyUQ%3D%3D&itct=CAEQu2kiEwi_2LXh-PffAhVC6JwKHY7gCqwop5UD&url_encoded_fmt_stream_map=&apiary_host=&ucid=UC38IQsAvIsxxjztdMZQtwHA&video_id=dQw4w9WgXcQ&subreason=&c=WEB&t=1&host_language=en&apiary_host_firstparty=&idpj=-3&thumbnail_url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FdQw4w9WgXcQ%2Fdefault.jpg&vss_host=s.youtube.com&fmt_list=&watermark=%2Chttps%3A%2F%2Fs.ytimg.com%2Fyts%2Fimg%2Fwatermark%2Fyoutube_watermark-vflHX6b6E.png%2Chttps%3A%2F%2Fs.ytimg.com%2Fyts%2Fimg%2Fwatermark%2Fyoutube_hd_watermark-vflAzLcD6.png&csn=nhhCXL-RMsLQ8wSOwavgCg&fflags=html5_live_normal_latency_bandwidth_window%3D0.0%26html5_release_mediakey_after_load%3Dtrue%26player_unified_fullscreen_transitions%3Dtrue%26enable_live_premiere_web_player_indicator%3Dtrue%26mweb_undim_skip_button_on_ad_pause%3Dtrue%26html5_adaptation_fix%3Dtrue%26mweb_playsinline%3Dtrue%26html5_connect_timeout_secs%3D7.0%26html5_ignore_bad_bitrates%3Dtrue%26mweb_muted_autoplay%3Dtrue%26desktop_action_companion_wta_support%3Dtrue%26bulleit_remove_client_side_midroll_reactivation%3Dtrue%26web_player_sentinel%3Dtrue%26show_interstitial_white%3Dtrue%26ima_video_ad_with_overlay_class_logging_percentage%3D0.01%26html5_restrict_streaming_xhr_on_sqless_requests%3Dtrue%26html5_max_headm_for_streaming_xhr%3D0%26html5_spherical_bicubic_mode%3D1%26youtubei_for_web%3Dtrue%26web_player_response_multicamera_parsing_killswitch2%3Dtrue%26postroll_notify_time_seconds%3D5%26html5_disable_preserve_reference%3Dtrue%26ad_duration_threshold_for_showing_endcap_seconds%3D15%26html5_exile_broken_instances%3Dtrue%26html5_background_quality_cap%3D360%26html5_ignore_updates_before_initial_ping%3Dtrue%26html5_fallbacks_delay_primary_probes%3Dtrue%26bulleit_check_overlay_container_before_show%3Dtrue%26external_fullscreen_with_edu%3Dtrue%26html5_delay_initial_loading%3Dtrue%26bulleit_register_cue_range_events_before_ad_init%3Dtrue%26html5_pause_video_fix%3Dtrue%26html5_disable_audio_slicing%3Dtrue%26html5_serverside_call_server_on_biscotti_error%3Dtrue%26desktop_player_button_tooltip_with_shortcut%3Dtrue%26hide_preskip%3Dtrue%26html5_enable_non_diegetic%3Dtrue%26html5_aspect_from_adaptive_format%3Dtrue%26kevlar_allow_multistep_video_init%3Dtrue%26mweb_playsinline_webview%3Dtrue%26android_attestation_flow%3Dyt_player%26use_refreshed_overlay_buttons%3Dtrue%26html5_ad_no_buffer_abort_after_skippable%3Dtrue%26html5_request_size_min_secs%3D0.0%26bulleit_publish_external_playback_events%3Dtrue%26allow_live_autoplay%3Dtrue%26tv_html5_bulleit_unify_adinfo%3Dtrue%26html5_probe_live_using_range%3Dtrue%26html5_variability_no_discount_thresh%3D1.0%26show_thumbnail_behind_ypc_offer_module%3Dtrue%26enable_website_actions_on_mweb%3Dtrue%26html5_msi_error_fallback%3Dtrue%26html5_disable_extra_update_resource%3Dtrue%26html5_streaming_xhr_buffer_mdat%3Dtrue%26enable_endcap_on_mweb%3Dtrue%26html5_min_has_advanced%3Dtrue%26low_engagement_player_quality_cap%3D360%26html5_quality_cap_min_age_secs%3D0%26enable_mute_ad_endpoint_resolution_on_bulleit%3Dtrue%26html5_vp9_live_whitelist%3Dtrue%26html5_progressive_fallback%3Dtrue%26delay_ads_gvi_call_on_bulleit_living_room_ms%3D0%26html5_manifestless_shrink_timestamps%3Dtrue%26html5_bandwidth_window_size%3D0%26use_touch_events_for_bulleit_mweb%3Dtrue%26show_countdown_on_bumper%3Dtrue%26mweb_autonav%3Dtrue%26html5_subsegment_readahead_load_speed_check_interval%3D0.5%26use_full_timing_library%3Dtrue%26attach_child_on_gel_web%3Dtrue%26html5_probe_primary_delay_base_ms%3D0%26ad_video_end_renderer_duration_milliseconds%3D7000%26html5_adjust_effective_request_size%3Dtrue%26html5_maximum_readahead_seconds%3D0.0%26html5_ad_stats_bearer%3Dtrue%26android_early_fetch_for_autoplay%3Dtrue%26web_player_assume_format3_available%3Dtrue%26lasr_captions_holdback_counterfactual_id%3D23737832%26html5_background_cap_idle_secs%3D60%26disable_client_side_midroll_freq_capping_nonpc%3Dtrue%26html5_bmffparser_use_fast_read_string%3Dtrue%26deprecate_vss_dallas_cache%3Dtrue%26turn_down_serialized_player_request_for_bulleit_living_room%3Dtrue%26preskip_button_style_ads_backend%3Dcountdown_next_to_thumbnail%26set_default_wta_if_missing_for_externs%3Dtrue%26defer_playability_status_fillers%3Dtrue%26delay_bulleit_media_load_timer%3Dtrue%26desktop_cleanup_companion_on_instream_begin%3Dtrue%26html5_seeking_buffering_only_playing%3Dtrue%26mweb_add_ad_info_button_on_fullscreen_only_devices%3Dtrue%26html5_serverside_biscotti_id_wait_ms%3D1000%26html5_request_size_max_secs%3D31%26tvhtml5_yongle_quality_cap%3D0%26html5_readahead_ratelimit%3D3000%26ad_to_video_use_gel%3Dtrue%26player_external_control_on_classic_desktop%3Dtrue%26html5_inline_video_quality_survey%3Dtrue%26use_survey_skip_in_0s%3Dtrue%26html5_optimality_migration%3Dtrue%26html5_manifestless_captions%3Dtrue%26lasr_captions_holdback_counterfactual%3Dtrue%26bulleit_use_video_end_cuerange_for_completion%3Dtrue%26html5_min_buffer_to_resume%3D6%26html5_tv_bearer%3Dtrue%26html5_reason_reporting_migration%3Dtrue%26web_player_music_visualizer_treatment%3Dfake%26enable_prefetch_for_postrolls%3Dtrue%26website_actions_throttle_percentage%3D1.0%26html5_probe_media_capabilities%3Dtrue%26mweb_ios_handle_player_click_by_touch_event%3Dtrue%26enable_afv_div_reset_in_kevlar%3Dtrue%26html5_gapless%3Dtrue%26live_fresca_v2%3Dtrue%26html5_df_downgrade_thresh%3D0.0%26disable_new_pause_state3%3Dtrue%26html5_platform_minimum_readahead_seconds%3D0.0%26html5_fludd_suspend%3Dtrue%26enable_bulleit_mweb_remix_ui%3Dtrue%26enable_bulleit_ve_single_clickthrough%3Dtrue%26html5_live_pin_to_tail%3Dtrue%26html5_ignore_public_setPlaybackQuality%3Dtrue%26html5_remove_pause%3Dfalse%26html5_probe_secondary_during_timeout_miss_count%3D2%26html5_use_hasAdvanced_for_pbs%3Dtrue%26html5_manifestless_accurate_sliceinfo%3Dtrue%26html5_live_ultra_low_latency_bandwidth_window%3D0.0%26html5_creativeless_vast_on_ima%3Dtrue%26provide_default_wta_reasons%3Dtrue%26html5_parse_inline_fallback_host%3Dtrue%26html5_manifestless_interpolate%3Dtrue%26set_interstitial_advertisers_question_text%3Dtrue%26html5_jumbo_ull_subsegment_readahead_target%3D1.3%26html5_log_hls_video_height_change_as_format_change%3Dtrue%26variable_load_timeout_ms%3D0%26web_player_native_json%3Dtrue%26html5_new_queueing%3Dtrue%26bulleit_block_player_pause_until_ad_start%3Dtrue%26enable_overlay_hide_timer_fix%3Dtrue%26html5_suspend_manifest_on_pause%3Dtrue%26mweb_cougar_big_controls%3Dtrue%26use_always_dimmed_skip_in_bulleit_web%3Dtrue%26html5_hls_min_video_height%3D0%26spacecast_uniplayer_decorate_manifest%3Dtrue%26html5_widevine_robustness_strings%3Dtrue%26desktop_videowall_companion_wta_support%3Dtrue%26enable_overlays_wta%3Dtrue%26html5_stop_video_in_cancel_playback%3Dtrue%26html5_prefer_server_bwe3%3Dtrue%26html5_widevine_hw_secure_all%3Dtrue%26stop_using_ima_sdk_gpt_request_activity%3Dtrue%26enable_bulleit_for_web_gaming%3Dtrue%26html5_store_xhr_headers_readable%3Dtrue%26html5_subsegment_readahead_min_buffer_health_secs_on_timeout%3D0.1%26html5_subsegment_readahead_seek_latency_fudge%3D0.5%26use_ima_media_selection_in_bulleit%3Dtrue%26html5_incremental_parser_coalesce_slice_buffers%3Dtrue%26enable_simple_preview_for_postrolls_html5%3Dtrue%26enable_bulleit_mweb_gaming_ui%3Dtrue%26html5_default_ad_gain%3D0.5%26tvhtml5_disable_live_prefetch%3Dtrue%26fix_bulleit_cue_range_seek%3Dtrue%26html5_get_video_info_timeout_ms%3D30000%26html5_dynamic_readahead_growth_rate%3D0.0%26enable_bulleit_lidar_integration%3Dtrue%26bulleit_terminate_ad_when_ending_with_commands%3Dtrue%26html5_pipeline_ultra_low_latency%3Dtrue%26html5_request_size_padding_secs%3D3.0%26bulleit_use_http_get_by_default_for_get_midroll_info%3Dtrue%26skip_restore_on_abandon_in_bulleit%3Dtrue%26html5_request_sizing_multiplier%3D0.8%26html5_video_tbd_min_kb%3D0%26html5_new_seeking%3Dtrue%26html5_min_upgrade_health%3D0%26html5_reattach_resource_after_timeout_limit%3D0%26kevlar_miniplayer_button%3Dtrue%26html5_min_secs_between_format_selections%3D8.0%26lightweight_watch_video_swf%3Dtrue%26html5_stale_dash_manifest_retry_factor%3D1.0%26html5_no_shadow_env_data_redux%3Dtrue%26kevlar_miniplayer%3Dtrue%26process_extensions_in_vast_wrappers_for_survey_ads%3Dtrue%26html5_max_av_sync_drift%3D50%26playready_on_borg%3Dtrue%26html5_unrewrite_timestamps%3Dtrue%26fast_autonav_in_background%3Dtrue%26html5_live_abr_head_miss_fraction%3D0.0%26html5_autonav_quality_cap%3D0%26html5_vis_upgrades_are_resizes%3Dtrue%26allow_midrolls_on_watch_resume_in_bulleit%3Dtrue%26unplugged_tvhtml5_video_preload_on_focus_delay_ms%3D0%26html5_get_video_info_promiseajax%3Dtrue%26sdk_wrapper_levels_allowed%3D0%26web_player_housebrand_video_url_killswitch%3Dtrue%26live_readahead_seconds_multiplier%3D0.8%26html5_default_quality_cap%3D0%26send_html5_api_stats_ads_abandon%3Dtrue%26vmap_enabled_living_room%3Dtrue%26html5_desktop_vr180_allow_panning%3Dtrue%26mweb_muted_autoplay_animation%3Dshrink%26html5_allowable_liveness_drift_chunks%3D2%26html5_subsegment_readahead_require_whitelist%3Dtrue%26html5_start_date_from_element%3Dtrue%26desktop_companion_wta_support%3Dtrue%26mpu_visible_threshold_count%3D2%26dash_manifest_version%3D5%26html5_license_constraint_delay%3D5000%26html5_tight_max_buffer_allowed_bandwidth_stddevs%3D0.0%26html5_disable_vp8_only_browsers%3Dtrue%26html5_new_vis_fullscreen_and_airplay%3Dtrue%26html5_jumbo_ull_nonstreaming_mffa_ms%3D4000%26defer_player_config_and_threed_deciders%3Dtrue%26web_player_api_logging_fraction%3D0.01%26html5_use_adaptive_live_readahead%3Dtrue%26html5_vp9_live_blacklist_edge%3Dtrue%26html5_variability_full_discount_thresh%3D3.0%26disable_client_side_midroll_freq_capping%3Dtrue%26set_interstitial_start_button%3Dtrue%26html5_pipeline_manifestless%3Dtrue%26html5_post_interrupt_readahead%3D20%26html5_variability_discount%3D0.5%26use_forced_linebreak_preskip_text%3Dtrue%26use_html5_player_event_timeout%3Dtrue%26legacy_autoplay_flag%3Dtrue%26playready_first_play_expiration%3D-1%26lasr_captions_holdback%3Dtrue%26html5_subsegment_readahead_min_buffer_health_secs%3D0.25%26add_border_to_bulleit_mweb_skip%3Dtrue%26enable_embed_autoplay_delay%3Dtrue%26player_destroy_old_version%3Dtrue%26autoplay_time%3D8000%26show_thumbnail_on_standard%3Dtrue%26segment_volume_reporting%3Dtrue%26interaction_click_on_gel_web%3Dtrue%26html5_qoe_bearer%3Dtrue%26enable_kevlar_action_companion_cleanup%3Dtrue%26desktop_shopping_companion_wta_support%3Dtrue%26mweb_enable_instream_ui_refresh%3Dtrue%26html5_incremental_parser_buffer_extra_bytes%3D16384%26html5_log_playback_rate_change_killswitch%3Dtrue%26html5_dont_predict_end_time_in_past%3Dtrue%26enable_instream_companion_on_mweb%3Dtrue%26skip_ad_button_with_thumbnail%3Dtrue%26bulleit_update_tsla_cookie%3Dtrue%26html5_sticky_reduces_discount_by%3D0.0%26max_resolution_for_white_noise%3D360%26use_new_style%3Dtrue%26html5_repredict_interval_secs%3D0.0%26uniplayer_dbp%3Dtrue%26html5_media_fullscreen%3Dtrue%26interaction_screen_on_gel_web%3Dtrue%26bulleit_extract_delayed_mpu_on_all_placement_init%3Dtrue%26dynamic_ad_break_seek_threshold_sec%3D0%26html5_live_4k_more_buffer%3Dtrue%26html5_streaming_xhr_progress_includes_latest%3Dtrue%26html5_disable_move_pssh_to_moov%3Dtrue%26enable_static_font_size_on_text_only_preview%3Dtrue%26enable_bulleit_for_mweb%3Dtrue%26bulleit_get_midroll_info_timeout_ms%3D8000%26html5_manifestless_no_redundant_seek_to_head%3Dtrue%26flex_theater_mode%3Dtrue%26html5_decode_to_texture_cap%3Dtrue%26doubleclick_gpt_retagging%3Dtrue%26html5_preload_media%3Dtrue%26html5_min_readbehind_secs%3D0%26enable_survey_ad_info_dialog%3Dtrue%26bulleit_send_engage_ping_on_companion_click%3Dtrue%26html5_streaming_xhr_optimize_lengthless_mp4%3Dtrue%26fixed_padding_skip_button%3Dtrue%26html5_no_placeholder_rollbacks%3Dtrue%26forced_brand_precap_duration_ms%3D2000%26html5_minimum_readahead_seconds%3D0.0%26preskip_countdown_font_size%3D%26html5_elbow_tracking_tweaks%3Dtrue%26html5_max_live_dvr_window_plus_margin_secs%3D46800.0%26html5_playback_data_migration%3Dtrue%26bulleit_use_video_ad_div_as_overlay_container%3Dtrue%26html5_live_low_latency_bandwidth_window%3D0.0%26enable_text_ad_overlay_link_fix%3Dtrue%26mweb_bulleit_show_ad_top_bar_for_phones%3Dtrue%26midroll_notify_time_seconds%3D5%26html5_incremental_parser_buffer_duration_secs%3D1.5%26html5_subsegment_readahead_timeout_secs%3D2.0%26enable_html5_conversion_ve_reporting%3Dtrue%26bulleit_disable_preroll_release_on_dispose%3Dtrue%26html5_live_no_streaming_impedance_mismatch%3Dtrue%26html5_qoe_intercept%3D%26bulleit_web_dim_skip_using_css%3Dtrue%26html5_min_readbehind_cap_secs%3D60%26html5_manifestless_synchronized%3Dtrue%26web_player_attestation_auth_headers%3Dtrue%26html5_subsegment_readahead_target_buffer_health_secs%3D0.5%26enable_live_premieres_vss_live_type_lp%3Dtrue%26embed_api_deprecation%3Dtrue%26html5_use_media_capabilities%3Dtrue%26king_crimson_player_redux%3Dtrue%26embed_new_info_bar%3Dtrue%26html5_deadzone_multiplier%3D1.0%26use_new_skip_icon%3Dtrue%26call_release_video_in_bulleit%3Dtrue%26use_fast_fade_in_0s%3Dtrue%26www_for_videostats%3Dtrue%26html5_waiting_before_ended%3Dtrue%26web_player_response_live_playback_parsing%3Dtrue%26persist_text_on_preview_button%3Dtrue%26bulleit_use_touch_events_for_skip%3Dtrue%26html5_live_disable_dg_pacing%3Dtrue%26ima_disable_reset_active_media_load_timeout%3Dtrue%26html5_disable_subscribe_new_vis%3Dtrue%26html5_expire_preloaded_players%3Dtrue%26html5_player_autonav_logging%3Dtrue%26mweb_cougar%3Dtrue%26bulleit_mimic_ima_player_api_calls%3Dtrue%26html5_max_readahead_bandwidth_cap%3D0%26html5_manifestless_always_redux%3Dtrue%26html5_max_buffer_duration%3D120%26html5_log_rebuffer_events%3D0%26html5_live_abr_repredict_fraction%3D0.0%26html5_suspend_loader%3Dtrue%26sdk_ad_prefetch_time_seconds%3D-1%26visibility_error_html_dump_sample_rate%3D0.01%26disable_survey_interstitial_for_non_bl_surveys_desktop%3Dtrue%26use_local_interactions_library%3Dtrue%26web_player_sentinel_is_uniplayer%3Dtrue%26html5_shrink_live_timestamps%3Dtrue%26html5_jumbo_mobile_subsegment_readahead_target%3D3.0%26log_playback_associated_web%3Dtrue%26web_player_response_playback_tracking_parsing%3Dtrue%26html5_disable_non_contiguous%3Dtrue%26enable_bulleit%3Dtrue%26live_chunk_readahead%3D3%26html5_serverside_call_server_on_biscotti_timeout%3Dtrue%26fix_gpt_pos_params%3Dtrue%26html5_tight_max_buffer_allowed_impaired_time%3D0.0%26html5_frame_accurate_seek_limit%3D3%26variable_buffer_timeout_ms%3D0%26html5_peak_shave%3Dtrue%26html5_hfr_quality_cap%3D0%26html5_manifestless_request_prediction%3Dtrue%26html5_cut_vss_on_visibility%3Dtrue%26html5_av1_thresh%3D0%26html5_enable_embedded_player_visibility_signals%3Dtrue%26bulleit_register_placements_in_order%3Dtrue%26html5_ultra_low_latency_streaming_responses%3Dtrue%26bulleit_use_cue_video_to_reset_on_stop_ad%3Dtrue%26bulleit_round_up_tsla%3Dtrue%26html5_enable_webm_cue_refactor%3Dtrue%26web_logging_max_batch%3D100%26html5_subsegment_readahead_min_load_speed%3D1.5%26html5_hls_initial_bitrate%3D0%26web_player_kaios_autoplay%3Dtrue%26vss_dni_delayping%3D0%26dynamic_ad_break_pause_threshold_sec%3D0%26desktop_image_companion_wta_support%3Dtrue%26tvhtml5_min_readbehind_secs%3D20%26show_interstitial_for_3s%3Dtrue&hl=en_US&title=Rick+Astley+-+Never+Gonna+Give+You+Up+%28Video%29&fexp=23710476%2C23721898%2C23733013%2C23735273%2C23737673%2C23744176%2C23751767%2C23752317%2C23752869%2C23755886%2C23755898%2C23758087%2C23760462%2C23760559%2C23761607%2C23762649%2C23772104%2C23774273%2C23774299%2C23777852%2C23779813%2C23781140%2C23781338%2C23783189%2C23783369%2C23783454%2C23786541%2C23786565%2C23786611%2C23787117%2C23787148%2C23787703%2C23787961%2C23788426%2C23788838%2C9449243%2C9471239%2C9471659%2C9475662%2C9485000

SoneeJohn added a commit that referenced this issue Oct 26, 2020
Should address failing in #501
@SoneeJohn
Copy link
Collaborator

I've finally been able to replicate this issue. It seems that sometimes the embedded page needs to be fetched as last resort.

@SoneeJohn
Copy link
Collaborator

SoneeJohn commented Oct 26, 2020

Can everyone try the changes I made in the develop branch to see if it fails less often. If you're using CocoaPods add this:

pod "XCDYouTubeKit", :git => 'https://github.com/0xced/XCDYouTubeKit.git', :branch => 'develop'
to your Podfile

@SoneeJohn
Copy link
Collaborator

Everyone whose having issues add the XCDYouTubeKitLogLevel environment variable to your run action with the value set to 4. This will give me more info, when you encounter an error copy the everything in the console and add your comment here.

Screen Shot 2020-10-26 at 9 51 35 AM

@MhmdSalah
Copy link
Author

@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:
NEWMETHOD - 11/12 SUCCESSFUL
OLDMETHOD - 8/12 SUCCESSFUL

error message for the old method
Error Domain=XCDYouTubeVideoErrorDomain Code=-2 "(null)" UserInfo={NSURL=https://www.youtube.com/get_Video_info?Video_id=at_saBySuTg&el=detailpage&hl=en&ps=default}

error message for the one failure of the new method
rror Domain=XCDYouTubeVideoErrorDomain Code=-2 "Video unavailable" UserInfo={NSURL=https://www.youtube.com/get_video_info?el=embedded&hl=en&ps=default&video_id=YoRvaCsWWqk, NSLocalizedDescription=Video unavailable}

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.

@MhmdSalah
Copy link
Author

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 video and error can not be nil if the operation was not canceled.'

SoneeJohn added a commit that referenced this issue Oct 26, 2020
@SoneeJohn
Copy link
Collaborator

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 video and error can not be nil if the operation was not canceled.'

Can you give me the full console output when this happened?

@SoneeJohn
Copy link
Collaborator

@MhmdSalah I made some additional changes can you update to the latest commit (be sure to clean you build folder)

@MhmdSalah
Copy link
Author

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 video and error can not be nil if the operation was not canceled.'

Can you give me the full console output when this happened?

Here is a full log for the crash: https://pastebin.com/ySGmWHyw
I had to test 22 times before the crash occurred. The tests were made without your last update. I am updating right now.

CWftw pushed a commit to CWftw/XCDYouTubeKit that referenced this issue Oct 26, 2020
@MhmdSalah
Copy link
Author

Here is a full dump of my last 22 tests: https://pastebin.com/VMxFeG8v
Summary:
NEWMETHOD - 21/22 SUCCESSFUL
OLDMETHOD - 11/22 SUCCESSFUL

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.

@SoneeJohn
Copy link
Collaborator

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 video and error can not be nil if the operation was not canceled.'

Can you give me the full console output when this happened?

Here is a full log for the crash: https://pastebin.com/ySGmWHyw
I had to test 22 times before the crash occurred. The tests were made without your last update. I am updating right now.

Thanks! I see what was the last request, did you change the XCDYouTubeKitLogLevel to 4?

@SoneeJohn
Copy link
Collaborator

Here is a full dump of my last 22 tests: https://pastebin.com/VMxFeG8v
Summary:
NEWMETHOD - 21/22 SUCCESSFUL
OLDMETHOD - 11/22 SUCCESSFUL

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! That last error might be due to a HTTP 429 error. I will update the library to better report these.

@MhmdSalah
Copy link
Author

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 video and error can not be nil if the operation was not canceled.'

Can you give me the full console output when this happened?

Here is a full log for the crash: https://pastebin.com/ySGmWHyw
I had to test 22 times before the crash occurred. The tests were made without your last update. I am updating right now.

Thanks! I see what was the last request, did you change the XCDYouTubeKitLogLevel to 4?

Yes i did.

@SoneeJohn
Copy link
Collaborator

@MhmdSalah Just updated again with some new changes.

@dlpigpen
Copy link

now it does not work anymore. Takes to many times to get a song or it gets a crash

 'Both video and error can not be nil if the operation was not canceled.'

@SoneeJohn
Copy link
Collaborator

now it does not work anymore. Takes to many times to get a song or it gets a crash

 'Both video and error can not be nil if the operation was not canceled.'

Did you try the develop branch?

@dlpigpen
Copy link

now it does not work anymore. Takes to many times to get a song or it gets a crash

 'Both video and error can not be nil if the operation was not canceled.'

Did you try the develop branch?

thanks. it works fine. is there any way for this library to adapt any changes from YouTube?

@jenny0006132
Copy link

@SoneeJohn Thanks for the effort! The lastest develop branch fixed the issue on my side! Not encounter any issue for approximately 20 attempts.

@JmyW
Copy link

JmyW commented Oct 27, 2020

@SoneeJohn
Great job!!! I test 20 videos with your solution, all pass.
Thank you so much for the great help.

SoneeJohn added a commit that referenced this issue Oct 27, 2020
* 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)
@SoneeJohn
Copy link
Collaborator

@MhmdSalah
Copy link
Author

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.

Hesowcharov pushed a commit to Hesowcharov/XCDYouTubeKit that referenced this issue Sep 27, 2023
Should address failing in 0xced#501
Hesowcharov pushed a commit to Hesowcharov/XCDYouTubeKit that referenced this issue Sep 27, 2023
Hesowcharov pushed a commit to Hesowcharov/XCDYouTubeKit that referenced this issue Sep 27, 2023
Hesowcharov pushed a commit to Hesowcharov/XCDYouTubeKit that referenced this issue Sep 27, 2023
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants