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

Can't play anything #419

Closed
sokh123 opened this issue Jan 18, 2019 · 38 comments
Closed

Can't play anything #419

sokh123 opened this issue Jan 18, 2019 · 38 comments

Comments

@sokh123
Copy link

sokh123 commented Jan 18, 2019

Can't play anything at all right now. When i try to debug by copying the convert url into Chrome it show ,You don't have authorisation to view this page .

@SoneeJohn
Copy link
Collaborator

@khoozhiyan1997 Could you provide some more information? Like a video ID that exhibits the error and the actually error?

@sokh123
Copy link
Author

sokh123 commented Jan 18, 2019

Task <06831EDC-C538-4EB1-A092-AD3AB22B9CD8>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo=}

You can try to replicate the error on you demo app, right now even your demo can't play anything. Thanks.

@SoneeJohn
Copy link
Collaborator

@khoozhiyan1997 Please give me a video ID that has this issue.

@sokh123
Copy link
Author

sokh123 commented Jan 18, 2019

Most of the video id can't play right now, i will give you some for example - WZwr2a_lFWY

@SoneeJohn
Copy link
Collaborator

@khoozhiyan1997 Thanks for that 👍

@chaocharleswang
Copy link

I have the same issue

@SoneeJohn
Copy link
Collaborator

Working on a fix 👍

@oososo
Copy link

oososo commented Jan 18, 2019

Working on a fix 👍

You can consider at ytdl-org/youtube-dl@fa4ac36

@SoneeJohn
Copy link
Collaborator

SoneeJohn commented Jan 18, 2019

I got it fixed on my end (e547cf8). Can everyone confirm that it does for them as well? Use the develop branch in CocoaPods by adding this to your pod file:

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

Be sure to clean your project and delete your derived data before retesting 👍

@oososo
Copy link

oososo commented Jan 18, 2019

I got it fixed on my end (e547cf8). Can everyone confirm that it does for them as well? Use the develop branch in CocoaPods by adding this to your pod file:

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

Be sure to clean your project and delete your derived data before retesting 👍

Could I only change the regex pattern for update? Thank you very much.John

@SoneeJohn
Copy link
Collaborator

I don't believe the problem is caused due to the regex. Does the latest commit work for you? (I am going to try changing the regex)

@chaocharleswang
Copy link

chaocharleswang commented Jan 18, 2019 via email

@oososo
Copy link

oososo commented Jan 18, 2019

I don't believe the problem is caused due to the regex. Does the latest commit work for you? (I am going to try changing the regex)

I can't update for my app now. I only can update the regex for users. I think the problem is from changing the signature

@sokh123
Copy link
Author

sokh123 commented Jan 18, 2019

It fixed the issues. Thanks @SoneeJohn

@oososo
Copy link

oososo commented Jan 18, 2019

I tried the new regex. Some videos still not work.

________________________________ From: oososo notifications@github.com Sent: Thursday, January 17, 2019 23:28 To: 0xced/XCDYouTubeKit Cc: MoboPan; Comment Subject: Re: [0xced/XCDYouTubeKit] Can't play anything (#419) Working on a fix 👍 You can consider at rg3/youtube-dl@fa4ac36<rg3/youtube-dl@fa4ac36> — You are receiving this because you commented. Reply to this email directly, view it on GitHub<#419 (comment)>, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGMV10jubglgT8I0DqMRuv9eF88ARJKRks5vEU1YgaJpZM4aHFRC.

Hi,How are you going now?

@chaocharleswang
Copy link

I didn't find any solutions to fix the issue just by updating regex.

@oososo
Copy link

oososo commented Jan 18, 2019

I didn't find any solutions to fix the issue just by updating regex.

Do you know what's the problem now? What changed by youtube?

@oososo
Copy link

oososo commented Jan 18, 2019

I don't believe the problem is caused due to the regex. Does the latest commit work for you? (I am going to try changing the regex)

I can't update for my app now. I only can update the regex for users. I think the problem is from changing the signature

Hi, John, Are you still working on this?

@walterjiao
Copy link

I don't believe the problem is caused due to the regex. Does the latest commit work for you? (I am going to try changing the regex)

Hi, could you please explain to me what YouTube webpage changed this time.

@JmyW
Copy link

JmyW commented Jan 18, 2019

@SoneeJohn Thank you so much! It's fixed. Very appreciate!

@darkForestCat
Copy link

I got it fixed on my end (e547cf8). Can everyone confirm that it does for them as well? Use the develop branch in CocoaPods by adding this to your pod file:

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

Be sure to clean your project and delete your derived data before retesting 👍

This is not resolving the issue.
Large amount of videos still do not work.
Video Ids:
jr66A4NDuYw
Kbj2Zss-5GY

@emrecelikors
Copy link

emrecelikors commented Jan 18, 2019

Working on a fix 👍

You can consider at rg3/youtube-dl@fa4ac36

Is this regex solution not working ? Because they closed this issue in there.

@SoneeJohn
Copy link
Collaborator

@emrecelikors See #419 (comment)

@emrecelikors
Copy link

@emrecelikors See #419 (comment)

This is working, thank you but my app needs to update with that code. With regex solution,my problem will be solved without changing any source code because of that I was asking that. As I can see youtube-dl commit this fix this via regex.

@SoneeJohn
Copy link
Collaborator

@emrecelikors That regex commit is unrelated to this. Where you able to simply change the regex and it fixed your issue?

@SoneeJohn
Copy link
Collaborator

SoneeJohn commented Jan 18, 2019

The new regex does indeed fix the issue however, some additional work needs to done in the XCDYouTubePlayerScript class. If anyone would like to help I would really appreciate it.

@chaocharleswang
Copy link

The new regex does indeed fix the issue however, some additional work needs to done in the XCDYouTubePlayerScript class. If anyone would like to help I would really appreciate it.

Good findings! Can you please give us some hints about what we should do in XCDYouTubePlayerScript?

@SoneeJohn
Copy link
Collaborator

@chaocharleswang A XMLHttpRequest request needs to be made in the JSContext.

@SoneeJohn
Copy link
Collaborator

Update: the latest commit should fix it now. :-D

@SoneeJohn
Copy link
Collaborator

@darkForestCat was able to play
screen shot 2019-01-18 at 2 31 09 pm

@darkForestCat
Copy link

Yeah, I see now.Idk it was not working.Working now.Thanks a lot @SoneeJohn !

@darkForestCat
Copy link

I just reopened the project and cleaned everything and everything started to work.

SoneeJohn added a commit that referenced this issue Jan 18, 2019
* Adaptation to YouTube API change. (#419, #422. #421)
* Fix JavaScript exception: ReferenceError (#418, #420)
@DmytroBrovkin
Copy link

DmytroBrovkin commented Jan 18, 2019

@SoneeJohn I've just checked your latest commits, with XMLHttpRequest class logic. And noticed very interesting thing.
Try to replace:
XMLHttpRequest *xmlHttpRequest = [XMLHttpRequest new]; [xmlHttpRequest extend:_context];
in line 26, XCDYouTubePlayerScript.m file with:
_context[@"XMLHttpRequest"] = ^{};

This code will fix the issue with videos not able to playback. None of the XMLHttpRequest's class ever triggered. Are you sure it is really needed in project?

@SoneeJohn
Copy link
Collaborator

SoneeJohn commented Jan 18, 2019

@DmytroBrovkin Thanks! 👍 Can you open a PR with this change (I know it's a bit trivial). I tried it and it works.

@DmytroBrovkin
Copy link

@SoneeJohn Can do it in few days, I'm about to flight over ocean)

@sokh123
Copy link
Author

sokh123 commented Jan 19, 2019

Do u guys update this part of code to do the regex changes ?

` //See list of regex patterns here https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/youtube.py#L1179

NSArray<NSString >patterns = @[@"\.sig\|\|([a-zA-Z0-9$]+)\(",
@"["']signature["']\s
,\s
([^\\(]+)",
@"yt\.akamaized\.net/\)\s*\|\|\s*.?\sc\s*&&d.set\([^,]+\s*,\s*([a-zA-Z0-9$]+)",
@"\bcs*&&\sd\.set\([^,]+\s,\s*([a-zA-Z0-9$]+)\C",
@"\bc\s*&&\sd\.set\([^,]+\s,\s*\([^)]\)\s\(\s*([a-zA-Z0-9$]+)\("
];`

@gbeignie
Copy link

@DmytroBrovkin Have you any update for the PR ? Because it works juste fine for me => #426

@DmytroBrovkin
Copy link

DmytroBrovkin commented Jan 30, 2019

It is also working fine, but as I said earlier XMLHttpRequest is useless. Will create PR soon.

Hesowcharov pushed a commit to Hesowcharov/XCDYouTubeKit that referenced this issue Sep 27, 2023
If none of the first stream URLs result in a 200 HTTP status code then we try to use the alternative stream URLs.
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#419, 0xced#422. 0xced#421)
* Fix JavaScript exception: ReferenceError (0xced#418, 0xced#420)
Hesowcharov pushed a commit to Hesowcharov/XCDYouTubeKit that referenced this issue Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants