embed.messages: use Path.suffix

This commit is contained in:
Luna 2019-02-22 22:07:30 -03:00
parent c225c17400
commit 0b0f6912fa
1 changed files with 1 additions and 1 deletions

View File

@ -127,7 +127,7 @@ async def process_url_embed(config, storage, dispatcher,
for url in urls:
parsed = urllib.parse.urlparse(url)
path = Path(parsed.path)
extension = path.name.split('.')[-1]
extension = path.suffix.lstrip('.')
if extension in MEDIA_EXTENSIONS:
embed = await insert_media_meta(url, config, session)