- duration = int_or_none(info.get('videoLengthInSeconds'))
- age_limit = parse_age_limit(info.get('audienceRating'))
+ title = self._search_regex(
+ (r'title["\']\s*:\s*(["\'])(?P<value>(?:(?!\1).)+)\1',
+ r'<h1[^>]*>(?P<value>[^<]+)'), webpage, 'title', group='value')
+
+ def get(key, name):
+ return int_or_none(self._search_regex(
+ r'%s["\']\s*:\s*["\'](\d+)' % key, webpage, name,
+ default=None))
+
+ age_limit = get('ratings', 'age limit')
+ video_id = video_id or get('pid', 'video id') or display_id