Skip to content

Commit

Permalink
Fix date parsing for YouTube (patch by Drake Wyrm)
Browse files Browse the repository at this point in the history
  • Loading branch information
rg3 committed Feb 25, 2011
1 parent ef9f845 commit 87cbd21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion youtube-dl
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,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())
format_expressions = ['%d %B %Y', '%B %d %Y']
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')
Expand Down

0 comments on commit 87cbd21

Please sign in to comment.