0xced / XCDYouTubeKit

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

Can't play anything #419

Closed sokh123 closed 5 years ago

sokh123 commented 5 years ago

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 commented 5 years ago

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

sokh123 commented 5 years ago

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 commented 5 years ago

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

sokh123 commented 5 years ago

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

SoneeJohn commented 5 years ago

@khoozhiyan1997 Thanks for that 👍

chaocharleswang commented 5 years ago

I have the same issue

SoneeJohn commented 5 years ago

Working on a fix 👍

oososo commented 5 years ago

Working on a fix 👍

You can consider at https://github.com/rg3/youtube-dl/commit/fa4ac365f69cbd51e4c9801984ebea49a12825b7

SoneeJohn commented 5 years ago

I got it fixed on my end (https://github.com/0xced/XCDYouTubeKit/commit/e547cf869483c8ee145564147bf631a54d0041ce). 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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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@fa4ac36https://github.com/rg3/youtube-dl/commit/fa4ac365f69cbd51e4c9801984ebea49a12825b7

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/0xced/XCDYouTubeKit/issues/419#issuecomment-455423915, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGMV10jubglgT8I0DqMRuv9eF88ARJKRks5vEU1YgaJpZM4aHFRC.

oososo commented 5 years ago

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 commented 5 years ago

It fixed the issues. Thanks @SoneeJohn

oososo commented 5 years ago

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](https://github.com/rg3/youtube-dl/commit/fa4ac365f69cbd51e4c9801984ebea49a12825b7) — 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 commented 5 years ago

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

oososo commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

darkForestCat commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

@emrecelikors See https://github.com/0xced/XCDYouTubeKit/issues/419#issuecomment-455424585

emrecelikors commented 5 years ago

@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 commented 5 years ago

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

SoneeJohn commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

SoneeJohn commented 5 years ago

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

SoneeJohn commented 5 years ago

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

darkForestCat commented 5 years ago

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

darkForestCat commented 5 years ago

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

DmytroBrovkin commented 5 years ago

@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 commented 5 years ago

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

DmytroBrovkin commented 5 years ago

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

sokh123 commented 5 years ago

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 commented 5 years ago

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

DmytroBrovkin commented 5 years ago

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