GithubHelp home page GithubHelp logo

gevhaz / retag-opus Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 779 KB

A Python app to parse Youtube descriptions and generate tags for opus files

License: GNU General Public License v3.0

Python 100.00%
opus tagging

retag-opus's Introduction

Retag Opus

Say you have a music file in opus format, with a tag called description that holds data about the music in the format used by YouTube's ContentID. This script will help you parse that tag and put the relevant data into the tags where it actually belongs, such as title, artist, and album.

Dependencies

Retag requires simple-term-menu to be installed.

Usage

Run the script like so:

$ python3 retag --directory /path/to/directory/with/your/opus/files.opus

There is also a help (-h) flag:

$ retag -h
usage: main.py [-h] [-d DIR] [-v] [-V]

options:
-h, --help            show this help message and exit
-s {bash,zsh,tcsh}, --print-completion {bash,zsh,tcsh}
                      print shell completion script
-a, --all             Even if there is no YouTube description, suggest improving existing tags
-d DIR, --directory DIR
                      directory in which the files to be retagged are located
-V, --version         show program's version number and exit

Retag will go through the opus file in the root of the directory you provided and try to parse tag information from the YouTube description if it is in the tags and from the original tags (e.g. adding another artist if the title indicates a featured artist). It might look like this:

Retag Opus terminal example

Purple text indicates that the tag comes from the YouTube description. Blue indicates that the tag existed in the metadata since before. Yellow indicates that the tag comes from interpreting one of the original tags, and green indicates that the tag has been interpreted from one of the new tags taken from the YouTube description.

As you go on adjusting tags, they turn green for indicating that you're done adjusting them. In the end, some tags may stay blue, indicating that you have selected the original tag or that no new data is available. Here is an example of what it can look like:

Retag Opus final view example

As you can see, you can remove tags, which will make them print "[Removed]" in red text. In the actual song metadata, they will just be removed.

Configuration

You can configure tags that should be deleted. There are two ways you can configure these. You can either say an exact tag name that should be deleted โ€“ that is, the name of the tag itself, not its value. You can also specify a regex that, if fully matching any value in a tag, will result in that tag being deleted.

You specify this information in the Retag-Opus configuration file which is retag.toml in your XDG_CONFIG_HOME directory, so usually ~/.config/retag.toml. Here is an example:

tags_to_delete = [
  "language",
]
strings_to_delete_tags_based_on = [
  "delete_exactly_this",
  ".*delete_any_partial_match.*",
]

This will delete the language tag, any tag containing the exact value delete_exactly_this but not delete_exactly_this_other_thing, and also any tag that matches the last regex, such as test_delete_any_partial_match_test.

Project status

The project is still under development. The most common tags can be parsed but there are many more which will just be ignored. Work needs to be done in usability.

Latest workflow status:

Check pipeline status badge Deploy pipeline status badge

Latest version:

Latest PyPI version tag badge Latest patch version tag badge

Acitivy since last release:

Commits since latest version badge

retag-opus's People

Contributors

gevhaz avatar

Stargazers

kainabel avatar

Watchers

Kostas Georgiou avatar  avatar  avatar

retag-opus's Issues

Always exit from main() function

There are cases in the codebase where sys.exit() is used. Make sure that we instead send a return code for the main() function to exit with.

Don't ask to set albumartist twice

The user is currently prompted twice to set the album artist. First in the same way as normal tags, then in a special album artist selection menu. Instead of doing the first one, just make sure that all choices are available to choose from in the second one.

Make comment optional

All edited files will have a comment appended. This should be optional, and the content should be possible for the user to select.

Tab completion fails for paths with spaces

If there is spaces in a path, the tab completion for the --directory flag fails (nothing is completed) and suggestions are just a jumble of words in the directory name.

Trigger deploy job in tagging

It triggers on release today. The version of deployed package should exactly match the tag on the commit it's built from, so it makes more sense to trigger the deploy job when a tag is pushed.

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.