1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-12-15 20:48:58 +00:00

[utils] traverse_obj: Fix more bugs

and cleanup uses of `default=[]`

Continued from b1bde57bef
This commit is contained in:
Simon Sawicki
2023-02-10 03:56:26 +05:30
committed by pukkandan
parent c0cd13fb1c
commit 6839ae1f6d
10 changed files with 84 additions and 67 deletions

View File

@@ -48,7 +48,7 @@ class GameJoltBaseIE(InfoExtractor):
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(