projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
release 2013.04.28
[youtube-dl]
/
youtube_dl
/
InfoExtractors.py
diff --git
a/youtube_dl/InfoExtractors.py
b/youtube_dl/InfoExtractors.py
index 0e2c7795dd4a8c838265b2dd09c64aa2335f05bf..6d8e7be109253306b757d7def8ad142ec7076c01 100755
(executable)
--- a/
youtube_dl/InfoExtractors.py
+++ b/
youtube_dl/InfoExtractors.py
@@
-562,12
+562,7
@@
class YoutubeIE(InfoExtractor):
mobj = re.search(r'id="eow-date.*?>(.*?)</span>', video_webpage, re.DOTALL)
if mobj is not None:
upload_date = ' '.join(re.sub(r'[/,-]', r' ', mobj.group(1)).split())
mobj = re.search(r'id="eow-date.*?>(.*?)</span>', video_webpage, re.DOTALL)
if mobj is not None:
upload_date = ' '.join(re.sub(r'[/,-]', r' ', mobj.group(1)).split())
- format_expressions = ['%d %B %Y', '%B %d %Y', '%b %d %Y']
- for expression in format_expressions:
- try:
- upload_date = datetime.datetime.strptime(upload_date, expression).strftime('%Y%m%d')
- except:
- pass
+ upload_date = unified_strdate(upload_date)
# description
video_description = get_element_by_id("eow-description", video_webpage)
# description
video_description = get_element_by_id("eow-description", video_webpage)
@@
-790,7
+785,6
@@
class DailymotionIE(InfoExtractor):
_VALID_URL = r'(?i)(?:https?://)?(?:www\.)?dailymotion\.[a-z]{2,3}/video/([^/]+)'
IE_NAME = u'dailymotion'
_VALID_URL = r'(?i)(?:https?://)?(?:www\.)?dailymotion\.[a-z]{2,3}/video/([^/]+)'
IE_NAME = u'dailymotion'
- _WORKING = False
def _real_extract(self, url):
# Extract id and simplified title from URL
def _real_extract(self, url):
# Extract id and simplified title from URL
@@
-1723,12
+1717,11
@@
class YoutubePlaylistIE(InfoExtractor):
if 'feed' not in response:
self._downloader.report_error(u'Got a malformed response from YouTube API')
return
if 'feed' not in response:
self._downloader.report_error(u'Got a malformed response from YouTube API')
return
+ playlist_title = response['feed']['title']['$t']
if 'entry' not in response['feed']:
# Number of videos is a multiple of self._MAX_RESULTS
break
if 'entry' not in response['feed']:
# Number of videos is a multiple of self._MAX_RESULTS
break
- playlist_title = response['feed']['title']['$t']
-
videos += [ (entry['yt$position']['$t'], entry['content']['src'])
for entry in response['feed']['entry']
if 'content' in entry ]
videos += [ (entry['yt$position']['$t'], entry['content']['src'])
for entry in response['feed']['entry']
if 'content' in entry ]
@@
-2386,7
+2379,7
@@
class ComedyCentralIE(InfoExtractor):
shortMediaId = mediaId.split(':')[-1]
showId = mediaId.split(':')[-2].replace('.com', '')
officialTitle = itemEl.findall('./title')[0].text
shortMediaId = mediaId.split(':')[-1]
showId = mediaId.split(':')[-2].replace('.com', '')
officialTitle = itemEl.findall('./title')[0].text
- officialDate =
itemEl.findall('./pubDate')[0].text
+ officialDate =
unified_strdate(itemEl.findall('./pubDate')[0].text)
configUrl = ('http://www.comedycentral.com/global/feeds/entertainment/media/mediaGenEntertainment.jhtml?' +
compat_urllib_parse.urlencode({'uri': mediaId}))
configUrl = ('http://www.comedycentral.com/global/feeds/entertainment/media/mediaGenEntertainment.jhtml?' +
compat_urllib_parse.urlencode({'uri': mediaId}))
@@
-2696,12
+2689,13
@@
class SoundcloudIE(InfoExtractor):
streams = json.loads(stream_json)
mediaURL = streams['http_mp3_128_url']
streams = json.loads(stream_json)
mediaURL = streams['http_mp3_128_url']
+ upload_date = unified_strdate(info['created_at'])
return [{
'id': info['id'],
'url': mediaURL,
'uploader': info['user']['username'],
return [{
'id': info['id'],
'url': mediaURL,
'uploader': info['user']['username'],
- 'upload_date':
info['created_at']
,
+ 'upload_date':
upload_date
,
'title': info['title'],
'ext': u'mp3',
'description': info['description'],
'title': info['title'],
'ext': u'mp3',
'description': info['description'],
@@
-3561,6
+3555,7
@@
class FunnyOrDieIE(InfoExtractor):
class SteamIE(InfoExtractor):
_VALID_URL = r"""http://store.steampowered.com/
class SteamIE(InfoExtractor):
_VALID_URL = r"""http://store.steampowered.com/
+ (agecheck/)?
(?P<urltype>video|app)/ #If the page is only for videos or for a game
(?P<gameID>\d+)/?
(?P<videoID>\d*)(?P<extra>\??) #For urltype == video we sometimes get the videoID
(?P<urltype>video|app)/ #If the page is only for videos or for a game
(?P<gameID>\d+)/?
(?P<videoID>\d*)(?P<extra>\??) #For urltype == video we sometimes get the videoID
@@
-3759,7
+3754,7
@@
class YouPornIE(InfoExtractor):
self._downloader.report_warning(u'unable to extract video date')
upload_date = None
else:
self._downloader.report_warning(u'unable to extract video date')
upload_date = None
else:
- upload_date =
result.group('date').strip(
)
+ upload_date =
unified_strdate(result.group('date').strip()
)
# Get the video uploader
result = re.search(r'Submitted:</label>(?P<uploader>.*)</li>', webpage)
# Get the video uploader
result = re.search(r'Submitted:</label>(?P<uploader>.*)</li>', webpage)
@@
-3866,7
+3861,7
@@
class PornotubeIE(InfoExtractor):
if result is None:
self._downloader.report_error(u'unable to extract video title')
return
if result is None:
self._downloader.report_error(u'unable to extract video title')
return
- upload_date =
result.group('date'
)
+ upload_date =
unified_strdate(result.group('date')
)
info = {'id': video_id,
'url': video_url,
info = {'id': video_id,
'url': video_url,