From eade1d7eabd0ab438004750b306c129fc3db9b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Tue, 2 Sep 2014 20:36:26 +0700 Subject: [PATCH] [drtuber] Extract counters --- youtube_dl/extractor/drtuber.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/youtube_dl/extractor/drtuber.py b/youtube_dl/extractor/drtuber.py index 9a13925b4..172b69da1 100644 --- a/youtube_dl/extractor/drtuber.py +++ b/youtube_dl/extractor/drtuber.py @@ -3,6 +3,7 @@ import re from .common import InfoExtractor +from ..utils import str_to_int class DrTuberIE(InfoExtractor): @@ -14,6 +15,9 @@ class DrTuberIE(InfoExtractor): 'id': '1740434', 'ext': 'mp4', 'title': 'Hot Perky Blonde Naked Golf', + 'like_count': int, + 'dislike_count': int, + 'comment_count': int, 'categories': list, # NSFW 'thumbnail': 're:https?://.*\.jpg$', 'age_limit': 18, @@ -36,6 +40,16 @@ def _real_extract(self, url): r'poster="([^"]+)"', webpage, 'thumbnail', fatal=False) + like_count = str_to_int(self._html_search_regex( + r'\s*]+>\s*([\d,\.]+)', + webpage, 'like count', fatal=False)) + dislike_count = str_to_int(self._html_search_regex( + r'\s*]+>\s*([\d,\.]+)', + webpage, 'like count', fatal=False)) + comment_count = str_to_int(self._html_search_regex( + r'([\d,\.]+)', + webpage, 'comment count', fatal=False)) + cats_str = self._html_search_regex( r'