Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USLT option listed but not supported. #306

Closed
hboetes opened this issue May 20, 2017 · 1 comment
Closed

USLT option listed but not supported. #306

hboetes opened this issue May 20, 2017 · 1 comment

Comments

@hboetes
Copy link

hboetes commented May 20, 2017

Hi there, I tried adding lyrics to an mp3 file, but it wasn’t supported.

Usage: mid3v2 [OPTION] [FILE]…

mid3v2: error: no such option: --USLT
% mid3v2 -f|grep USLT             
    --USLT    Unsynchronised lyrics/text transcription.

Could you please add support for it? Also please consider adding said tag from a file, since lyrics are rather clumsy to add from the command line.

@lazka
Copy link
Member

lazka commented Jun 14, 2017

I made it work the same as COMM for now as I'd like to avoid adding more variations argument formats. If you have more complex use cases like reading from files I'd recommend writing a Python script.

import sys
from mutagen import MutagenError
from mutagen.id3 import ID3, USLT, ID3NoHeaderError

try:
    tags = ID3(sys.argv[1])
except ID3NoHeaderError:
    tags = ID3()

with open(sys.argv[2], "rb") as h:
    text = h.read().decode("utf-8")
    tags.delall("USLT")
    tags.add(USLT(text=text, lang="eng", desc=""))

tags.save(sys.argv[1])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants