From bbfca487d0c9ef637696fa8c0fff891e014f75bc Mon Sep 17 00:00:00 2001 From: luceatnobis Date: Sun, 23 Jul 2017 13:19:30 +0200 Subject: [PATCH] [RutubePlaylistIE] correct retrieval of category --- youtube_dl/extractor/rutube.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/rutube.py b/youtube_dl/extractor/rutube.py index fcdb7e19c..a6b17c0ef 100644 --- a/youtube_dl/extractor/rutube.py +++ b/youtube_dl/extractor/rutube.py @@ -255,6 +255,7 @@ class RutubePlaylistIE(InfoExtractor): results = page['results'] for result in results: entry = self.url_result(result.get('video_url'), 'Rutube') + category = try_get(result, lambda x: x['category']['name']) entry.update({ 'id': result.get('id'), 'uploader': try_get(result, lambda x: x['author']['name']), @@ -264,7 +265,7 @@ class RutubePlaylistIE(InfoExtractor): 'description': result.get('description'), 'thumbnail': result.get('thumbnail_url'), 'duration': int_or_none(result.get('duration')), - 'category': [try_get(result, lambda x: x['category']['name'])], + 'category': [category] if category else None, 'age_limit': 18 if result.get('is_adult') else 0, 'view_count': int_or_none(result.get('hits')), 'is_live': result.get('is_livestream'),