Last.fm Music Downloader - Download and tag your most recent Last.fm tracks
Project description
LastMP3 - Last.fm Music Downloader
A user-friendly Python tool that downloads your most recent Last.fm tracks as high-quality MP3s with automatic metadata tagging.
Features
- Download Recent Tracks: Automatically fetches your most recent Last.fm track
- Full Album Support: Option to download entire albums
- Auto-Tagging: Adds metadata (title, artist, album, artwork) to downloaded MP3s
Quick Start
Prerequisites
- Python 3.7+
- Last.fm account
- You can find the other requirements in requirements.txt
Installation through PyPi
-
Run the Pip Install Command
On Windows:
py -m pip install lastmp3
On most Unix-like platforms:
pip3 install lastmp3
On other platforms, you may try:
pip install lastmp3
Installation if you don't wanna do it through PyPi
-
Clone the repository
git clone https://github.com/yourusername/lastfm_mp3_with_tags.git cd lastfm_mp3_with_tags
-
Install dependencies
pip install -r requirements.txt
-
Get your Last.fm API key
- Visit Last.fm API
- Create a free account if you don't have one
- Generate an API key (you'll need this for first run)
Usage (If installed through PyPI)
lastmp3 [username]
Examples:
lastmp3 johndoe # Download recent track for user with the username 'johndoe'
lastmp3 --help or -h # Show help information
lastmp3 --version or -v # Show version information
Usage (If running manually)
python -m lastmp3 [username]
Examples:
python -m lastmp3 johndoe # Download recent track for user with the username 'johndoe'
python -m lastmp3 --help or -h # Show help information
python -m lastmp3 --version or -v # Show version information
First Time Setup
- Run the command with a Last.fm username
- Enter your API key when prompted (one-time setup)
- Choose to download track (t) or album (a)
- The files will be downloaded to your current working directory
File Structure
Your-Directory/
├── .github/
│ └── workflows/
│ └── lastmp3.yaml # GitHub Actions workflow
├── lastmp3/
│ ├── __init__.py
│ ├── __main__.py # Main application
│ ├── api.py # Last.fm API integration
│ └── metadata.py # MP3 tagging functionality
├── requirements.txt # Python dependencies
├── pyproject.toml # Project configuration
├── README.md # Documentation
└── License.md # MIT License
Configuration
The tool automatically creates a config.json file in LastMP3 Downloads/ containing:
- Your Last.fm API key
- FFmpeg executable paths
- Other settings
Dependencies
- mutagen: MP3 metadata manipulation
- requests: HTTP requests for Last.fm API
- static_ffmpeg: Audio processing
- yt-dlp: YouTube audio downloading
License
This project is licensed under the MIT License.
Legal Notice
This tool is for personal use only.
Troubleshooting
Common Issues
"yt-dlp not found"
pip install yt-dlp
"Invalid API key"
- Check your API key at Last.fm API
- Make sure you're using the API key, not your password
"No recent tracks found"
- Ensure the username is correct
- Check if the user's profile is public
- Verify the user has scrobbled at least one track
Getting Help
If you encounter issues:
- Check the error message carefully
- Verify your internet connection
- Ensure all dependencies are installed
- Check if your Last.fm username and API key are correct
Contributions are always welcome!!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lastmp3-0.0.2.tar.gz.
File metadata
- Download URL: lastmp3-0.0.2.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87cc0fc517c9170ffdce5ac876670b334864a6ac295f711464fc0a4b084053f6
|
|
| MD5 |
495ba4b834ae18ab40b6fd22a55f23ff
|
|
| BLAKE2b-256 |
8feae52fe65c4716ede28413b60d34ebbeffebbdb924cabdea2b889a9ec0c24d
|
File details
Details for the file lastmp3-0.0.2-py3-none-any.whl.
File metadata
- Download URL: lastmp3-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6d4853929e0c605237ab791d29c4de0b92c1d6aaf985d7ef0fd6b2a5ff4db1f
|
|
| MD5 |
a8e9bb7bfb7fca376673a635d31bdf6e
|
|
| BLAKE2b-256 |
cde895f7420ef559119094cf37bb84b6a96eff1958af7128eac10a034e207620
|