fix: remove query and fragment

This commit is contained in:
nuomi1 2022-10-05 01:24:53 +08:00
parent f4e36b3667
commit 568ee3e8d2
No known key found for this signature in database
GPG Key ID: E410D5FF602FBF25

View File

@ -25,6 +25,7 @@ SOFTWARE.
import json
import os
import re
import urllib.parse
from ..common import get_content, urls_size, log, player, dry_run
from ..extractor import VideoExtractor
@ -99,7 +100,8 @@ def is_covers_stream(stream):
return stream.lower() in ('covers', 'coversmini')
def get_file_extension(file_path, default=''):
_, suffix = os.path.splitext(file_path)
url_parse_result = urllib.parse.urlparse(file_path)
_, suffix = os.path.splitext(url_parse_result.path)
if suffix:
# remove dot
suffix = suffix[1:]