aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChillingPepper <90042155+ChillingPepper@users.noreply.github.com>2021-09-22 04:10:02 +0200
committerGitHub <noreply@github.com>2021-09-22 07:40:02 +0530
commitf6d8776d34ad74afc80b9cfb7207024d32419eea (patch)
tree58e30bfd8c5e0edea5ee0e5e326958b942c5dd8c
parentd806c9fd97052b05f978d28d6a8d5bf81ef54fcf (diff)
downloadhypervideo-pre-f6d8776d34ad74afc80b9cfb7207024d32419eea.tar.lz
hypervideo-pre-f6d8776d34ad74afc80b9cfb7207024d32419eea.tar.xz
hypervideo-pre-f6d8776d34ad74afc80b9cfb7207024d32419eea.zip
[SovietsCloset] Fix playlists for games with only named categories
Authored by: ConquerorDopy
-rw-r--r--yt_dlp/extractor/sovietscloset.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/yt_dlp/extractor/sovietscloset.py b/yt_dlp/extractor/sovietscloset.py
index 218a146df..64201c88c 100644
--- a/yt_dlp/extractor/sovietscloset.py
+++ b/yt_dlp/extractor/sovietscloset.py
@@ -167,6 +167,14 @@ class SovietsClosetPlaylistIE(SovietsClosetBaseIE):
},
'playlist_mincount': 3,
},
+ {
+ 'url': 'https://sovietscloset.com/Total-War-Warhammer',
+ 'info_dict': {
+ 'id': 'Total-War-Warhammer',
+ 'title': 'Total War: Warhammer - Greenskins',
+ },
+ 'playlist_mincount': 33,
+ },
]
def _real_extract(self, url):
@@ -188,7 +196,9 @@ class SovietsClosetPlaylistIE(SovietsClosetBaseIE):
category_slug = 'misc'
game = next(game for game in sovietscloset if game['slug'].lower() == game_slug)
- category = next(cat for cat in game['subcategories'] if cat['slug'].lower() == category_slug)
+ category = next((cat for cat in game['subcategories'] if cat.get('slug', '').lower() == category_slug),
+ game['subcategories'][0])
+ category_slug = category.get('slug', '').lower() or category_slug
playlist_title = game.get('name') or game_slug
if category_slug != 'misc':
playlist_title += f' - {category.get("name") or category_slug}'