From 8c1ef007ace7d745a638de08b20c53a5cd725e46 Mon Sep 17 00:00:00 2001 From: "M.Yasoob Ullah Khalid" Date: Thu, 27 Jun 2013 23:20:08 +0500 Subject: [PATCH 1/5] Changed the error message. I changed the ExtractorError from ```msg = msg + u'; please report this issue on http://yt-dl.org/bug'``` to ```msg = msg + u'; please report this issue on http://yt-dl.org/bug with the complete output by running the same command with --verbose flag'``` Hopefully this will tell the users to report bugs with the complete output. --- youtube_dl/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 4d415bd61..c3dc85367 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -474,7 +474,7 @@ class ExtractorError(Exception): """ tb, if given, is the original traceback (so that it can be printed out). """ if not sys.exc_info()[0] in (compat_urllib_error.URLError, socket.timeout, UnavailableVideoError): - msg = msg + u'; please report this issue on http://yt-dl.org/bug' + msg = msg + u'; please report this issue on http://yt-dl.org/bug with the complete output by running the same command with --verbose flag' super(ExtractorError, self).__init__(msg) self.traceback = tb From 4b0f34d56761edf5b619c2a0553cb821cc17fa29 Mon Sep 17 00:00:00 2001 From: "M.Yasoob Khalid" Date: Fri, 28 Jun 2013 10:34:01 +0500 Subject: [PATCH 2/5] Added an IE for gamespot. Although gamespot allows downloading but it is only available to registered users. With this IE no registration is required. --- youtube_dl/extractor/__init__.py | 2 ++ youtube_dl/extractor/gamespot.py | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 youtube_dl/extractor/gamespot.py diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index a9aa7e506..1032dd1d4 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -15,6 +15,7 @@ from .escapist import EscapistIE from .facebook import FacebookIE from .flickr import FlickrIE from .funnyordie import FunnyOrDieIE +from .gamespot import GameSpotIE from .gametrailers import GametrailersIE from .generic import GenericIE from .googleplus import GooglePlusIE @@ -140,6 +141,7 @@ def gen_extractors(): WimpIE(), HotNewHipHopIE(), AUEngineIE(), + GameSpotIE(), GenericIE() ] diff --git a/youtube_dl/extractor/gamespot.py b/youtube_dl/extractor/gamespot.py new file mode 100644 index 000000000..37d7df8f5 --- /dev/null +++ b/youtube_dl/extractor/gamespot.py @@ -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'(.+?)', + webpage, 'video title').replace('- GameSpot.com','') + upload_date = self._search_regex(r"'publish_date':'([^/d]+)','edid'", + webpage, 'upload date') + description = self._search_regex(r'', + 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"(.+?)", + info_webpage, 'download url') + thumbnail_url = self._search_regex(r'(.+?)', + 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, + }] From cf857ae84ad4bb1eb77827b8d47f64a5744afe28 Mon Sep 17 00:00:00 2001 From: "M.Yasoob Khalid" Date: Fri, 28 Jun 2013 10:42:18 +0500 Subject: [PATCH 3/5] Added test for GameSpot.com --- test/tests.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/tests.json b/test/tests.json index fcb3074c9..d92f23963 100644 --- a/test/tests.json +++ b/test/tests.json @@ -676,5 +676,16 @@ "info_dict": { "title": "Freddie Gibbs Songs - Lay It Down" } + }, + { + "name": "GameSpot", + "url": "http://www.gamespot.com/arma-iii/videos/arma-iii-community-guide-sitrep-i-6410818/", + "file": "6410818.mp4", + "md5": "5569d64ca98db01f0177c934fe8c1e9b", + "info_dict": { + "title": "Arma III - Community Guide: SITREP I ", + "upload_date": "20130627", + "description": "Check out this video where some of the basics of Arma III is explained." + } } ] From 517ec100777e69d69a3d9b1ff62fb3f560372177 Mon Sep 17 00:00:00 2001 From: "M.Yasoob Khalid" Date: Fri, 28 Jun 2013 20:44:06 +0500 Subject: [PATCH 4/5] Added an IE for http://ringtv.craveonline.com/ --- youtube_dl/extractor/__init__.py | 2 ++ youtube_dl/extractor/ringtv.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 youtube_dl/extractor/ringtv.py diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 1032dd1d4..fbb1dfc17 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -39,6 +39,7 @@ from .photobucket import PhotobucketIE from .pornotube import PornotubeIE from .rbmaradio import RBMARadioIE from .redtube import RedTubeIE +from .ringtv import RingTvIE from .soundcloud import SoundcloudIE, SoundcloudSetIE from .spiegel import SpiegelIE from .stanfordoc import StanfordOpenClassroomIE @@ -142,6 +143,7 @@ def gen_extractors(): HotNewHipHopIE(), AUEngineIE(), GameSpotIE(), + RingTvIE(), GenericIE() ] diff --git a/youtube_dl/extractor/ringtv.py b/youtube_dl/extractor/ringtv.py new file mode 100644 index 000000000..c03aedc45 --- /dev/null +++ b/youtube_dl/extractor/ringtv.py @@ -0,0 +1,28 @@ +import re + +from .common import InfoExtractor + + +class RingTvIE(InfoExtractor): + _VALID_URL = r'(?:http://)?(?:www\.)?ringtv\.craveonline\.com/videos/video/([^/]+)' + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + video_id = mobj.group(1).split('-')[0] + webpage = self._download_webpage(url, video_id) + title = self._search_regex(r'(.+?)', + webpage, 'video title').replace(' | RingTV','') + description = self._search_regex(r'
(.+?)
', + webpage, 'Description') + final_url = "http://ringtv.craveonline.springboardplatform.com/storage/ringtv.craveonline.com/conversion/%s.mp4" %(str(video_id)) + thumbnail_url = "http://ringtv.craveonline.springboardplatform.com/storage/ringtv.craveonline.com/snapshots/%s.jpg" %(str(video_id)) + ext = final_url.split('.')[-1] + return [{ + 'id' : video_id, + 'url' : final_url, + 'ext' : ext, + 'title' : title, + 'thumbnail' : thumbnail_url, + 'description' : description, + }] + From ea02372c965e22205bd6a4c772eba0801ce94e87 Mon Sep 17 00:00:00 2001 From: "M.Yasoob Khalid" Date: Fri, 28 Jun 2013 20:55:00 +0500 Subject: [PATCH 5/5] Added test for http://ringtv.craveonline.com/ --- test/tests.json | 10 ++++++++++ youtube_dl/extractor/ringtv.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/test/tests.json b/test/tests.json index d92f23963..abaf4d74d 100644 --- a/test/tests.json +++ b/test/tests.json @@ -687,5 +687,15 @@ "upload_date": "20130627", "description": "Check out this video where some of the basics of Arma III is explained." } + }, + { + "name": "RingTv", + "url": "http://ringtv.craveonline.com/videos/video/746619-canelo-alvarez-talks-about-mayweather-showdown", + "file": "746619.mp4", + "md5": "7c46b4057d22de32e0a539f017e64ad3", + "info_dict": { + "title": "Canelo Alvarez talks about Mayweather showdown", + "description": "Saul \"Canelo\" Alvarez spoke to the media about his Sept. 14 showdown with Floyd Mayweather after their kick-off presser in NYC. Canelo is motivated and confident that he will have the speed and gameplan to beat the pound-for-pound king." + } } ] diff --git a/youtube_dl/extractor/ringtv.py b/youtube_dl/extractor/ringtv.py index c03aedc45..4c5c7f97b 100644 --- a/youtube_dl/extractor/ringtv.py +++ b/youtube_dl/extractor/ringtv.py @@ -13,7 +13,7 @@ class RingTvIE(InfoExtractor): title = self._search_regex(r'(.+?)', webpage, 'video title').replace(' | RingTV','') description = self._search_regex(r'
(.+?)
', - webpage, 'Description') + webpage, 'Description').replace('\\','') final_url = "http://ringtv.craveonline.springboardplatform.com/storage/ringtv.craveonline.com/conversion/%s.mp4" %(str(video_id)) thumbnail_url = "http://ringtv.craveonline.springboardplatform.com/storage/ringtv.craveonline.com/snapshots/%s.jpg" %(str(video_id)) ext = final_url.split('.')[-1]