Browse Source

[youtube] Look for published-on date if uploaded-on is not found

Fixes #2911
totalwebcasting
Philipp Hagemeister 11 years ago
parent
commit
beee53de06
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      youtube_dl/extractor/youtube.py

+ 4
- 0
youtube_dl/extractor/youtube.py View File

@ -1138,6 +1138,10 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
# upload date # upload date
upload_date = None upload_date = None
mobj = re.search(r'(?s)id="eow-date.*?>(.*?)</span>', video_webpage) mobj = re.search(r'(?s)id="eow-date.*?>(.*?)</span>', video_webpage)
if mobj is None:
mobj = re.search(
r'(?s)id="watch-uploader-info".*?>.*?Published on (.*?)</strong>',
video_webpage)
if mobj is not None: if mobj is not None:
upload_date = ' '.join(re.sub(r'[/,-]', r' ', mobj.group(1)).split()) upload_date = ' '.join(re.sub(r'[/,-]', r' ', mobj.group(1)).split())
upload_date = unified_strdate(upload_date) upload_date = unified_strdate(upload_date)


Loading…
Cancel
Save