DS Audio 노래 가사 조회 플러그인
[펌] https://blog.acidpop.kr/308
해외, 국내 두개
DSM > ds audio > 설정 > 가사 플러그인 > 추가
알송 가사 플러그인 0.6
해외 가사 플러그인
[펌] https://blog.acidpop.kr/308
해외, 국내 두개
DSM > ds audio > 설정 > 가사 플러그인 > 추가
알송 가사 플러그인 0.6
해외 가사 플러그인
import os
import sys
from mutagen.mp3 import EasyMP3
from mutagen.id3 import ID3, ID3NoHeaderError
import datetime
now = datetime.datetime.now()
print(now)
def changeMP3TagsInDir(dir):
basename = os.path.basename(dir)
changedCount = 0
index = 1
lst = sorted(os.listdir(dir))
for file in lst:
fullpath = os.path.join(dir, file)
if os.path.isdir(fullpath):
if file.lower().endswith("eadir"):
continue
changeMP3TagsInDir(fullpath)
else:
if file.lower().endswith(".mp3"):
try:
tags = EasyMP3(fullpath)
except ID3NoHeaderError:
tags = mutagen.File(fullpath, easy=True)
tags.add_tags(ID3=EasyID3)
except UnicodeDecodeError:
pass
if "album" in tags:
album = tags["album"][0]
else:
album = ""
index += 1
# print("album = ", album, ", basename = ", basename)
if album == basename:
continue
tags["tracknumber"] = str(index)
tags["discnumber"] = '1'
tags["album"] = basename
try:
tags.save()
changedCount += 1
except:
print("could not save file "+file)
print("MP3 tags change. dir=", dir, ", count=", changedCount)
if changedCount > 0:
# 색인 재설정
# os.system("synoindex -R type_music &")
# os.system("synoindex -A "+path+" &")
os.system("synoindex -A '"+dir+"' &")
return
if __name__ == "__main__":
path = None
if len(sys.argv) >= 2 and os.path.exists(sys.argv[1]):
path = sys.argv[1]
if path is not None and os.path.exists(path):
changeMP3TagsInDir(path)
else:
print("Error: The path is incorrect (%s)" % path)