diff options
author | Jaime Marquínez Ferrándiz <[email protected]> | 2013-09-03 11:11:36 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <[email protected]> | 2013-09-03 11:11:36 +0200 |
commit | 9c2ade40de53bae865c5267642651c81d16e48a8 (patch) | |
tree | 230e424cd2144f3e5feaf156a3fcd61eddde54a5 | |
parent | aa32314d09cf0ab3fad1efc2c5657e6704a7e47b (diff) | |
download | youtube-dl-9c2ade40de53bae865c5267642651c81d16e48a8.tar.gz youtube-dl-9c2ade40de53bae865c5267642651c81d16e48a8.zip |
[vimeo] Handle Assertions Error when trying to get the description
In some pages the html tags are not closed, python 2.6 cannot handle it.
-rw-r--r-- | youtube_dl/extractor/vimeo.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py index dee4175ef..4a7d82b7a 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dl/extractor/vimeo.py @@ -148,9 +148,17 @@ class VimeoIE(InfoExtractor): _, video_thumbnail = sorted((int(width), t_url) for (width, t_url) in config["video"]["thumbs"].items())[-1] # Extract video description - video_description = get_element_by_attribute("itemprop", "description", webpage) - if video_description: video_description = clean_html(video_description) - else: video_description = u'' + video_description = None + try: + video_description = get_element_by_attribute("itemprop", "description", webpage) + if video_description: video_description = clean_html(video_description) + except AssertionError as err: + # On some pages like (http://player.vimeo.com/video/54469442) the + # html tags are not closed, python 2.6 cannot handle it + if err.args[0] == 'we should not get here!': + pass + else: + raise # Extract upload date video_upload_date = None |