From 3e0eb759999c7cbb9c36ebfeee85942544f2047a Mon Sep 17 00:00:00 2001 From: Lynne Date: Wed, 28 Oct 2020 01:57:49 +1000 Subject: [PATCH] remove unneeded file extension --- .idea/workspace.xml | 63 ++++++++++++++++++++++++++------------------- bcao.py | 4 +-- 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4195006..a927dcb 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -61,7 +61,7 @@ - + @@ -104,7 +104,7 @@ - + 1602927759343 @@ -169,7 +169,14 @@ - @@ -197,7 +204,8 @@ - @@ -220,10 +228,10 @@ - + - + @@ -237,50 +245,51 @@ - - + + + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - + @@ -289,10 +298,10 @@ - + - + @@ -306,6 +315,6 @@ - + \ No newline at end of file diff --git a/bcao.py b/bcao.py index bc775c5..cb9e471 100755 --- a/bcao.py +++ b/bcao.py @@ -66,7 +66,7 @@ class SongInfo: self.fallback = False fallbacks = re.match( - r"^(?P.+) - (?P.+) - (?P\d{2,}) (?P.+)\.(?:ogg|flac|alac|aiff|wav|mp3|m4a)$", + r"^(?P<artist>.+) - (?P<album>.+) - (?P<track>\d{2,}) (?P<title>.+)\.(?:ogg|flac|aiff|wav|mp3|m4a)$", self.file_name ) @@ -240,7 +240,7 @@ def main() -> None: with ZipFile(args.zip, 'r') as zip_file: for file in zip_file.namelist(): - if re.match(r"^(.+ - ){2}\d{2,} .+\.(ogg|flac|alac|aiff|wav|mp3|m4a)$", file): + if re.match(r"^(.+ - ){2}\d{2,} .+\.(ogg|flac|aiff|wav|mp3|m4a)$", file): # bandcamp zips contains songs with names formatted like "Album - Artist - 01 Song.mp3" # for example, "King Crimson - In the Wake of Poseidon - 02 Pictures of a City.ogg" # this regex should match only on those, and cut out (hopefully) all of the bonus material stuff, which shouldn't