Added an IE for gamespot. Although gamespot allows downloading but it is only available to registered users. With this IE no registration is required.

This commit is contained in:
M.Yasoob Khalid 2013-06-28 10:34:01 +05:00
parent 8c1ef007ac
commit 4b0f34d567
2 changed files with 36 additions and 0 deletions

View File

@ -15,6 +15,7 @@ from .escapist import EscapistIE
from .facebook import FacebookIE from .facebook import FacebookIE
from .flickr import FlickrIE from .flickr import FlickrIE
from .funnyordie import FunnyOrDieIE from .funnyordie import FunnyOrDieIE
from .gamespot import GameSpotIE
from .gametrailers import GametrailersIE from .gametrailers import GametrailersIE
from .generic import GenericIE from .generic import GenericIE
from .googleplus import GooglePlusIE from .googleplus import GooglePlusIE
@ -140,6 +141,7 @@ def gen_extractors():
WimpIE(), WimpIE(),
HotNewHipHopIE(), HotNewHipHopIE(),
AUEngineIE(), AUEngineIE(),
GameSpotIE(),
GenericIE() GenericIE()
] ]

View File

@ -0,0 +1,34 @@
import re
from .common import InfoExtractor
class GameSpotIE(InfoExtractor):
_VALID_URL = r'(?:http://)?(?:www\.)?gamespot\.com/([^/]+)/videos/([^/]+)-([^/d]+)/'
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group(3).split("-")[-1]
webpage = self._download_webpage(url, video_id)
title = self._search_regex(r'<title>(.+?)</title>',
webpage, 'video title').replace('- GameSpot.com','')
upload_date = self._search_regex(r"'publish_date':'([^/d]+)','edid'",
webpage, 'upload date')
description = self._search_regex(r'<meta property="og:description" content="(.+?)" />',
webpage, 'video Description')
info_url = "http://www.gamespot.com/pages/video_player/xml.php?id="+str(video_id)
info_webpage = self._download_webpage(info_url, video_id , "Downloading info webpage")
final_url = self._search_regex(r"<URI>(.+?)</URI>",
info_webpage, 'download url')
thumbnail_url = self._search_regex(r'<screenGrabURI allowScaling="1" maintainAspectRatio="1">(.+?)</screenGrabURI>',
info_webpage, 'download url')
ext = final_url.split('.')[-1]
return [{
'id' : video_id,
'url' : final_url,
'ext' : ext,
'title' : title,
'thumbnail' : thumbnail_url,
'upload_date' : upload_date,
'description' : description,
}]