From 1028acbd04174595842fb723469b76c1b9957c30 Mon Sep 17 00:00:00 2001 From: lm Date: Sun, 15 Jan 2017 16:27:46 +0100 Subject: [PATCH] extract video tags from xhamster movie page --- youtube_dl/extractor/xhamster.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/youtube_dl/extractor/xhamster.py b/youtube_dl/extractor/xhamster.py index 36a8c9840..5c5ada0a0 100644 --- a/youtube_dl/extractor/xhamster.py +++ b/youtube_dl/extractor/xhamster.py @@ -1,3 +1,4 @@ +# coding=utf-8 from __future__ import unicode_literals import re @@ -11,6 +12,8 @@ from ..utils import ( ) + + class XHamsterIE(InfoExtractor): _VALID_URL = r'(?Phttps?)://(?:.+?\.)?xhamster\.com/movies/(?P[0-9]+)/(?P.*?)\.html(?:\?.*)?' _TESTS = [{ @@ -24,6 +27,7 @@ class XHamsterIE(InfoExtractor): 'uploader': 'Ruseful2011', 'duration': 893, 'age_limit': 18, + 'tags': ['Amateur', 'MILFs', 'POV', 'Reality', 'Sexy', 'Office', 'Oral', 'Boss', 'Fake Hub'] }, }, { 'url': 'http://xhamster.com/movies/2221348/britney_spears_sexy_booty.html?hd', @@ -35,6 +39,7 @@ class XHamsterIE(InfoExtractor): 'uploader': 'jojo747400', 'duration': 200, 'age_limit': 18, + 'tags:': ['Britney Spears', 'Berühmtheiten', 'HD Videos', 'Sexy', 'Sexy Booty'] }, 'params': { 'skip_download': True, @@ -50,6 +55,7 @@ class XHamsterIE(InfoExtractor): 'uploader': 'parejafree', 'duration': 72, 'age_limit': 18, + 'tags': [] }, 'params': { 'skip_download': True, @@ -84,6 +90,9 @@ class XHamsterIE(InfoExtractor): r']*>(.+?)(?:,\s*[^,]*?\s*Porn\s*[^,]*?:\s*xHamster[^<]*| - xHamster\.com)'], webpage, 'title') + video_tags = re.findall(r'Description: ([^<]+)', webpage) description = mobj.group(1) if mobj else None @@ -154,6 +163,7 @@ class XHamsterIE(InfoExtractor): 'dislike_count': int_or_none(dislike_count), 'comment_count': int_or_none(comment_count), 'age_limit': age_limit, + 'tags': video_tags, 'formats': formats, }