mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 19:33:59 +01:00
[xhamster] use determine_ext
This commit is contained in:
parent
53b0f3e4e2
commit
fc483bb6af
|
@ -4,6 +4,7 @@
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
compat_urllib_parse,
|
compat_urllib_parse,
|
||||||
unescapeHTML,
|
unescapeHTML,
|
||||||
|
determine_ext,
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -36,7 +37,6 @@ def _real_extract(self,url):
|
||||||
video_url = compat_urllib_parse.unquote(mobj.group('file'))
|
video_url = compat_urllib_parse.unquote(mobj.group('file'))
|
||||||
else:
|
else:
|
||||||
video_url = mobj.group('server')+'/key='+mobj.group('file')
|
video_url = mobj.group('server')+'/key='+mobj.group('file')
|
||||||
video_extension = video_url.split('.')[-1].split('?')[0]
|
|
||||||
|
|
||||||
video_title = self._html_search_regex(r'<title>(?P<title>.+?) - xHamster\.com</title>',
|
video_title = self._html_search_regex(r'<title>(?P<title>.+?) - xHamster\.com</title>',
|
||||||
webpage, u'title')
|
webpage, u'title')
|
||||||
|
@ -64,7 +64,7 @@ def _real_extract(self,url):
|
||||||
return [{
|
return [{
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'url': video_url,
|
'url': video_url,
|
||||||
'ext': video_extension,
|
'ext': determine_ext(video_url),
|
||||||
'title': video_title,
|
'title': video_title,
|
||||||
'description': video_description,
|
'description': video_description,
|
||||||
'upload_date': video_upload_date,
|
'upload_date': video_upload_date,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user