-# coding: utf-8
import itertools
import json
import math
post_hash_id, note='Downloading comments list page %d' % page)
if not comments_data.get('comments'):
break
- for comment in traverse_obj(comments_data, (('comments', 'childComments'), ...), expected_type=dict, default=[]):
+ for comment in traverse_obj(comments_data, (('comments', 'childComments'), ...), expected_type=dict):
yield {
'id': comment['id'],
'text': self._parse_content_as_text(
'uploader_id': user_data.get('username'),
'uploader_url': format_field(user_data, 'url', 'https://gamejolt.com%s'),
'categories': [try_get(category, lambda x: '%s - %s' % (x['community']['name'], x['channel'].get('display_title') or x['channel']['title']))
- for category in post_data.get('communities' or [])],
+ for category in post_data.get('communities') or []],
'tags': traverse_obj(
lead_content, ('content', ..., 'content', ..., 'marks', ..., 'attrs', 'tag'), expected_type=str_or_none),
'like_count': int_or_none(post_data.get('like_count')),
'id': 'dszyjnwi',
'ext': 'webm',
'title': 'gif-presentacion-mejorado-dszyjnwi',
- 'n_entries': 1,
}
- }]
+ }],
+ 'playlist_count': 1,
}, {
# Multiple GIFs
'url': 'https://gamejolt.com/p/gif-yhsqkumq',
'info_dict': {
'id': '657899',
'title': 'Friday Night Funkin\': Vs Oswald',
- 'n_entries': None,
},
'playlist': [{
'info_dict': {
'url': r're:^https://.+vs-oswald-menu-music\.mp3$',
'release_timestamp': 1635190816,
'release_date': '20211025',
- 'n_entries': 3,
}
}, {
'info_dict': {
'url': r're:^https://.+rabbit-s-luck--full-version-\.mp3$',
'release_timestamp': 1635190841,
'release_date': '20211025',
- 'n_entries': 3,
}
}, {
'info_dict': {
'url': r're:^https://.+last-straw\.mp3$',
'release_timestamp': 1635881104,
'release_date': '20211102',
- 'n_entries': 3,
}
- }]
+ }],
+ 'playlist_count': 3,
}]
def _real_extract(self, url):