[steam] Modernize
authorPhilipp Hagemeister <phihag@phihag.de>
Sat, 19 Apr 2014 17:51:04 +0000 (19:51 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Sat, 19 Apr 2014 17:51:04 +0000 (19:51 +0200)
youtube_dl/extractor/steam.py

index 91658f8925cac6199bda5f7aa05aa0a2a73e85e4..b3cbbfd778ac2aaff9ddb021600ae0daa4ddbc7f 100644 (file)
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
 import re
 
 from .common import InfoExtractor
@@ -17,22 +19,24 @@ class SteamIE(InfoExtractor):
     _VIDEO_PAGE_TEMPLATE = 'http://store.steampowered.com/video/%s/'
     _AGECHECK_TEMPLATE = 'http://store.steampowered.com/agecheck/video/%s/?snr=1_agecheck_agecheck__age-gate&ageDay=1&ageMonth=January&ageYear=1970'
     _TEST = {
-        u"url": u"http://store.steampowered.com/video/105600/",
-        u"playlist": [
+        "url": "http://store.steampowered.com/video/105600/",
+        "playlist": [
             {
-                u"file": u"81300.flv",
-                u"md5": u"f870007cee7065d7c76b88f0a45ecc07",
-                u"info_dict": {
-                        u"title": u"Terraria 1.1 Trailer",
-                        u'playlist_index': 1,
+                "md5": "f870007cee7065d7c76b88f0a45ecc07",
+                "info_dict": {
+                    'id': '81300',
+                    'ext': 'flv',
+                    "title": "Terraria 1.1 Trailer",
+                    'playlist_index': 1,
                 }
             },
             {
-                u"file": u"80859.flv",
-                u"md5": u"61aaf31a5c5c3041afb58fb83cbb5751",
-                u"info_dict": {
-                    u"title": u"Terraria Trailer",
-                    u'playlist_index': 2,
+                "md5": "61aaf31a5c5c3041afb58fb83cbb5751",
+                "info_dict": {
+                    'id': '80859',
+                    'ext': 'flv',
+                    "title": "Terraria Trailer",
+                    'playlist_index': 2,
                 }
             }
         ]
@@ -73,7 +77,7 @@ class SteamIE(InfoExtractor):
             video_url = vid.group('videoURL')
             video_thumb = thumb.group('thumbnail')
             if not video_url:
-                raise ExtractorError(u'Cannot find video url for %s' % video_id)
+                raise ExtractorError('Cannot find video url for %s' % video_id)
             info = {
                 'id':video_id,
                 'url':video_url,
@@ -82,4 +86,4 @@ class SteamIE(InfoExtractor):
                 'thumbnail': video_thumb
                   }
             videos.append(info)
-        return [self.playlist_result(videos, gameID, game_title)]
+        return self.playlist_result(videos, gameID, game_title)