]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/gamejolt.py
[ie/crunchyroll] Fix stream extraction (#10005)
[yt-dlp.git] / yt_dlp / extractor / gamejolt.py
index a13e528f5283a11a0b3c92f07119586a0adae7f6..1d3c0b110746e57006fb6039261bf41d4494a316 100644 (file)
@@ -1,4 +1,3 @@
-# coding: utf-8
 import itertools
 import json
 import math
@@ -49,7 +48,7 @@ def _get_comments(self, post_num_id, post_hash_id):
                 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(
@@ -89,7 +88,7 @@ def _parse_post(self, post_data):
             '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')),
@@ -268,9 +267,9 @@ class GameJoltIE(GameJoltBaseIE):
                 'id': 'dszyjnwi',
                 'ext': 'webm',
                 'title': 'gif-presentacion-mejorado-dszyjnwi',
-                'n_entries': 1,
             }
-        }]
+        }],
+        'playlist_count': 1,
     }, {
         # Multiple GIFs
         'url': 'https://gamejolt.com/p/gif-yhsqkumq',
@@ -375,7 +374,6 @@ class GameJoltGameSoundtrackIE(GameJoltBaseIE):
         'info_dict': {
             'id': '657899',
             'title': 'Friday Night Funkin\': Vs Oswald',
-            'n_entries': None,
         },
         'playlist': [{
             'info_dict': {
@@ -385,7 +383,6 @@ class GameJoltGameSoundtrackIE(GameJoltBaseIE):
                 'url': r're:^https://.+vs-oswald-menu-music\.mp3$',
                 'release_timestamp': 1635190816,
                 'release_date': '20211025',
-                'n_entries': 3,
             }
         }, {
             'info_dict': {
@@ -395,7 +392,6 @@ class GameJoltGameSoundtrackIE(GameJoltBaseIE):
                 'url': r're:^https://.+rabbit-s-luck--full-version-\.mp3$',
                 'release_timestamp': 1635190841,
                 'release_date': '20211025',
-                'n_entries': 3,
             }
         }, {
             'info_dict': {
@@ -405,9 +401,9 @@ class GameJoltGameSoundtrackIE(GameJoltBaseIE):
                 'url': r're:^https://.+last-straw\.mp3$',
                 'release_timestamp': 1635881104,
                 'release_date': '20211102',
-                'n_entries': 3,
             }
-        }]
+        }],
+        'playlist_count': 3,
     }]
 
     def _real_extract(self, url):