šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

aspotify

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aspotify

Asynchronous Spotify API Client

1.0.0
PyPI
Maintainers
1

aspotify: Asynchronous Spotify API Client

aspotify is a package created for asynchronous connection to the Spotify API.

Installation

Dependencies:

- Python 3.7, 3.8, 3.9, 3.11, 3.12
- Redis
- Spotify Account

Installation:

$ pip install aspotify

SHA-256 Hash

To get the SHA-256 Hash from your Spotify account:

  • Open Your Browser:

    • Launch your preferred web browser (e.g., Chrome, Firefox).
  • Open Developer Tools:

    • Press Ctrl+Shift+I to open the Developer Tools.
  • Navigate to Spotify:

    • In the address bar, go to https://open.spotify.com.
  • Filter Network Requests:

    • Within the Developer Tools, go to the "Network" tab.
    • In the "Filter" box, type query to filter the network requests.
  • Locate the SHA-256 Hash:

    • Look through the filtered network requests for URLs containing query.
    • Click on one of URLs and examine the details in the "Headers" tab.
    • Find and note the SHA-256 Hash from the URL data.

Environment Variables

export SPOTIFY_USERNAME="<your_spotify_username>"
export SPOTIFY_PASSWORD="<your_spotify_password>"
export SPOTIFY_SCOPES="user-read-email,playlist-read-private"

export SPOTIFY_REDIS_HOST="localhost"
export SPOTIFY_REDIS_PORT=6379
export SPOTIFY_REDIS_DB=0

export SPOTIFY_SHA256HASH="<your_sha256_hash>"

For more details on Spotify API scopes, visit Spotify's official documentation on scopes.

Usage

import asyncio

from aspotify import API


async def main():
    api = API()

    data = await api.request("https://api.spotify.com/v1/tracks/0tgVpDi06FyKpA1z0VMD4v")
    assert data["uri"] == "spotify:track:0tgVpDi06FyKpA1z0VMD4v"

asyncio.run(main())

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts