Update regex for finding extension
This commit is contained in:
@@ -51,7 +51,7 @@ class Resource:
|
|||||||
self.hash = hashlib.md5(self.content)
|
self.hash = hashlib.md5(self.content)
|
||||||
|
|
||||||
def _determine_extension(self) -> str:
|
def _determine_extension(self) -> str:
|
||||||
extension_pattern = r'.*(\..{3,5})$'
|
extension_pattern = re.compile(r'.*(\..{3,5})(?:\?.*)?$')
|
||||||
match = re.search(extension_pattern, self.url)
|
match = re.search(extension_pattern, self.url)
|
||||||
if match:
|
if match:
|
||||||
return match.group(1)
|
return match.group(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user