Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
A Python package to download Spotify playlists locally including the cover art, metadata and lyrics by leveraging the Spotify, YouTube and Genius APIs.
Spotube is a Python package that allows the user to download local .mp3
copies of Spotify playlists, including cover art, artist information and lyrics.
The package can be used to download Spotify playlists, retrieving and pairing each song with the cover art as seen on Spotify, as well as any relevant metadata. The user provides the link to a public spotify playlist, API keys for Spotify and Genius, and, optionally the directory to save the downloaded songs. The application will then:
.mp3
files, to remedy the possible volume difference of YouTube videos from one another.For instructions on how to generate the two sets of API keys needed to run the application, please refer to:
In order to utilize all the features provided by Spotube, it is necessary to have ffmpeg installed and configured in your system`s PATH variable. If no ffmpeg installation is detected, Spotube will attempt to download the prebuilt ffmpeg binaries kindly provided by the yt-dlp team. This will allow Spotube to function, but will disable some advanced features like volume normalization.
To install ffmpeg manually, follow the instructions relevant to your system:
sudo apt install software-properties-common
sudo apt update
sudo add-apt-repository ppa:jonathonf/ffmpeg-4
sudo apt install ffmpeg
To install the package using pip:
pip install spotube
The simplest way to use Spotube involves creating a downloader object using the Spotify Client ID
and Spotify Client Secret
and the Genius API Token
, and then calling start_downloader with the link of a Spotify Playlist as the argument. The downloaded songs will be stored in the directory ./Songs
by default.
This simple use case looks like this:
from spotube import downloader
SPOTIFY_ID = {YOUR SPOTIFY API CLIENT ID}
SPOTIFY_SECRET = {YOUR SPOTIFY API CLIENT SECRET}
GENIUS_TOKEN = {YOUR GENIUS API TOKEN}
PLAYLIST_LINK = {THE LINK TO A SPOTIFY PLAYLIST}
my_downloaded = downloader(SPOTIFY_ID, SPOTIFY_SECRET, GENIUS_TOKEN)
my_downloaded.start_downloader(VALID_PLAYLIST)
You can set the directory to download the songs to, in one of two ways:
By passing the optional argument directory
in the downloaded constructor:
my_downloaded = downloader(SPOTIFY_ID, SPOTIFY_SECRET, GENIUS_TOKEN, directory = "./Songs")
By setting the directory after the downloader object has been created:
my_downloaded = set_directory("./Songs")
You can stop the download process using the cancel_downloader
method on a downloader object:
my_downloaded = cancel_downloader()
This will reset all download information, like the ETA and progress.
You can examine if a Spotify playlist URL is valid by using the validate_playlist_url
method:
my_downloaded = validate_playlist_url({LINK TO A PLAYLIST})
This method will return True
for a valid link, False
otherwise.
The downloader class implements various methods to track the status of the downloader. These include:
get_progress()
: This method returns the number of songs processed.get_total()
: This method returns the total number of songs in the playlist.get_current_song()
: This method returns the title and artist(s) of the song currently being downloaded.get_eta()
: This method returns the estimated time remaining for the download to finish, in seconds.downloader_active()
: Returns True
if there is an active download in progress, False
otherwise.Spotube is aimed strictly at personal use, as per the YouTube, Spotify and LyricsGenius license agreements. Sharing the content collected by using this application, or using it for profit is strictly prohibited. For more information, please read the LICENSE file included with this distribution.
FAQs
A Python package to download Spotify playlists locally including the cover art, metadata and lyrics by leveraging the Spotify, YouTube and Genius APIs.
We found that spotube demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.