mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-23 16:36:48 +00:00
[xtube] Use compat_urllib_parse_unquote
This commit is contained in:
parent
7dde5f6a8d
commit
ee8de13e14
@ -5,7 +5,7 @@ import re
|
|||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import (
|
from ..compat import (
|
||||||
compat_urllib_request,
|
compat_urllib_request,
|
||||||
compat_urllib_parse,
|
compat_urllib_parse_unquote,
|
||||||
)
|
)
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
parse_duration,
|
parse_duration,
|
||||||
@ -59,7 +59,7 @@ class XTubeIE(InfoExtractor):
|
|||||||
for format_id, video_url in re.findall(
|
for format_id, video_url in re.findall(
|
||||||
r'flashvars\.quality_(.+?)\s*=\s*"([^"]+)"', webpage):
|
r'flashvars\.quality_(.+?)\s*=\s*"([^"]+)"', webpage):
|
||||||
fmt = {
|
fmt = {
|
||||||
'url': compat_urllib_parse.unquote(video_url),
|
'url': compat_urllib_parse_unquote(video_url),
|
||||||
'format_id': format_id,
|
'format_id': format_id,
|
||||||
}
|
}
|
||||||
m = re.search(r'^(?P<height>\d+)[pP]', format_id)
|
m = re.search(r'^(?P<height>\d+)[pP]', format_id)
|
||||||
@ -68,7 +68,7 @@ class XTubeIE(InfoExtractor):
|
|||||||
formats.append(fmt)
|
formats.append(fmt)
|
||||||
|
|
||||||
if not formats:
|
if not formats:
|
||||||
video_url = compat_urllib_parse.unquote(self._search_regex(
|
video_url = compat_urllib_parse_unquote(self._search_regex(
|
||||||
r'flashvars\.video_url\s*=\s*"([^"]+)"',
|
r'flashvars\.video_url\s*=\s*"([^"]+)"',
|
||||||
webpage, 'video URL'))
|
webpage, 'video URL'))
|
||||||
formats.append({'url': video_url})
|
formats.append({'url': video_url})
|
||||||
|
Loading…
Reference in New Issue
Block a user