mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 21:45:02 +03:00
fix: remove query and fragment
This commit is contained in:
parent
f4e36b3667
commit
568ee3e8d2
@ -25,6 +25,7 @@ SOFTWARE.
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
from ..common import get_content, urls_size, log, player, dry_run
|
from ..common import get_content, urls_size, log, player, dry_run
|
||||||
from ..extractor import VideoExtractor
|
from ..extractor import VideoExtractor
|
||||||
@ -99,7 +100,8 @@ def is_covers_stream(stream):
|
|||||||
return stream.lower() in ('covers', 'coversmini')
|
return stream.lower() in ('covers', 'coversmini')
|
||||||
|
|
||||||
def get_file_extension(file_path, default=''):
|
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:
|
if suffix:
|
||||||
# remove dot
|
# remove dot
|
||||||
suffix = suffix[1:]
|
suffix = suffix[1:]
|
||||||
|
Loading…
Reference in New Issue
Block a user