Skip to main content

Remove first INDEX track time from every following INDEXes in a CUE sheet file

Project description

zerocue - zeros-out your CUE sheet file

Python-based command-line utility (CLI) to remove first leading INDEX track time from any subsequent INDEX timestamps in a CUE sheet file.

Install

pip install zerocue

Requirements

  • Python >= 3.8.x

NOTE: this is the version I used to develop and test it but it should work with any version of Python above 3.x

Usage

usage: zerocue [-h] [-v] [-o OUTPUT] cuefile

zerocue - remove first INDEX track time from every following INDEXes in a CUE sheet file

positional arguments:
  cuefile               source CUE file (e.g playlist.cue)

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         send informative logs to STDERR
  -o OUTPUT, --output OUTPUT
                        write to OUTPUT file instead of STDOUT

zerocue reads content from a CUE sheet file (which name is the only accepted and required CLI argument) and prints the content of the same CUE sheet file with updated INDEX time values, i.e. set the first INDEX timestamp to 00:00:00 and remove the initial first INDEX track elapsed time from every subsequent INDEX record in the sheet.

Examples

Assuming playlist.cue is a file in the current working directory which has the following content:

REM GENRE Ska
REM DATE 1991
REM DISCID D00DA810
REM COMMENT "ExactAudioCopy v0.95b4"
PERFORMER "The Specials"
TITLE "Singles"
FILE "The Specials - Singles.wav" WAVE
  TRACK 01 AUDIO
    TITLE "Gangsters"
    PERFORMER "The Specials"
    INDEX 01 01:57:31
  TRACK 02 AUDIO
    TITLE "Rudi, A Message To You"
    PERFORMER "The Specials"
    INDEX 00 02:47:74
    INDEX 01 02:48:27
  TRACK 03 AUDIO
    TITLE "Nite Klub"
    PERFORMER "The Specials"
    INDEX 00 05:41:50
    INDEX 01 05:42:27

than running zerocue playlist.cue will print the following output:

REM GENRE Ska
REM DATE 1991
REM DISCID D00DA810
REM COMMENT "ExactAudioCopy v0.95b4"
PERFORMER "The Specials"
TITLE "Singles"
FILE "The Specials - Singles.wav" WAVE
  TRACK 01 AUDIO
    TITLE "Gangsters"
    PERFORMER "The Specials"
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    TITLE "Rudi, A Message To You"
    PERFORMER "The Specials"
    INDEX 00 00:50:43
    INDEX 01 00:50:71
  TRACK 03 AUDIO
    TITLE "Nite Klub"
    PERFORMER "The Specials"
    INDEX 00 03:44:19
    INDEX 01 03:44:71

Example CUE sheet content excerpt taken from https://kodi.wiki/view/Cue_sheets.

To create a new CUE sheet you can either redirect STDIN to a (new) file or use the --output option. These two commands should be equivalent and will replace new_playlist.cue content if already present:

  • zerocue playlist.cue > new_playlist.cue
  • zerocue --output=new_playlist.cue playlist.cue

Unit Tests

To run unit tests: make dependencies tests

NOTE: make dependencies will install pytest and pylint in your current environment. Probably you want to initialize a new Python Virtualenv first:

git clone https://github.com/shaftoe/zerocue
cd zerocue
make install-venv
source .env/bin/activate

Contribute

Contributions are welcome, just open an issue/pull request or get in touch with me directly if you prefer.

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

zerocue-0.1.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

zerocue-0.1.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file zerocue-0.1.1.tar.gz.

File metadata

  • Download URL: zerocue-0.1.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for zerocue-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9808f16c0c36b7dd29c80efaa049b041526c1eced54d6028ad7a610c80e9a77d
MD5 e29fde76972e16b0c518d75e8f08f0ef
BLAKE2b-256 2d6733fe3a7e7a886f506d733d7ce265c85c4ba663927f4e151a3b5ca261be12

See more details on using hashes here.

File details

Details for the file zerocue-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: zerocue-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for zerocue-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 04ed80f180cee6602f68ca30a47cdab5290ab67aeb59398a91eacef2a8a4aa9b
MD5 aa0dee73a543333614f31adf34e3fb36
BLAKE2b-256 d4925e6815ffff1a236c88592a0f01c7c9301e2815e20eaa94fb0191927f9041

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