deepjyoti30 / ytmdl

A simple app to get songs from YouTube in mp3 format with artist name, album name etc from sources like iTunes, Spotify, LastFM, Deezer, Gaana etc.
https://ytmdl.deepjyoti30.dev
MIT License
3.16k stars 164 forks source link

Please implement fix to n-parameter challenge by youtube. #210

Closed SisyphusIsntHappy closed 2 years ago

SisyphusIsntHappy commented 2 years ago

Feature Request

Checklist

Description

I believe yt-mdl use youtube-dl under the hood, and downloads as I observe are very slow, about 40-75KBps on a 10MBps connection. I don't know if you are aware of this, but youtube has throttled download speeds to non-player clients, by sending them a parameter and asking to compute something based on it, if they don't the speed will be throttled, youtube-dl has a detailed information on this. There has been many pulls but none of the has been committed, yt-dlp, on the other hand implemented the fix.

I request you to take a look into this.

Thanks and regards.

deepjyoti30 commented 2 years ago

@SisyphusIsntHappy Thanks for raising this request. I will take a look. I have indeed noticed the slower download speeds and I kind of thought it was an youtube-dl issue. I will see what can be done regarding that!

deepjyoti30 commented 2 years ago

@SisyphusIsntHappy I took a look at the issue. I can see that YouTube is now randomly trying to slow down simultaneous downloads by using that n-parameter challenge.

The issue is that ytmdl uses youtube-dl under the hood to download the songs. It itself doesn't handle any part of the download. The download is merely passed on to youtube-dl and it in return downloads the song.

This means that until youtube-dl doesn't add a fix for the issue, I cannot either.

One alternative would be to just move on to a separate framework for the downloads ( ytdlp ) but the issue with that is unreliability. I agree that that fork is doing great job but it is very young (not even an year old). This leads me to doubt whether the framework will be reliable in the long term. This is why at the moment I am skeptical to move away from youtube-dl as the core library and use something else.

I am considering other options like pytube that might be more reliable looking at thier release and commit history.

SisyphusIsntHappy commented 2 years ago

@deepjyoti30 Did you happen to look at spotify-downloader? It's more or less like yt-mdl downloads spotify songs from youtube and adds metadata, it seems to works fast, and I think it is uses pytube too. It's sad last release of youtube-dl was last about 3 months ago. Good luck!

deepjyoti30 commented 2 years ago

@SisyphusIsntHappy Yes I am aware of spotify-dl. I actually did take a look at their source few months back and I think they do use pytube.

Also, as it turns out the issue for the n-param challenge is already fixed in pytube.

deepjyoti30 commented 2 years ago

Hi @SisyphusIsntHappy Seems like youtube-dl has added a fix for this and added a new release. This issue should be fixed with the released of youtube-dl 2021.12.17.

Do check and report back here if it's not fixed. On my end, it's fixed!

deepjyoti30 commented 2 years ago

@SisyphusIsntHappy I have made change in the source to make the move to yt-dlp since youtube-dl is not maintained anymore and yt-dlp has good support.

You can test it out by checking the unstable branch.

This commit adds the changes: 0eb0cb8