-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix deezer extractor #4935
base: master
Are you sure you want to change the base?
Fix deezer extractor #4935
Conversation
- Add blowfish encipher - Add deezer downloader - Add full song support - Add artist extractor - Add track extractor - Add episode extractor - Add show extractor
What about the failed core tests ? |
Dont import legacy compat variables |
So I copy the function code in the file ? |
No, you use the functions provided by Python, for example the The decryption process could potentially be done more cleanly if the calculation of the key happens inside the downloader and is not dependant on the Also Cryptodome provides an internal Blowfish implementation ( |
Done.
If by "inside the downloader" you mean the
I'll do it later. |
yt_dlp/extractor/deezer.py
Outdated
|
||
GW_LIGHT_URL = "https://www.deezer.com/ajax/gw-light.php" | ||
GET_URL = "https://media.deezer.com/v1/get_url" | ||
BLOWFISH_KEY = b"g4el58wc0zvf9na1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this key obtained?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving the key in the repository may not be the best idea. Deezer has sent DMCAs to many repos containing it in the past. It specifically mentions "To do so, these repositories are sharing the private encryption keys retrieved maliciously to bypass Deezer's security measures to unlawfully download its music catalogue, directly from Deezer’s servers in total violation of our rights and those of our music licensors (phonographic producers, performing artists, songwriters and composers)."
It might be a better idea to dynamically generate the key or just make users provide it themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ryan5453 I agree, this is a good idea. Note that this key is not directly used to decrypt the song. It is used to compute a new key that will decrypt the song.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related PRs: ytdl-org/youtube-dl#13194 ytdl-org/youtube-dl#22074 EDIT: the 2nd PR I linked doesn't support full length songs, according to ytdl-org/youtube-dl#22074 (comment): |
Yes it is : https://web.archive.org/web/20200917071235/https://github.com/LucBerge/youtube-dl but the |
Regarding this comment (and a discussion I had with someone 😅) authentication is not used in my code. It explains why the @gamer191 GitHub don't want to unlock my repo, they proposed to remove it so I can fork it again. My commits are still on my local computer, I can push it to a new github repo but it can be DMCA again for the same reason youtube-dl was. So maybe it's not the best idea. |
- Remove useless impot - Fix tracks number for extractors - Fix comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't actually tested this code and therefore can not confirm if it actually works or not, but the new key extractor (in theory) is definitely a much better implementation than hardcoding it for legal reasons.
You mean generating the key dynamically based on the code you provided? |
Yes. I'm saying you did a good job updating that. |
Thanks. What can I do for core tests failing? |
@@ -0,0 +1,309 @@ | |||
from .compat import compat_struct_unpack, compat_struct_pack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I should not import compat functions
Due to reasons we have discussed above (especially #4935 (comment)), I don't think it is a good idea to merge this code. In theory, we would have some protection by not hard-coding the key, but even so, it is a very risky move for us1. Since our plugin system has now matured, I recommend distributing this yourself as a plugin instead. This way, any DMCA will only affect your plugin, and not the entire project. While there are no downloader plugins yet, you can hack it in due to the flexibility of Python from yt_dlp.downloader import PROTOCOL_MAP
PROTOCOL_MAP['deezer'] = DeezerFD PS: Also, any PR adding new downloader is currently being held on pause since we are discussing re-working how IEs declare FDs Footnotes
|
The key is now dynamically generated as suggested
My goal in this PR is to share the extractor with others so people will be able to download too. Nobody will use my extractor as a plugin...
Any link to the issue/discussion ? |
People who need it will find it. It can be added to the wiki and I could change even the current extractor warning to point to plugins if desired.
A lot of the discussion happens on discord b/w maintainers. #3048 is one possible implementation that came out of it. |
Plugin repos can be tagged with yt-dlp-plugins to be discoverable. With the new plugin system we are aiming to make it a viable alternative to having extractor support in core. It's pretty new so not too many have heard of it yet nor is there many public plugins listed yet, so will take some time. Also, after some investigation a while back, the origins of some of this code are potentially from DMCA'd sources and likely not under unlicense (it goes further back than the PR on youtube-dl), so we likely cannot include it anyway in it's current form. |
Ok. So in which form can you accept it ? |
ee280c7
to
7aeda6c
Compare
Description of the pull request and other information
This pull request fix the Deezer extractor with full song support and closes #1591.
Before submitting this pull request I have:
In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of my pull request?