0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-30 03:33:02 +00:00

[dailymotion] Add support for new layout (close #13580)

This commit is contained in:
Sergey M․ 2017-07-08 18:12:15 +07:00
parent eadd313321
commit a49804816c
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

@ -147,7 +147,7 @@ def _real_extract(self, url):
view_count_str = self._search_regex( view_count_str = self._search_regex(
(r'<meta[^>]+itemprop="interactionCount"[^>]+content="UserPlays:([\s\d,.]+)"', (r'<meta[^>]+itemprop="interactionCount"[^>]+content="UserPlays:([\s\d,.]+)"',
r'video_views_count[^>]+>\s+([\s\d\,.]+)'), r'video_views_count[^>]+>\s+([\s\d\,.]+)'),
webpage, 'view count', fatal=False) webpage, 'view count', default=None)
if view_count_str: if view_count_str:
view_count_str = re.sub(r'\s', '', view_count_str) view_count_str = re.sub(r'\s', '', view_count_str)
view_count = str_to_int(view_count_str) view_count = str_to_int(view_count_str)
@ -159,7 +159,9 @@ def _real_extract(self, url):
[r'buildPlayer\(({.+?})\);\n', # See https://github.com/rg3/youtube-dl/issues/7826 [r'buildPlayer\(({.+?})\);\n', # See https://github.com/rg3/youtube-dl/issues/7826
r'playerV5\s*=\s*dmp\.create\([^,]+?,\s*({.+?})\);', r'playerV5\s*=\s*dmp\.create\([^,]+?,\s*({.+?})\);',
r'buildPlayer\(({.+?})\);', r'buildPlayer\(({.+?})\);',
r'var\s+config\s*=\s*({.+?});'], r'var\s+config\s*=\s*({.+?});',
# New layout regex (see https://github.com/rg3/youtube-dl/issues/13580)
r'__PLAYER_CONFIG__\s*=\s*({.+?});'],
webpage, 'player v5', default=None) webpage, 'player v5', default=None)
if player_v5: if player_v5:
player = self._parse_json(player_v5, video_id) player = self._parse_json(player_v5, video_id)