superm0 / HCVimeoVideoExtractor

HCVimeoVideoExtractor is an easy way to extract the Vimeo video details like title, thumbnails and mp4 URL's which then can be used to play using AVPlayerView.
MIT License
36 stars 19 forks source link

Recently broke because progressive removed from json #17

Open Janneman84 opened 2 months ago

Janneman84 commented 2 months ago

This package assumes request.files.progressive to be present in the json, but progressive seems to be removed now, causing code 4 errors.

example: https://player.vimeo.com/video/783455878/config

request.files.hls.cdns is still present but the current logic doesn't check for it because it already threw the error. The code may need to be structured a little bit differently so when it doesn't find progressive it then checks for cdns.

laviniamonenciu-westaco commented 2 months ago

Hi, what about code 4 errors? Do you know if this will also solve code 4? We suddenly started getting an error Error Domain=ph.hercsoft.HCVimeoVideoExtractor Code=4 "Failed to retrive mp4 video url" UserInfo={NSLocalizedDescription=Failed to retrive mp4 video url, NSLocalizedFailureReason=Failed to retrive mp4 video url}

Janneman84 commented 2 months ago

Sorry I meant code 4. I created a PR with a fix. In the meantime you can try using my fork:

https://github.com/Janneman84/HCVimeoVideoExtractor

laviniamonenciu-westaco commented 2 months ago

Thank you.

laviniamonenciu-westaco commented 2 months ago

What about hash links? there's an error: "domain: "ph.hercsoft.HCVimeoVideoExtractor" - code: 3"

Janneman84 commented 2 months ago

If you remove the hash it should work, it only needs the id.

The current code just looks at the last path component of the url and assumes it's the id. I updated it to look for the first all-digit path component instead. If you use my fork update the package and it should work.

Another option is to use the endpoint that lets you get the video id from url: https://vimeo.com/api/oembed.json?url=https://vimeo.com/192207770/0faf1dd09d

However this would mean having to do another call, slowing things down even more.

laviniamonenciu-westaco commented 2 months ago

But for example for: "https://vimeo.com/605783608/493d2ee578" it still doesn't work with the code above. code 3 error still shown

Janneman84 commented 2 months ago

I did some research and found that sometimes the hash needs to be added as h parameter, like so: https://player.vimeo.com/video/605783608/config?h=493d2ee578

I'll need to make a few modifications, stay tuned.

Janneman84 commented 2 months ago

Ok I updated my fork with hash support. Let me know if it works.

superm0 commented 2 months ago

I just merged the PR and publish a new version, 0.0.5. kindly try it out. appreciate your contribution @Janneman84, you rock🤘

budidino commented 1 month ago

Not sure why, but I don't get the version 0.0.5 when updating pods.

I had to update my Podfile to target the specific commit:

pod 'HCVimeoVideoExtractor', :git => 'https://github.com/superm0/HCVimeoVideoExtractor.git', :commit => '22039673d5f04899a76253d3545bda4981bca520'
nivritgupta commented 1 day ago

@Janneman84 since 3 months back you apply a solutions and that works fine but now again we faced the problems will you please check again??

Janneman84 commented 1 day ago

If you open a config url in a browser you now get a code 403 and the page says they're having a little trouble. https://player.vimeo.com/video/605783608/config?h=493d2ee578

I hope this is just temporary and will get fixed by them soon.