aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-09-29 04:58:29 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-09-29 04:58:31 +0200
commit25930395225c45a9e5045ada291d37817371b086 (patch)
treed8ff1c46d839b78e80b5035cc5e42e44b55ef511 /youtube_dl/extractor
parent35d3e63d24c524922cb39ba36cb5f6de12400504 (diff)
[vimeo] Use regexps to find description
This fixes descriptions on 2.6 and makes the code simpler.
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/vimeo.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py
index 403d0bb28..a002555a9 100644
--- a/youtube_dl/extractor/vimeo.py
+++ b/youtube_dl/extractor/vimeo.py
@@ -275,18 +275,9 @@ class VimeoIE(VimeoBaseInfoExtractor, SubtitlesInfoExtractor):
_, video_thumbnail = sorted((int(width if width.isdigit() else 0), t_url) for (width, t_url) in video_thumbs.items())[-1]
# Extract video description
- video_description = None
- try:
- video_description = get_element_by_attribute("class", "description_wrapper", 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
+ video_description = self._html_search_regex(
+ r'(?s)<div class="[^"]*description"[^>]*>(.*?)</div>',
+ webpage, 'description', fatal=False)
# Extract video duration
video_duration = int_or_none(config["video"].get("duration"))