about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2011-09-08 18:49:28 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2011-09-08 18:49:28 +0200
commit5991ddfd7adf7a45f8637b313bad881b646891ea (patch)
treec1428363a5ed3e15013ac6c8829b27316ede4a82
parenta88bc6bbd388efba2e7c6534a185cf57bebfe046 (diff)
downloadyoutube-dl-5991ddfd7adf7a45f8637b313bad881b646891ea.tar.gz
youtube-dl-5991ddfd7adf7a45f8637b313bad881b646891ea.tar.xz
youtube-dl-5991ddfd7adf7a45f8637b313bad881b646891ea.zip
comedycentral: Use media number instead of act number as ID
-rwxr-xr-xyoutube-dl12
1 files changed, 6 insertions, 6 deletions
diff --git a/youtube-dl b/youtube-dl
index 651e9d3a1..017a4610c 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -3089,7 +3089,7 @@ class ComedyCentralIE(InfoExtractor):
 		}.get(show_id, -ACT_COUNT)
 
 		first_player_url = mMovieParams[0][0]
-		mediaNum = int(mMovieParams[0][3]) + OFFSET
+		startMediaNum = int(mMovieParams[0][3]) + OFFSET
 		movieId = mMovieParams[0][1]
 
 		playerReq = urllib2.Request(first_player_url)
@@ -3102,8 +3102,8 @@ class ComedyCentralIE(InfoExtractor):
 		player_url = playerResponse.geturl()
 
 		for actNum in range(ACT_COUNT):
-			actTitle = 'act' + str(actNum+1)
-			mediaId = movieId + str(mediaNum + actNum)
+			mediaNum = startMediaNum + actNum
+			mediaId = movieId + str(mediaNum)
 			configUrl = ('http://www.comedycentral.com/global/feeds/entertainment/media/mediaGenEntertainment.jhtml?' +
 						urllib.urlencode({'uri': mediaId}))
 			configReq = urllib2.Request(configUrl)
@@ -3121,7 +3121,7 @@ class ComedyCentralIE(InfoExtractor):
 				turls.append(finfo)
 
 			if len(turls) == 0:
-				self._downloader.trouble(u'\nERROR: unable to download ' + actTitle + ': No videos found')
+				self._downloader.trouble(u'\nERROR: unable to download ' + str(mediaNum) + ': No videos found')
 				continue
 
 			# For now, just pick the highest bitrate
@@ -3131,7 +3131,7 @@ class ComedyCentralIE(InfoExtractor):
 
 			effTitle = show_id.replace('.com', '') + '-' + epTitle
 			info = {
-				'id': actTitle,
+				'id': str(mediaNum),
 				'url': video_url,
 				'uploader': show_id,
 				'upload_date': 'NA',
@@ -3147,7 +3147,7 @@ class ComedyCentralIE(InfoExtractor):
 			try:
 				self._downloader.process_info(info)
 			except UnavailableVideoError, err:
-				self._downloader.trouble(u'\nERROR: unable to download ' + actTitle)
+				self._downloader.trouble(u'\nERROR: unable to download ' + str(mediaNum))
 				continue