Skip to content

awenine/id3-album-sheet-maker

Repository files navigation

id3 Album Sheet Maker

Archive album and track data on Google Sheets from mp3 data

This is a tool to read a directory of folders of mp3 albums and write each album data to a seperate info sheet of a Google Spreadsheet.

The script now writes track length and album duration as well as id3 tag data.

Screenshot

it primarily uses:

Settup and Installation

  • run npm install
  • create a .env file following the format layed out in example.env
  • This script uses Google Sheets OAuth 2.0 token for verification. A google developer profile and access can be created by following here: https://developers.google.com/sheets/api/guides/authorizing#AboutAuthorization
  • After this is settup, the credentials.json file will need to be included in the folder and linked to in the .env file, as well as the API key, the id of the sheet you want to write to, and the root directory containing the mp3s.
  • Make sure your mp3 album folder structure matches the following:
Root Directory
    - Release / Album Folder
        - Track Folder
            - mp3s
            OR
            - Track Subfolders (in the case of double albums)
                - mp3s

This structure is based on my personal collection. To change this, see Configuration.

Running the script

First, create a .env file based on the example and populate it with the root mp3 directory and the target google sheet id.
In the terminal, run npm start The first time this is run, you will need to authorise, Copy the link that appears in the terminal to your browser and authorise with your Google account, and copy and paste the resulting code back into the terminal. After the first time this will create a token for future use. The URL link to the resulting sheet should be logged in the terminal upon completion in a pale magenta.

Configuration

This script has been designed to specifically upload my collection of mp3s in the format I wanted. However, it has been seperated into modules to allow for configuration to fit other uses.

File Structure

getNestedmp3s.js contains code determing how far nested the mp3s are, and conditions for different levels of nesting (in my case, double albums that contained sub-folders of mp3s, whcih i chose to flatten into one).

id3 Tags

id3TagConfig.js configures, from the node-id3 package, what tages to retrieve or ignore.

Sheet Formatting

getSheetConfig.js has options to configure the request object that defines the sheet itself (such as tab colour) based on Google Sheets API.

Cell Formatting

getWriteCellsConfig.js is where you can define the way the tags are written to specific cells, their orientation and position.

With some adaptation this repo could be a useful starting point for more sheets-based tasks, ie reading from sheets, so hope its useful, and enjoy!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published