diff --git a/yt_dlp/extractor/steam.py b/yt_dlp/extractor/steam.py index b7f8ac3ae..35c3d275f 100644 --- a/yt_dlp/extractor/steam.py +++ b/yt_dlp/extractor/steam.py @@ -1,11 +1,19 @@ +import json import re from .common import InfoExtractor from ..utils import ( ExtractorError, + clean_html, extract_attributes, - get_element_by_class, str_or_none, + url_or_none, +) +from ..utils.traversal import ( + find_element, + find_elements, + traverse_obj, + trim_str, ) @@ -23,40 +31,18 @@ class SteamIE(InfoExtractor): _AGECHECK_TEMPLATE = 'http://store.steampowered.com/agecheck/video/%s/?snr=1_agecheck_agecheck__age-gate&ageDay=1&ageMonth=January&ageYear=1970' _TESTS = [{ 'url': 'http://store.steampowered.com/video/105600/', - 'playlist': [ - { - 'md5': '695242613303ffa2a4c44c9374ddc067', - 'info_dict': { - 'id': '256785003', - 'ext': 'mp4', - 'title': 'Terraria video 256785003', - 'thumbnail': r're:^https://cdn\.[^\.]+\.steamstatic\.com', - }, - }, - { - 'md5': '6a294ee0c4b1f47f5bb76a65e31e3592', - 'info_dict': { - 'id': '2040428', - 'ext': 'mp4', - 'title': 'Terraria video 2040428', - 'thumbnail': r're:^https://cdn\.[^\.]+\.steamstatic\.com', - }, - }, - ], 'info_dict': { 'id': '105600', 'title': 'Terraria', }, - 'params': { - 'playlistend': 2, - }, + 'playlist_mincount': 3, }, { 'url': 'https://store.steampowered.com/app/271590/Grand_Theft_Auto_V/', 'info_dict': { 'id': '271590', - 'title': 'Grand Theft Auto V', + 'title': 'Grand Theft Auto V Legacy', }, - 'playlist_count': 23, + 'playlist_mincount': 26, }] def _real_extract(self, url): @@ -81,32 +67,31 @@ class SteamIE(InfoExtractor): self.report_age_confirmation() webpage = self._download_webpage(video_url, playlist_id) - videos = re.findall(r'(