changed spaces to tabs (by yt-dl standards), fixed bugs, but still won't download. need to figure out how the whole process works to integrate correctly

This commit is contained in:
Kevin Ngo 2011-11-10 01:04:33 -08:00
parent 073d7a5985
commit b20d4f8626
1 changed files with 47 additions and 40 deletions

View File

@ -3481,7 +3481,7 @@ class XVideosIE(InfoExtractor):
self._downloader.trouble(u'\nERROR: unable to download ' + video_id) self._downloader.trouble(u'\nERROR: unable to download ' + video_id)
class SoundcloudIE(InformationExtractor): class SoundcloudIE(InfoExtractor):
"""Information extractor for soundcloud.com """Information extractor for soundcloud.com
To access the media, the uid of the song and a stream token To access the media, the uid of the song and a stream token
must be extracted from the page source and the script must make must be extracted from the page source and the script must make
@ -3516,9 +3516,9 @@ class SoundcloudIE(InformationExtractor):
return return
# extract uploader (which is in the url) # extract uploader (which is in the url)
uploader = mobj.group(3).decode('utf-8') uploader = mobj.group(1).decode('utf-8')
# extract simple title (uploader + slug of song title) # extract simple title (uploader + slug of song title)
slug_title = mobj.group(4).decode('utf-8') slug_title = mobj.group(2).decode('utf-8')
simple_title = uploader + '-' + slug_title simple_title = uploader + '-' + slug_title
self.report_webpage('%s/%s' % (uploader, slug_title)) self.report_webpage('%s/%s' % (uploader, slug_title))
@ -3556,8 +3556,12 @@ class SoundcloudIE(InformationExtractor):
except: except:
pass pass
# for soundcloud, a request must be made to a cross domain to establish
# needed cookies
request = urllib2.Request('http://media.soundcloud.com/crossdomain.xml', std_headers)
try: try:
self._download.process_info({ self._downloader.process_info({
'id': video_id, 'id': video_id,
'url': video_url, 'url': video_url,
'uploader': uploader, 'uploader': uploader,
@ -3569,6 +3573,8 @@ class SoundcloudIE(InformationExtractor):
'player_url': None, 'player_url': None,
'description': description 'description': description
}) })
except UnavailableVideoError:
self._downloader.trouble(u'\nERROR: unable to download video')
class PostProcessor(object): class PostProcessor(object):
"""Post Processor class. """Post Processor class.
@ -3966,6 +3972,7 @@ def gen_extractors():
EscapistIE(), EscapistIE(),
CollegeHumorIE(), CollegeHumorIE(),
XVideosIE(), XVideosIE(),
SoundcloudIE(),
GenericIE() GenericIE()
] ]