From c366e06b5557ef204f1c58d66b76b1298ee2d850 Mon Sep 17 00:00:00 2001 From: John D Date: Sun, 10 Sep 2017 18:54:37 -0700 Subject: [PATCH] bug #14067 poc fix --- youtube_dl/extractor/steam.py | 46 ++++++++++++----------------------- 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/youtube_dl/extractor/steam.py b/youtube_dl/extractor/steam.py index 1a831ef6d..10d540f48 100644 --- a/youtube_dl/extractor/steam.py +++ b/youtube_dl/extractor/steam.py @@ -23,42 +23,30 @@ 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': 'f870007cee7065d7c76b88f0a45ecc07', - 'info_dict': { - 'id': '81300', + 'md5': '644c51b580f57db647da083be97c68c8', + 'info_dict': { + 'id': '2040428', 'ext': 'flv', - 'title': 'Terraria 1.1 Trailer', + 'title': 'Terraria+1.3+Trailer', 'playlist_index': 1, - } - }, - { - 'md5': '61aaf31a5c5c3041afb58fb83cbb5751', - 'info_dict': { - 'id': '80859', - 'ext': 'flv', - 'title': 'Terraria Trailer', - 'playlist_index': 2, - } - } - ], + }, 'params': { - 'playlistend': 2, + 'playlistend': 1, } }, { 'url': 'http://steamcommunity.com/sharedfiles/filedetails/?id=242472205', 'info_dict': { - 'id': 'WB5DvDOOvAY', + 'id': 'X8kpJBlzD2E', 'ext': 'mp4', - 'upload_date': '20140329', - 'title': 'FRONTIERS - Final Greenlight Trailer', - 'description': 'md5:dc96a773669d0ca1b36c13c1f30250d9', + 'upload_date': '20140617', + 'title': 'FRONTIERS - Trapping', + 'description': 'md5:bf6f7f773def614054089e5769c12a6e', 'uploader': 'AAD Productions', 'uploader_id': 'AtomicAgeDogGames', } }] + def _real_extract(self, url): m = re.match(self._VALID_URL, url) fileID = m.group('fileID') @@ -77,6 +65,7 @@ class SteamIE(InfoExtractor): webpage = self._download_webpage(videourl, playlist_id) if fileID: + playlist_title = self._html_search_regex( r'
(.+)
', webpage, 'title') mweb = re.finditer(r'''(?x) @@ -90,22 +79,19 @@ class SteamIE(InfoExtractor): } for vid in mweb] else: playlist_title = self._html_search_regex( - r'', webpage, 'game title') - + r'
(.*?)
', webpage, 'game title') mweb = re.finditer(r'''(?x) 'movie_(?P[0-9]+)':\s*\{\s* FILENAME:\s*"(?P[\w:/\.\?=]+)" (,\s*MOVIE_NAME:\s*\"(?P[\w:/\.\?=\+-]+)\")?\s*\}, ''', webpage) - titles = re.finditer( - r'(?P.+?)', webpage) thumbs = re.finditer( r'', webpage) videos = [] - for vid, vtitle, thumb in zip(mweb, titles, thumbs): + for vid, thumb in zip(mweb, thumbs): video_id = vid.group('videoID') - title = vtitle.group('videoName') + title = vid.group('videoName') video_url = vid.group('videoURL') video_thumb = thumb.group('thumbnail') if not video_url: @@ -114,7 +100,7 @@ class SteamIE(InfoExtractor): 'id': video_id, 'url': video_url, 'ext': 'flv', - 'title': unescapeHTML(title), + 'title': title, 'thumbnail': video_thumb }) if not videos: