Create tag_opus.py

pull/139/head
RandomNinjaAtk 2 years ago committed by GitHub
parent e2e18251bf
commit 960afe03af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,54 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import enum
import argparse
from mutagen.oggopus import OggOpus
parser = argparse.ArgumentParser(description='Optional app description')
# Argument
parser.add_argument('--file', help='A required integer positional argument')
parser.add_argument('--songartist', help='A required integer positional argument')
parser.add_argument('--songalbumartist', help='A required integer positional argument')
args = parser.parse_args()
filename = args.file
artist = args.songartist
albumartist = args.songalbumartist
audio = OggOpus(filename)
try:
audio.pop('ALBUMARTIST')
except:
pass
try:
audio.pop('ALBUMARTIST_CREDIT')
except:
pass
try:
audio.pop('ALBUMARTISTSORT')
except:
pass
try:
audio.pop('ALBUM_ARTIST')
except:
pass
try:
audio.pop('ALBUM ARTIST')
except:
pass
try:
audio.pop('ARTISTSORT')
except:
pass
audio['ARTIST'] = [artist]
audio['ALBUMARTIST'] = [albumartist]
audio.pprint();
audio.save();
#print([filename]);
#print(artist);
#print(albumartist);
#print('Tagged!');
Loading…
Cancel
Save