git://git.jankratochvil.net
/
youtube-dl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b20d4f8
)
now downloads soundcloud songs, need to polish title grabbing and file naming
author
Kevin Ngo
<ngoke@onid.oregonstate.edu>
Sun, 13 Nov 2011 00:48:43 +0000
(16:48 -0800)
committer
Kevin Ngo
<ngoke@onid.oregonstate.edu>
Sun, 13 Nov 2011 00:48:43 +0000
(16:48 -0800)
youtube-dl
patch
|
blob
|
history
diff --git
a/youtube-dl
b/youtube-dl
index
6eafc30
..
949d2e5
100755
(executable)
--- a/
youtube-dl
+++ b/
youtube-dl
@@
-3533,10
+3533,10
@@
class SoundcloudIE(InfoExtractor):
self.report_extraction('%s/%s' % (uploader, slug_title))
# extract uid and access token
self.report_extraction('%s/%s' % (uploader, slug_title))
# extract uid and access token
- mobj = re.search('"uid":"([\w\d]+?)".*?stream_token=([\w\d]+)', page)
+ mobj = re.search('"uid":"([\w\d]+?)".*?stream_token=([\w\d]+)',
web
page)
if mobj:
if mobj:
- video_id = m
atch
.group(1)
- stream_token = m
atch
.group(2)
+ video_id = m
obj
.group(1)
+ stream_token = m
obj
.group(2)
# construct media url (with uid/token) to request song
mediaURL = "http://media.soundcloud.com/stream/%s?stream_token=%s"
# construct media url (with uid/token) to request song
mediaURL = "http://media.soundcloud.com/stream/%s?stream_token=%s"
@@
-3544,17
+3544,18
@@
class SoundcloudIE(InfoExtractor):
# description
description = u'No description available'
# description
description = u'No description available'
- mobj = re.search('track-description-value"><p>(.*?)</p>', page)
+ mobj = re.search('track-description-value"><p>(.*?)</p>',
web
page)
if mobj:
description = mobj.group(1)
# upload date
if mobj:
description = mobj.group(1)
# upload date
- mobj = re.search("pretty-date'>on ([\w]+ [\d]+, [\d]+ \d+:\d+)</abbr></h2>", page)
+ upload_date = None
+ mobj = re.search("pretty-date'>on ([\w]+ [\d]+, [\d]+ \d+:\d+)</abbr></h2>", webpage)
if mobj:
try:
if mobj:
try:
- upload_date = datetime.datetime.strptime(m
atch
.group(1), '%B %d, %Y %H:%M').strftime('%Y%m%d')
- except:
- p
ass
+ upload_date = datetime.datetime.strptime(m
obj
.group(1), '%B %d, %Y %H:%M').strftime('%Y%m%d')
+ except
Exception as e
:
+ p
rint str(e)
# for soundcloud, a request must be made to a cross domain to establish
# needed cookies
# for soundcloud, a request must be made to a cross domain to establish
# needed cookies
@@
-3563,10
+3564,10
@@
class SoundcloudIE(InfoExtractor):
try:
self._downloader.process_info({
'id': video_id,
try:
self._downloader.process_info({
'id': video_id,
- 'url':
video_url
,
+ 'url':
mediaURL
,
'uploader': uploader,
'upload_date': upload_date,
'uploader': uploader,
'upload_date': upload_date,
- 'title':
video
_title,
+ 'title':
simple
_title,
'stitle': simple_title,
'ext': u'mp3',
'format': u'NA',
'stitle': simple_title,
'ext': u'mp3',
'format': u'NA',