fix: format code

This commit is contained in:
WorldObservationLog
2024-05-04 23:59:52 +08:00
parent efe1f4efd5
commit 3b00e3175a
18 changed files with 1123 additions and 1080 deletions

View File

@@ -9,7 +9,6 @@ from bs4 import BeautifulSoup
from src.config import Download
from src.exceptions import NotTimeSyncedLyricsException
from src.types import *
@@ -117,3 +116,11 @@ def check_song_exists(metadata, config: Download, codec: str):
def get_valid_filename(filename: str):
return "".join(i for i in filename if i not in r"\/:*?<>|")
def get_codec_from_codec_id(codec_id: str) -> str:
codecs = [Codec.AC3, Codec.EC3, Codec.AAC, Codec.ALAC, Codec.AAC_BINAURAL, Codec.AAC_DOWNMIX]
for codec in codecs:
if regex.match(CodecRegex.get_pattern_by_codec(codec), codec_id):
return codec
return ""