mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[twitter:card] Use _html_search_regex
This commit is contained in:
parent
575036b405
commit
77a54b6a65
1 changed files with 2 additions and 4 deletions
|
@ -7,7 +7,6 @@
|
||||||
from ..compat import compat_urllib_request
|
from ..compat import compat_urllib_request
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
float_or_none,
|
float_or_none,
|
||||||
unescapeHTML,
|
|
||||||
xpath_text,
|
xpath_text,
|
||||||
remove_end,
|
remove_end,
|
||||||
)
|
)
|
||||||
|
@ -57,9 +56,8 @@ def _real_extract(self, url):
|
||||||
request.add_header('User-Agent', user_agent)
|
request.add_header('User-Agent', user_agent)
|
||||||
webpage = self._download_webpage(request, video_id)
|
webpage = self._download_webpage(request, video_id)
|
||||||
|
|
||||||
config = self._parse_json(
|
config = self._parse_json(self._html_search_regex(
|
||||||
unescapeHTML(self._search_regex(
|
r'data-player-config="([^"]+)"', webpage, 'data player config'),
|
||||||
r'data-player-config="([^"]+)"', webpage, 'data player config')),
|
|
||||||
video_id)
|
video_id)
|
||||||
if 'playlist' not in config:
|
if 'playlist' not in config:
|
||||||
if 'vmapUrl' in config:
|
if 'vmapUrl' in config:
|
||||||
|
|
Loading…
Reference in a new issue