kmille / deezer-downloader Goto Github PK
View Code? Open in Web Editor NEWDownload music from Deezer with a nice front end
License: MIT License
Download music from Deezer with a nice front end
License: MIT License
Original artist and song name: Дайте Танк (!) - Мы
Filename: Дайте Танк (!) - Мы.mp3
Looks like a classic python2 unicode issue.
It's time my fellow friend!
it's faster and more reliable than youtube-dl. The tests fail every second day because of a random youtube-dl error.
Today i tried to download some new songs, and i get an error for a lot (but not all) songs.
Like :
_`Downloading 'Metallica - Nothing Else Matters.mp3'
ERROR: Can not download this song. Got a 403
worker 0 is done with task: {'track_id': 1489945622, 'add_to_playlist': False} (state=mission accomplished)
Worker 0 is waiting for a task`_
My Credentials are correct, I am able to login on deezer.com
$HomeIP - - [27/Apr/2019 21:25:22] "POST /api/v1/deezer/download HTTP/1.1" 200 -
We are not logged in
Do the login
Login was not successfull
Downloading song 73519924
Downloading song Mindless Self Indulgence - Never Wanted To Dance.mp3
ERROR downloading from https://e-cdns-proxy-%s.dzcdn.net/mobile/1: 'MD5_ORIGIN'
is it possible to get flac files also?
Add the ability do download all content that is available from an artist.
Hi, I have a question... I didn't really get anything in the How to Use and I kind of want to download my favourite songs as FLACs, can anyone do a tutorial(video) or a detailed guide to help? xD
Hello,
I tried downloading a playlist from a Spotify playlist. It didn't seem to retrieve the full list. Logs say it has 100 We got 100 songs from the Spotify playlist
. Retrying it doesn't work as it just says all the items already exist. Is there any way to download the rest?
Thanks
Hi dear @kmille!
I'm using This module in my program. I'm still reading the code. How can I fix this error?
Deezer403Exception: ERROR: we are not logged in on deezer.com. Please update the cookie
I have put ARL in settings file.
TESTs:
download album with more than 50 songs: https://open.spotify.com/album/6LLl2tvQel0dJiTLQpTAUE
Also check: download playlist with more than 50 songs: https://open.spotify.com/playlist/0wl9Q3oedquNlBAJ4MGZtS
If we speak to the API, there is currently no limit=x
GET parameter. The default is 20, 50 is the max. So we need pagination here.
TODOs
I'm having issues deploying via docker-compose. Please advise. This is my compose file:
---
version: '2'
services:
deezer-downloader:
image: kmille2/deezer-downloader
environment:
- DEEZER_COOKIE_ARL=<arl>
- DEEZER_FLAC_QUALITY=True
volumes:
- /mnt/md0/Music/Collection:/mnt/deezer-downloader
ports:
- "8686:5000"
Great code ! Thanks ;-) It's weird since I wanted to try it on my Mac and I add the following error which was fixed by using key.encode() in blowfishDecrypt and adding b before string key = b"g4el58wc0zvf9na1" and so on:
Traceback (most recent call last):
File "tests.py", line 195, in test_download_song_valid_mp3
download_song(song, test_song)
File "/Users/franckweens/Downloads/Deezer/deezer.py", line 353, in download_song
decryptfile(fh, key, fo)
File "/Users/franckweens/Downloads/Deezer/deezer.py", line 137, in decryptfile
data = blowfishDecrypt(data, key)
File "/Users/franckweens/Downloads/Deezer/deezer.py", line 116, in blowfishDecrypt
c = Blowfish.new(key, Blowfish.MODE_CBC, iv)
File "/usr/local/lib/python3.8/site-packages/Crypto/Cipher/Blowfish.py", line 146, in new
return _create_cipher(sys.modules[name], key, mode, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/Crypto/Cipher/init.py", line 79, in _create_cipher
return modes[mode](factory, **kwargs)
File "/usr/local/lib/python3.8/site-packages/Crypto/Cipher/_mode_cbc.py", line 274, in _create_cbc_cipher
cipher_state = factory._create_base_cipher(kwargs)
File "/usr/local/lib/python3.8/site-packages/Crypto/Cipher/Blowfish.py", line 77, in _create_base_cipher
result = start_operation(c_uint8_ptr(key),
File "/usr/local/lib/python3.8/site-packages/Crypto/Util/_raw_api.py", line 243, in c_uint8_ptr
raise TypeError("Object type %s cannot be passed to C code" % type(data))
TypeError: Object type <class 'str'> cannot be passed to C code
update install instructions (python3)
add new screenshots
Platform: Windows with the WSL2-backend for Docker (using Ubuntu as the distribution)
Build: latest as of 15.04.2021.
So, for the most part, the downloading goes fine, but there are some songs that straight up refuse to be downloaded and I just get a ERROR: Can not download this song. Got a 403
every time I try. On the other hand, when downloading playlists, there are songs that fail at first, but work fine later on.
Here's a couple of IDs of songs that fail constantly: 9125239
, 8717671
, 8454029
.
The songs do play when I try them on the platform (both the web and Electron app).
Do you know why this might be? Let me know if I can provide more info, and thank you for the awesome app!
Flac download works fine. But no tags are added. Maybe this could be implemented? I'm not sure, but I think on FLAC format https://wiki.xiph.org/VorbisComment is used?
When running the app I get this error.
Commenting out line for in app/music_backend.py worked for me, because I didn't needed any mpd stuff.
vagrant@buster:~$ /opt/deezer/app/venv/bin/python /opt/deezer/app/app.py
Traceback (most recent call last):
File "/opt/deezer/app/app.py", line 10, in <module>
from music_backend import sched
File "/opt/deezer/app/music_backend.py", line 4, in <module>
import mpd
ModuleNotFoundError: No module named 'mpd'
deezer: erst schauen obs schon da ist vor dem download (mal mit fdups nach duplicaten suchen)
According to the Python Clock you still have 1 month and 13days to fix this ;)
Just to add a heads up for people running PiHole on their network.
I wasted a good couple of hours trying to fix non existent youtube-dl issues and in the end it turrned out that PiHole was blocking all the requests that youtube-dl was sending.
Keep in mind that my PiHole server is configured specificly and aggresivly to block YouTube ads. If your PiHole is using the default block list I doubt you will experience any issues with youtube-dl.
I experienced this using the Docker image but you will most likely encounter the same behavior even running the standalone app since PiHole works on the network level.
The workaround I used to fix this was as follows:
Keep in mind by doing this you efectivly disable PiHole for that client. All DNS queries will go through for that client, not just YouTube requests. If you are running deezer-downloader on your PC you might not want to do this beacuse you will deactivate all of the protection that PiHole offers. If you are running this on a server you are go to go.
@kmille Thank you for making this amazing software. It really helped me get my music collection up to date.
i'm geting this error everytime i try to run the app
yt-dlp not found at /usr/bin/yt-dlp
Hey, thanks for a nice project! I was wondering if you could release it under a free/open source license? Right now it's regulated only by GitHub terms of service, which allows everybody to look at the sources and submit PRs, but not distribute or even use it. ISC (simpler variant of MIT) or GPL-3 would be probably suitable for this project, and if you want to learn more about open source licensing, https://choosealicense.com/ might be a great starting point.
I do understand that this project is in a legal gray area, but that's the more reasons to license it explicitly – most licenses include a legal clause that disclaims your liability in case of any legal action :-)
debian:buster-20200514 is big.
other python deezer projects seem to prefer using the ARL instead of the SID . they also dont implement a thread to keep the session alive.
Would the use of it make the dedicated thread obsolete?
or is there anything i'm missing here? please correct me if i'm wrong.
In the help file on github it is described that it is possible to use mpd together with the deezer-downloader
. However it is not clear for me if mpd can be used to search Deezer and download/play from it or it is only used as a player after the album/songs are downloaded using web interface and deezer-downloader. Please clarify.
I would like to use the Deezer from linux console only, but I am not sure if it is possible or it always the web gui has to be used.
Regards,
Piotr
When there is no C Compiler in Path (like it is the case in the Vagrantfile) the requirement pycrypto can not be installed.
There are 56 favorite songs (https://api.deezer.com/user/3368166784/tracks), but the json only contains 25 songs. There is a link in the json to the next 25 songs (at the bottom).
We either iterate over the json or use limit=99999.
It seems deezer drops the tcp connection after about 5 minutes. If downloading a lot of songs/a long playlist, the tcp connection will be dropped after ~ 5 minutes. There is no proper exception handling for this right now.
criticized by @tklitschi
jedi 0.17.2 depends on parso<0.8.0 and >=0.7.0
Could you downgrade parso 0.8.0 to parso 0.7.0 in the requirements.txt?
The docker-compose build is now failing with the error from above.
if starts with http:/ ..
else:
check if numeric - oder int(x) und schauen ob ne Exception raised
broken for input: 🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣
if run on Debian buster with python3.7 (used the python3 branch on both sites):
(venv) root@buster:/opt/deezer/app# python -m unittest tests.TestSpotifyMethods.test_spotify_parser_valid_playlist_url F ====================================================================== FAIL: test_spotify_parser_valid_playlist_url (tests.TestSpotifyMethods) ---------------------------------------------------------------------- Traceback (most recent call last): File "/opt/deezer/app/tests.py", line 220, in test_spotify_parser_valid_playlist_url self._test_parse_spotify_playlist_website(playlist_url) File "/opt/deezer/app/tests.py", line 212, in _test_parse_spotify_playlist_website
self.assertEqual(playlist, set(songs))
AssertionError: Items in the first set but not the second:
'Erasure Always - 2009 Remastered Version'
Items in the second set but not the first:
'Erasure Always' ---------------------------------------------------------------------- Ran 1 test in 0.174s FAILED (failures=1)
ipdb> set(songs) == set(playlist)
False
ipdb> set(songs) == playlist
False
ipdb> len(songs)
88
ipdb> len(playlist)
88
ipdb> type(songs)
<class 'list'>
ipdb> type(playlist)
<class 'set'>
ipdb> songs = set(songs)
ipdb> type(songs)
<class 'set'>
ipdb> type(playlist)
<class 'set'>
ipdb> songs - playlist
{'Erasure Always'}
ipdb> playlist -songs
{'Erasure Always - 2009 Remastered Version'}
Does re behaves differently between python3.7 and python3.8?
Ableton Live 11 doesn't accept mp3's downloaded with deezer-downloader.
(_pn suffix is added using Platinum Notes, but same error occurs before mastering the track)
Only workaround is that I decode/encode all downloaded mp3's with ffmpeg manually. After I do that, the mp3 will load into Ableton.
I can't really find the reason why Ableton doesn't accept these mp3's, because the MP3's play absolutely fine in any random media player.
Right now, if the backend is down and you want to download something there is no error message shown to the user. The API responds with a 400 and a helpful message. So we can show it to the user. For example using youtube-dl:
{
"error": "url is not a url. http... only"
}
would be much nicer for #26
It will be easy to deploy on it.
I am trying to understand how the deezer downloader works, so I can convert it to Java.
Code which is executed
`songId = 1081055522
songMd5 = "7a3c4d32060a22b9610aac83bd8c55f7"
mediaVersion = 3
urlKey = genurlkey(songId, songMd5, mediaVersion)
url = "https://e-cdns-proxy-%s.dzcdn.net/mobile/1/%s" % (songMd5, urlKey.decode())
https://e-cdns-proxy-7a3c4d32060a22b9610aac83bd8c55f7.dzcdn.net/mobile/1/9411506b92ff1540ea5382a74dff920bdbcd546fa732840fc91329064a79b0b7956b8ed5a57f6ee2421ef9c4866fad4b7ae3c13cb81749014408dc9a9ecad7ddd4f1a21edb261f70229c31093dc73178063ef54d67c219821901e1ef8d31ed56
this link does not work on browser. The page is not available.
print(url)
`
This is the response I extractred from Deezer Page when they ask for sources.
{"data":[{"media":[{"cipher":{"type":"BF_CBC_STRIPE"},"exp":1601182525,"format":"MP3_128","media_type":"FULL","nbf":1601110525,"sources":[{"provider":"ak_old","url":"https://cdnt-proxy-7.dzcdn.net/mobile/1/a83bf1f26681fac5f3f0c4b142797a32a3b31ad7defac23c49bf3459b7266666956b8ed5a57f6ee2421ef9c4866fad4b7ae3c13cb81749014408dc9a9ecad7dd5701ad1e8d6e465baaa0635dde3ac8ca?hdnea=exp=1601182525~acl=/mobile/1/a83bf1f26681fac5f3f0c4b142797a32a3b31ad7defac23c49bf3459b7266666956b8ed5a57f6ee2421ef9c4866fad4b7ae3c13cb81749014408dc9a9ecad7dd5701ad1e8d6e465baaa0635dde3ac8ca*~data=user_id=3913153162~hmac=9deb9888871e35559f1631f6a964fe31253e39f6e0c6b63d8efe9d6671919eaa"},{"provider":"ec_old","url":"https://e-cdnt-proxy-7.dzcdn.net/mobile/1/a83bf1f26681fac5f3f0c4b142797a32a3b31ad7defac23c49bf3459b7266666956b8ed5a57f6ee2421ef9c4866fad4b7ae3c13cb81749014408dc9a9ecad7dd5701ad1e8d6e465baaa0635dde3ac8ca?D7Z0edPoPWK0GNMEefbbcFXoeMcleCtj4zveJx_VNS_g-cdskdqp5vfc3Hp6lawG4g1OZdBTAM1qkS9ZF4lVfYDO9B4UKMRgIQQmAwlVN-JGrt_YXtN1CjadA3wE8gpA6qXdsN-dpd79KnfzSqdYhWfCy8J3t3uTBMklDN7OP5sbDXUqgEIV3s458IOmBLU4Y9sPOq6PhCly5KSMk_JJ_sQRwCltVyXWLBymp0U1qSIp8mz0_uzS9-3w12Gn-uGzulVzl5gBmXZRo47jeV9btUBbOPeoSzxdc3dV-R_CVaAdyJd7ohQHBfm3c1H6Jbp0e4APGf6zkHz6VXg"},{"provider":"ec","url":"https://e-cdnt-proxy-7.dzcdn.net/media/1/3a678cc5cf2c0fe2ad37838b45a55bfb77a0a94f3ff82dba8894cc5de1fae31b45db4817dc710569902a53410628f0ad04a9fd9ee6c529f7baa65600865538be6a1f8bdb7d50e1b20f430c39062d06a3?Gl4L-GtQzfEzDjORITWP8iS_CoBIJ0rtz6jyAJDIwukZdzLuoVnhQEqrODeL4_IFEOygWp8Hb_hQucaF3jbvQY28NBGWXGPwfy67tyIz8e2U3Zpvmrye2gNIc-Mvg3ncWqW-gOF8ipc-eeMZoV_omLJTjgeRubS1RaGZw65a-HZ-Ty3-qMTffA5otiNjRvpqOQ1ZQBsNxGx-iFixAwQF4BELq-kFzixCQ6IqVr70fZAM7v7ksGXIR0Ua97qSE7Q8tDAzDQT7uLQ6_pM906xFU_dRxeNNSjXzrCL2kyYrd7EesNPqvleJ7phUS7h-PtpQ0licLO9KG7O_Pg"},{"provider":"ak","url":"https://cdnt-proxy-7.dzcdn.net/media/1/3a678cc5cf2c0fe2ad37838b45a55bfb77a0a94f3ff82dba8894cc5de1fae31b45db4817dc710569902a53410628f0ad04a9fd9ee6c529f7baa65600865538be6a1f8bdb7d50e1b20f430c39062d06a3?hdnea=exp=1601182525~acl=/media/1/3a678cc5cf2c0fe2ad37838b45a55bfb77a0a94f3ff82dba8894cc5de1fae31b45db4817dc710569902a53410628f0ad04a9fd9ee6c529f7baa65600865538be6a1f8bdb7d50e1b20f430c39062d06a3*~data=user_id=3913153162~hmac=1154d4eeb92970ec10dd75d76df14677e2b343ca865a91bf36ae9fbae230de06"}]}]}]}
with url like this: https://www.deezer.com/us/profile/%numeric_user_id%/loved
Good day,
It will be very easy and nice to use if I can switch to flac quality via docker's env.
Hello, I'm looking really forward to using this app, but I have no Idea how to install and run it. Could someone please help me?
"/opt/deezer/app/deezer/deezer.py", line 1143, in mpd_update
c.add(song)
Downloading Deezer playlist | "{'playlist_id': 'https://deezer.page.link/C74jZq7XviX7oXJC6', 'add_to_playlist': False, 'create_zip': False}" | failed
list index out of range
Downloading Spotify playlist | "{'playlist_name': 'Niel Young Radio', 'playlist_id': 'https://open.spotify.com/playlist/37i9dQZF1E4A7OIobLeqTt?si=330adacfc57a48eb', 'add_to_playlist': False, 'create_zip': False}" | failed
list index out of range
Every time i try to download something, this is what i get
This image takes a while to build... consider putting the image on docker hub as shown here
I believe there is a github CI that can be used to build/push the image to docker hub automatically upon release, but I'm not sure...
The idea is automatical download all favourites songs, albums and artists.
But it defently requires #15
On latest master (b68087c) tried to download my favs.
Process stopped after downloading of 20 songs with error:
Creating m3u8 file: '00 playlists\favorites_USERID.m3u8'
Got an Exception in function download_deezer_favorites with parameters '{'user_id': 'USERID', 'add_to_playlist': False, 'create_zip': False}
[Errno 2] No such file or directory: '<PATH_TO_FOLDER>/playlists\favorites_USERID\00 playlists\favorites_USERID.m3u8''
worker 1 is done with task: {'user_id': 'USERID', 'add_to_playlist': False, 'create_zip': False} (state=failed)
So I created this folder "00 playlists" manually and got a different error:
Creating m3u8 file: '00 playlists\favorites_USERID.m3u8'
Got an Exception in function download_deezer_favorites with parameters '{'user_id': 'USERID', 'add_to_playlist': False, 'create_zip': False}
'charmap' codec can't encode characters in position 0-3: character maps to '
worker 1 is done with task: {'user_id': 'USERID', 'add_to_playlist': False, 'create_zip': False} (state=failed)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.