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

# 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.1.0.tar.gz (18.0 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.1.0-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for deezergw-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9208789830998c98fe7a200e6cb16a066fd222a5f73f9bc9c896f7dca1962f91
MD5 ff21adafa54b7a9b5a74b6030af3eafd
BLAKE2b-256 ce57533e0f54eae060045184001ef67a1a6ea014f351c34e5cbb24920dcbd492

See more details on using hashes here.

Provenance

The following attestation bundles were made for deezergw-0.1.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.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for deezergw-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c1f3f43aa437428965c6d80f4f34d45d384314943cc6fafa06d8d4d18abc6cf
MD5 1999cb61f49b12fa33a785e2492230a7
BLAKE2b-256 6239c21ea7acc5cc7da67bcd8da72a0367f58414560458897e3d13a810799133

See more details on using hashes here.

Provenance

The following attestation bundles were made for deezergw-0.1.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