mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-12-22 22:47:55 +01:00
[playvid] Use compat_urllib_parse_unquote and compat_urllib_parse_unquote_plus
This commit is contained in:
parent
2ebbb6f1f7
commit
388ad0c05c
@ -4,7 +4,8 @@ import re
|
|||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import (
|
from ..compat import (
|
||||||
compat_urllib_parse,
|
compat_urllib_parse_unquote,
|
||||||
|
compat_urllib_parse_unquote_plus,
|
||||||
)
|
)
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
clean_html,
|
clean_html,
|
||||||
@ -44,7 +45,7 @@ class PlayvidIE(InfoExtractor):
|
|||||||
flashvars = self._html_search_regex(
|
flashvars = self._html_search_regex(
|
||||||
r'flashvars="(.+?)"', webpage, 'flashvars')
|
r'flashvars="(.+?)"', webpage, 'flashvars')
|
||||||
|
|
||||||
infos = compat_urllib_parse.unquote(flashvars).split(r'&')
|
infos = compat_urllib_parse_unquote(flashvars).split(r'&')
|
||||||
for info in infos:
|
for info in infos:
|
||||||
videovars_match = re.match(r'^video_vars\[(.+?)\]=(.+?)$', info)
|
videovars_match = re.match(r'^video_vars\[(.+?)\]=(.+?)$', info)
|
||||||
if videovars_match:
|
if videovars_match:
|
||||||
@ -52,7 +53,7 @@ class PlayvidIE(InfoExtractor):
|
|||||||
val = videovars_match.group(2)
|
val = videovars_match.group(2)
|
||||||
|
|
||||||
if key == 'title':
|
if key == 'title':
|
||||||
video_title = compat_urllib_parse.unquote_plus(val)
|
video_title = compat_urllib_parse_unquote_plus(val)
|
||||||
if key == 'duration':
|
if key == 'duration':
|
||||||
try:
|
try:
|
||||||
duration = int(val)
|
duration = int(val)
|
||||||
|
Loading…
Reference in New Issue
Block a user