mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-19 09:25:43 +00:00
[imdb] Fix extraction in python 2.6
Using a regular expression because the html cannot be parsed.
This commit is contained in:
parent
d8d6148628
commit
b03d0d064c
@ -38,8 +38,9 @@ def _real_extract(self, url):
|
|||||||
format_page = self._download_webpage(
|
format_page = self._download_webpage(
|
||||||
compat_urlparse.urljoin(url, f_path),
|
compat_urlparse.urljoin(url, f_path),
|
||||||
u'Downloading info for %s format' % f_id)
|
u'Downloading info for %s format' % f_id)
|
||||||
json_data = get_element_by_attribute('class', 'imdb-player-data',
|
json_data = self._search_regex(
|
||||||
format_page)
|
r'<script[^>]+class="imdb-player-data"[^>]*?>(.*?)</script>',
|
||||||
|
format_page, u'json data', flags=re.DOTALL)
|
||||||
info = json.loads(json_data)
|
info = json.loads(json_data)
|
||||||
format_info = info['videoPlayerObject']['video']
|
format_info = info['videoPlayerObject']['video']
|
||||||
formats.append({
|
formats.append({
|
||||||
|
Loading…
Reference in New Issue
Block a user