1
0
Fork 0
mirror of synced 2024-06-26 18:10:26 +12:00

Update regex for finding extension

This commit is contained in:
Serene-Arc 2021-03-10 14:07:59 +10:00 committed by Ali Parlakci
parent a471629287
commit 839b6f50a9

View file

@ -51,7 +51,7 @@ class Resource:
self.hash = hashlib.md5(self.content)
def _determine_extension(self) -> str:
extension_pattern = r'.*(\..{3,5})$'
extension_pattern = re.compile(r'.*(\..{3,5})(?:\?.*)?$')
match = re.search(extension_pattern, self.url)
if match:
return match.group(1)