Code Monkey home page Code Monkey logo

album-splitter's Introduction

album-splitter

Do you have a music album as a single file (locally or on YouTube), with all its tracks joined together? Do you want to split that album in its single tracks? Do you want to tag these tracks so your music player can get all the required info from them?

This script is for you!

How to install

  • Install ffmpeg
  • Install Python 3
  • Clone/Download this repository
  • cd album-splitter/
    • Use ls (or dir on Windows) to check that you are in a folder containing a README.md
  • python -m venv venv
  • Activate the virtual environment
    • Linux: source venv/bin/activate
    • Windows: ./venv/Scripts/activate
    • You will need to do this step everytime you want to use the software
  • Install the package
    • pip install .
  • You are ready to go!

Quick guide (from a local album)

  • Create a copy of the tracks.txt.example, rename it as tracks.txt and delete the lines starting with #.
  • Open tracks.txt
  • Add tracks info in this format:
    • <start-time> - <title>
    • A track on each line
    • See Examples section, many other formats supported
  • Run the script
    • Basic usage: python -m album_splitter --file <path/to/your/album.mp3>
    • More in the Examples section
  • Wait for the splitting process to complete
  • You will find your tracks in the splits folder

Quick guide (from a YouTube video)

  • Copy the YouTube URL of the album you want to download and split
  • Find in the YouTube comments the tracklist with start-time and title
  • Create a copy of the tracks.txt.example, rename it as tracks.txt and delete the lines starting with #.
  • Open tracks.txt
  • Copy the tracklist in the file, adjusting for the supported formats
    • <start-time> - <title>
    • A track on each line
  • Run the script
    • Basic usage: python -m album_splitter -yt <youtube_url>
    • More in the Examples section
  • Wait for the Download and for the conversion
  • Wait for the splitting process to complete
  • You will find your tracks in the ./splits folder

Examples

Downloading and splitting an album from YouTube

  • This is the album I want to download and split: https://www.youtube.com/watch?v=p_uqD4ng9hw
  • I find the tracklist in the comments and I copy that in tracks.txt, eventually adjusting it to a supported format for the tracklist
00:06 - When I Was Young
...
14:48 - Pretty Little Girl
  • I execute python -m album_splitter -yt "https://www.youtube.com/watch?v=p_uqD4ng9hw" and wait
  • Once the process is complete I open the ./splits and I find all my songs:
    When I Was Young.mp3
    ...
    Pretty Little Girl.mp3

These songs are already mp3-tagged with their track name and track number, but not their author or their album, since we have not specified it.

Splitting and tagging with Author and Album a local file

  • I somehow got the file DogsEatingDogsAlbum.mp3 that I want to split
  • I set the tracklist in tracks.txt (same tracks as before)
  • I execute python -m album_splitter --file DogsEatingDogsAlbum.mp3 --album "Dogs Eating Gods" --artist "blink-182" --folder "2012 - Dogs Eating Dogs"
  • The software will execute, it will split the album, and mp3-tag each track with the author and the album name I passed as a parameter (as well as track number and name). It will also put the files in the folder passed as an argument (instead of putting them in the default ./splits folder)

Supported formats for the track list (tracks.txt)

These are just some examples.

  • [hh:]mm:ss - Title
  • Title - [hh:]mm:ss
  • Title [hh:]mm:ss
  • N. Title [hh:]mm:ss
  • N - Title [hh:]mm:ss

To just see which data would be extracted from the tracklist use the option --dry-run.

Available Options

To get the full help and all the available options run python -m album_splitter --help

Need help?

If you need any help just create an Issue or send me an email at the address you can find on my profile.

Want to help?

If you want to improve the code and submit a pull request feel free to do so.

License

GPL v3

album-splitter's People

Contributors

crisbal avatar johnmoutafis avatar qfulsher avatar ghtea avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.