Make regex better, shut eyed3 up
This commit is contained in:
parent
37c2081627
commit
1e5e8088f3
@ -268,8 +268,10 @@ class BadWitch:
|
||||
# Parse flags
|
||||
if self.args.debug:
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
eyed3.log.level = logging.WARNING
|
||||
elif self.args.verbose:
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
eyed3.log.level = logging.WARNING
|
||||
# Initialize library
|
||||
libfile = self.args.library or self.dirs.user_data_dir + '/lib.json'
|
||||
lib = Library(file=libfile)
|
||||
@ -353,8 +355,8 @@ class BadWitch:
|
||||
album = cregex.sub('', album)
|
||||
# Remove junk from track titles
|
||||
for regex in [
|
||||
r'^' + re.escape(artist) + r'[ ]*[-:;~]*[ ]*', # Remove artist from beginning of songs
|
||||
re.escape('(Audio)') + r'$' # Remove (Audio) from VEVO tracks AUGH
|
||||
r'^' + re.escape(artist) + r' *[-:;~]* *', # Remove artist from beginning of songs
|
||||
r' *\(.*(Official|Video|Audio|Audio|Lyric|VEVO).*\)' # Remove (Offical Audio), (Lyric Video), etc.
|
||||
]:
|
||||
cregex = re.compile(regex, re.IGNORECASE)
|
||||
for song, songcontent in playlist.items():
|
||||
@ -449,5 +451,6 @@ class BadWitch:
|
||||
print('Closing library')
|
||||
return
|
||||
|
||||
eyed3.log.level = logging.CRITICAL
|
||||
badwitch = BadWitch()
|
||||
badwitch.execute()
|
||||
|
Loading…
Reference in New Issue
Block a user