)
from ..utils import (
determine_ext,
- unified_timestamp,
- try_get,
+ bool_or_none,
int_or_none,
+ try_get,
+ unified_timestamp,
)
'age_limit': age_limit,
'view_count': int_or_none(video.get('hits')),
'comment_count': int_or_none(video.get('comments_count')),
- 'is_live': video.get('is_livestream'),
+ 'is_live': bool_or_none(video.get('is_livestream')),
}
_PAGE_TEMPLATE = 'http://rutube.ru/api/playlist/%s/%s/?page=%s&format=json'
- @staticmethod
- def suitable(url):
+ @classmethod
+ def suitable(cls, url):
+ if not super(RutubePlaylistIE, cls).suitable(url):
+ return False
params = compat_parse_qs(compat_urllib_parse_urlparse(url).query)
return params.get('pl_type', [None])[0] and int_or_none(params.get('pl_id', [None])[0])