Skip to main content

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

  1. 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

  1. Clone the repository

    git clone https://github.com/yourusername/lastfm_mp3_with_tags.git
    cd lastfm_mp3_with_tags
    
  2. Install dependencies

    pip install -r requirements.txt
    
  3. 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

  1. Run the command with a Last.fm username
  2. Enter your API key when prompted (one-time setup)
  3. Choose to download track (t) or album (a)
  4. 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:

  1. Check the error message carefully
  2. Verify your internet connection
  3. Ensure all dependencies are installed
  4. Check if your Last.fm username and API key are correct

Contributions are always welcome!!

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

lastmp3-0.0.2.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

lastmp3-0.0.2-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

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

Hashes for lastmp3-0.0.2.tar.gz
Algorithm Hash digest
SHA256 87cc0fc517c9170ffdce5ac876670b334864a6ac295f711464fc0a4b084053f6
MD5 495ba4b834ae18ab40b6fd22a55f23ff
BLAKE2b-256 8feae52fe65c4716ede28413b60d34ebbeffebbdb924cabdea2b889a9ec0c24d

See more details on using hashes here.

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

Hashes for lastmp3-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c6d4853929e0c605237ab791d29c4de0b92c1d6aaf985d7ef0fd6b2a5ff4db1f
MD5 a8e9bb7bfb7fca376673a635d31bdf6e
BLAKE2b-256 cde895f7420ef559119094cf37bb84b6a96eff1958af7128eac10a034e207620

See more details on using hashes here.

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