aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-07-01 21:47:56 +0600
committerSergey M․ <dstftw@gmail.com>2015-07-01 21:47:56 +0600
commit86511ea417ac22e02800fdc3efda1d73a87eb772 (patch)
tree7ce8da1181d0ddfce47a1f9b39afe830cc9ca6e9
parent33f1f81b8b0fe65f2b22e09537ffd58927dbb45e (diff)
downloadyoutube-dl-86511ea417ac22e02800fdc3efda1d73a87eb772.zip
youtube-dl-86511ea417ac22e02800fdc3efda1d73a87eb772.tar.gz
youtube-dl-86511ea417ac22e02800fdc3efda1d73a87eb772.tar.bz2
[drtuber] Fix extraction
-rw-r--r--youtube_dl/extractor/drtuber.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/youtube_dl/extractor/drtuber.py b/youtube_dl/extractor/drtuber.py
index 37c5c18..639f918 100644
--- a/youtube_dl/extractor/drtuber.py
+++ b/youtube_dl/extractor/drtuber.py
@@ -36,25 +36,24 @@ class DrTuberIE(InfoExtractor):
r'<source src="([^"]+)"', webpage, 'video URL')
title = self._html_search_regex(
- [r'class="hd_title" style="[^"]+">([^<]+)</h1>', r'<title>([^<]+) - \d+'],
+ [r'<p[^>]+class="title_substrate">([^<]+)</p>', r'<title>([^<]+) - \d+'],
webpage, 'title')
thumbnail = self._html_search_regex(
r'poster="([^"]+)"',
webpage, 'thumbnail', fatal=False)
- like_count = str_to_int(self._html_search_regex(
- r'<span id="rate_likes">\s*<img[^>]+>\s*<span>([\d,\.]+)</span>',
- webpage, 'like count', fatal=False))
- dislike_count = str_to_int(self._html_search_regex(
- r'<span id="rate_dislikes">\s*<img[^>]+>\s*<span>([\d,\.]+)</span>',
- webpage, 'like count', fatal=False))
- comment_count = str_to_int(self._html_search_regex(
- r'<span class="comments_count">([\d,\.]+)</span>',
- webpage, 'comment count', fatal=False))
+ def extract_count(id_, name):
+ return str_to_int(self._html_search_regex(
+ r'<span[^>]+(?:class|id)="%s"[^>]*>([\d,\.]+)</span>' % id_,
+ webpage, '%s count' % name, fatal=False))
+
+ like_count = extract_count('rate_likes', 'like')
+ dislike_count = extract_count('rate_dislikes', 'dislike')
+ comment_count = extract_count('comments_count', 'comment')
cats_str = self._search_regex(
- r'<span>Categories:</span><div>(.+?)</div>', webpage, 'categories', fatal=False)
+ r'<div[^>]+class="categories_list">(.+?)</div>', webpage, 'categories', fatal=False)
categories = [] if not cats_str else re.findall(r'<a title="([^"]+)"', cats_str)
return {