Skip to main content

A wrapper for the private Deezer APIs

Project description

Affordable Mentions

🙏 Credits to deezspot

The whole download process was adapted from deezspot. A BIG Thank-You to this project!

⚠️ Disclaimer

Use this project at your own risk. I'm not responsible (and the author from deezspot is even less responsible) for any problems caused with your account.

Developers please note that the download process is intentionally separated into two sections: Downloading and Decrypting. I advise you to not store any decrypted audio easily readable to the user.

DeezerGW

DeezerGW is a library that implements the private API of Deezer

Installation

pip install deezergw

Features

  • Get info of tracks, albums, artists and playlists by the ID
  • Search for tracks, albums, artists and playlists
  • (Un)favorite tracks, albums, artists and playlists
  • Manage playlists
  • Download tracks (ID3 support currently missing) as a MP3 (128 or 320) or FLAC
  • Fully type safe
  • Python >= 3.8

Basic use

import deezergw

# Initialize the Client using a key for encryption (e.g. unix username)
client = deezergw.Client("choose_a_key_here", arl="put_your_browser_arl_here")

# Save session. Encrypted using the key
logindump = deezergw.generate_logindump()
with open("dump.dat", "wb") as f:
    f.write(logindump)

# Restore the session
with open("dump.dat", "rb") as f:
    dump = f.read()
new_client = deezergw.Client("choose_a_key_here", logindump=dump)

# Get a track
track = new_client.get_track("91066235")

# Metadata - See IntelliType for all options
print(track.title)
print(track.is_favorite)

print(track.album_name)

# Download the track
encrypted_data, info = track.download_encrypted()
decrypted_data = deezergw.decrypt_audio(encrypted_data, track.id) # or info["track_id"]
deezergw.save_decrypted(decrypted_data, "filename." + info["file_format"]) # Save with no metadata

# Metadata
metadata_track = deezergw.add_metadata(decrypted_data, info)
with open("metadata." + info["file_format"], "wb") as f:
    f.write(metadata_track)

# Search
results = new_client.search("C418 Alpha")
album = results.albums[0].get_full_album()
print(album.tracks[0].title)

# Favorite (basically) anything
track.favorite() # toggle
album.favorite(True) # force favorited
results.playlists[1].favorite(False) # force not favorited

# Get cover url
cover = track.cover_url(128)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deezergw-0.2.0.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deezergw-0.2.0-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file deezergw-0.2.0.tar.gz.

File metadata

  • Download URL: deezergw-0.2.0.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deezergw-0.2.0.tar.gz
Algorithm Hash digest
SHA256 442611ead6674d6f4653f8ec9e473367792e3403477c5410d8dc884326499dad
MD5 c09d1ab3aa9f0f87dce42209d877e962
BLAKE2b-256 270cea7f529ff3d6e26e4b9541d524fedf3b70562d1052ead72a4a6924f6c47a

See more details on using hashes here.

Provenance

The following attestation bundles were made for deezergw-0.2.0.tar.gz:

Publisher: python-publish.yml on tabbeddev/deezergw

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deezergw-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: deezergw-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deezergw-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0d96e879a0f622cf110e64f958846023fed0d325f25aaef1fd5ba0a7f5852bf
MD5 accd2d6c5cb3728966abaf458959e304
BLAKE2b-256 41b44f0f4d7d13566016d257cee74bff73c9202707cd00b3069e1b45dbb86b08

See more details on using hashes here.

Provenance

The following attestation bundles were made for deezergw-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on tabbeddev/deezergw

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page