Giter Site home page Giter Site logo

kmille / deezer-downloader Goto Github PK

View Code? Open in Web Editor NEW
604.0 604.0 83.0 1.75 MB

Download music from Deezer with a nice front end

License: MIT License

Python 75.06% JavaScript 11.72% HTML 9.46% Dockerfile 1.00% Shell 2.76%
deezer mpd music python spotify youtube-dl

deezer-downloader's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deezer-downloader's Issues

Unable to download songs

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`_

Can't use downloaded mp3's in Ableton Live 11

Ableton Live 11 doesn't accept mp3's downloaded with deezer-downloader.

Error messages in Ableton:
image

(_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.

Spotify downloader isn't downloading the full playlist

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

How to download Deezer Playlist as FLACs

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

Login Error

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'

License?

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 :-)

yt-dlp error

i'm geting this error everytime i try to run the app
yt-dlp not found at /usr/bin/yt-dlp

Some songs just return a 403 upon being downloaded

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!

Usage of mpd unclear.

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

Place docker image on docker hub

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...

flac files

is it possible to get flac files also?

Docker-Compose

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"

sanitize user input for deezer playlist id

if starts with http:/ ..
else:
check if numeric - oder int(x) und schauen ob ne Exception raised
broken for input: 🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣

List index out of range

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

python3.7 vs python 3.8 bug in tests.py

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?

ARL instead of SID

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.

Blowfish - comment

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

Running deezer-downloader with PiHole server on the network

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:

  1. In PiHole, under Group Managment/Groups create a specific group. (I named mine Servers)
  2. In PiHole, under Group Managment/Clients find your server MAC and IP address and add it as a client (By server I mean the machine that deezer-downloader is running on. This can be the Docker Host machine or even your PC)
  3. On the same screen, after the Client is added, assign it to the group created in step nr. 1.
  4. Go back in Group Managment/Groups and tick the Enable/Disable option to Disable the PiHole blocking for that group.

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.

Make UI more verbose if an error occurs

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:

  1. enter: blubb
  2. click download => nothing will happen
  3. Backend responds with a 400:
{
  "error": "url is not a url. http... only"
}

Deezer: Invalid download Url?

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"}]}]}]}

Downloading a long playlist => deezer will drop the connection

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

Unicode characters in the song or artist name failed favs downloading

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)

Help me with installing.

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?

update docs

update install instructions (python3)
add new screenshots

Python3

It's time my fellow friend!

No module named 'mpd' error while starting

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'

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.