From 80abd212b418313abc5c5151eabd8387966f4dc8 Mon Sep 17 00:00:00 2001 From: DarkFighterLuke <luca-consoli@live.it> Date: Sat, 26 Feb 2022 14:25:01 +0100 Subject: [PATCH] Scrape tags --- youtube_dl/extractor/xvideos.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/youtube_dl/extractor/xvideos.py b/youtube_dl/extractor/xvideos.py index e63d4690d..5036b3ba9 100644 --- a/youtube_dl/extractor/xvideos.py +++ b/youtube_dl/extractor/xvideos.py @@ -25,14 +25,15 @@ class XVideosIE(InfoExtractor): (?P<id>[0-9]+) ''' _TESTS = [{ - 'url': 'http://www.xvideos.com/video4588838/biker_takes_his_girl', - 'md5': '14cea69fcb84db54293b1e971466c2e1', + 'url': 'https://www.xvideos.com/video23686408/le_ragazze_universitarie_provano_cose_nuove', + 'md5': '69638dcd63e14f587fb5b6efc932ccc3', 'info_dict': { - 'id': '4588838', + 'id': '23686408', 'ext': 'mp4', - 'title': 'Biker Takes his Girl', - 'duration': 108, + 'title': 'College Girls try new things', + 'duration': 277, 'age_limit': 18, + 'tags': ['teen', 'amateur', 'college', 'dorm', '18', 'sorority'], } }, { 'url': 'https://flashservice.xvideos.com/embedframe/4588838', @@ -137,6 +138,8 @@ class XVideosIE(InfoExtractor): self._sort_formats(formats) + tags = self._search_regex(r'<meta name="keywords" content="xvideos,xvideos\.com, x videos,x video,porn,video,videos,(?P<tag>.+?)"', webpage, 'tags', group='tag').split(',') + return { 'id': video_id, 'formats': formats, @@ -144,4 +147,5 @@ class XVideosIE(InfoExtractor): 'duration': duration, 'thumbnails': thumbnails, 'age_limit': 18, + 'tags': tags, }