Giter Club home page Giter Club logo

Comments (11)

fightveryexplosion avatar fightveryexplosion commented on July 28, 2024 5

I've been experiencing this since about a week ago as well.
This has been a topic of discussion in youtube-dl for a while, and it seems like YouTube sometimes randomly throttles the download speed for a URL to about 50~70kb.
If you retry by getting a new URL (by executing a new XCDYoutubeKit request) a couple of times it eventually will get a URL that is capable of a normal download speed, but this can sometimes take up to 10 tries and is not exactly a pretty solution.

There seems to be a specific parameter (n) in the mp4 URL that is encrypted, and if this encryption is solved you will be able to get a steady URL every time, but this encryption method seems to vary depending on the video and I have not found a way to solve it on iOS.
According to the youtube-dl discussion, this has been solved in another python library called yt-dlp, where I guess they have managed to crack the encryption.

If anyone has a solution I would be thrilled to hear about it.

from xcdyoutubekit.

cbg-dev-k avatar cbg-dev-k commented on July 28, 2024 1

Thanks for the suggestion @fightveryexplosion

I applied some changes from ytdlp which seem to fix the slowdown. Feel free to try it out in #552

Edit: I didn't do anything encryption related, it's just a different API and some parameter tweaks.

from xcdyoutubekit.

huynguyencong avatar huynguyencong commented on July 28, 2024

I have been experiencing this issue. It takes 30-60s to play a video.

from xcdyoutubekit.

dim4ikhot avatar dim4ikhot commented on July 28, 2024

Facing with the same issue, but time is MUCH longer. To play the 5-6 minutes video it takes up to 7 minutes to load it... Awful. The WebView approach works better, but the configuration much worse. But nothing have to do, except switch to WebView solution

from xcdyoutubekit.

huynguyencong avatar huynguyencong commented on July 28, 2024

@kbex-dev I tried your code, but I see it still slow to load a video.

from xcdyoutubekit.

cbg-dev-k avatar cbg-dev-k commented on July 28, 2024

@huynguyencong That's disappointing. We haven't noticed any throttled videos in our testing (20+ videos) whereas we encountered it almost every time before.

Do you have a video link I can try on my end?

from xcdyoutubekit.

huynguyencong avatar huynguyencong commented on July 28, 2024

@kbex-dev For example this one: https://www.youtube.com/watch?v=t4H_Zoh7G5A . It take more than 20s but can't play.

This is the pod in my Pod file:
pod 'XCDYouTubeKit', :git => 'https://github.com/kbex-dev/XCDYouTubeKit.git'

from xcdyoutubekit.

frozenthrone avatar frozenthrone commented on July 28, 2024

@huynguyencong That's disappointing. We haven't noticed any throttled videos in our testing (20+ videos) whereas we encountered it almost every time before.

Do you have a video link I can try on my end?

often buffing at 50-70 kb/s

from xcdyoutubekit.

cbg-dev-k avatar cbg-dev-k commented on July 28, 2024

I did some testing on VPN (until I ran out of free data). It seemed to work better on US and EU regions than Asia. Where are you connecting from @frozenthrone? I won't be able to spend more time on this, since it seems to work for our target regions.

It may be worth testing what APIs yt-dlp uses and what speed you get with it? Perhaps they do something different depending on region.

from xcdyoutubekit.

philmmoore avatar philmmoore commented on July 28, 2024

pod 'XCDYouTubeKit', :git => 'https://github.com/kbex-dev/XCDYouTubeKit.git'

This worked for me, thanks allot @kbex-dev

The package has been pretty unreliable over the last few months πŸ‘Ž

from xcdyoutubekit.

gassan avatar gassan commented on July 28, 2024

The same for me.
The caching takes up several minutes.

from xcdyoutubekit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.