Athlon1600 / youtube-downloader

:tv: PHP based alternative to youtube-dl and yt-dlp. Active and frequently updated! :star:
https://unblockvideos.com/
MIT License
805 stars 316 forks source link

low download speed #142

Open VadimBoev opened 3 years ago

VadimBoev commented 3 years ago

I have an internet connection with a speed of more than 300 megabits per second. But the download of the file obtained from the link is slow and is about 1000 kilobytes per second. How to solve this problem?

VadimBoev commented 3 years ago

I figured it out, it turns out that the Range parameter is needed in the header. But I don't understand how to calculate the required amount. I found it in the debug in youtube-dl

borneagle71 commented 3 years ago

I figured it out, it turns out that the Range parameter is needed in the header. But I don't understand how to calculate the required amount. I found it in the debug in youtube-dl

I have something like the below and it works pretty well, I have the part length set to 1048576 bytes which is just over 1mb and I can easily download 60mb files in under 3 seconds, most 5 minute audio files are around 5 to 8mb so it only takes a fraction of a second to download and the part length can even be increased I was just a bit worried about youtube blocking my connection for downloading files too quickly

fast-ytdl

avivais commented 3 years ago

@borneagle71 tried your solution, still got throttled

Issue was resolved in new package https://github.com/yt-dlp/yt-dlp

No PHP version though. @Athlon1600 have you thought of porting it as well?

Athlon1600 commented 3 years ago

Issue was resolved in new package https://github.com/yt-dlp/yt-dlp

No PHP version though. @Athlon1600 have you thought of porting it as well?

as soon as I figure out how they did it, yeah. I may have time this weekend. It's definitely on my to-do list, because I use this library myself...

borneagle71 commented 3 years ago

@borneagle71 tried your solution, still got throttled

Issue was resolved in new package https://github.com/yt-dlp/yt-dlp

No PHP version though. @Athlon1600 have you thought of porting it as well?

Ok as you've probably figured out youtube is restricting download speed to ~50kbps which is sadge but I've written a workaround that I've been using for about a week now that seems to work fine reducing the download time to 5-10 seconds which is way slower than before but still much better than trying to do a straight download. With some minor tweaks it could probably be sped up quite a bit. My solution looks a little like the below. image this is using guzzle to preform multiple async requests at once, I have PART_LENGTH set to 50000 as that is the max transfer speed that youtube seems to be allowing for now but tweaking that might allow for faster downloads

Athlon1600 commented 3 years ago

^ yup, as a last resort option, that would be the way to do it when all the download links you get back have a "speed limit".
For now, there is still a way to parse links without download speed limits. See my new release:
https://github.com/Athlon1600/youtube-downloader/releases

ndsda commented 3 years ago

I got these download speeds:

Old version: 50kbps New version: 150-650kbps

kihanb commented 2 years ago

I still have this problem

ndsda commented 1 year ago

Download speed for me has dropped to 60kbps :(