From a4ca7681698954688cfc44a7f2c991bb39523cec Mon Sep 17 00:00:00 2001 From: DarkFighterLuke Date: Sat, 26 Feb 2022 15:06:16 +0100 Subject: [PATCH] Scrape views --- youtube_dl/extractor/xvideos.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/youtube_dl/extractor/xvideos.py b/youtube_dl/extractor/xvideos.py index ed7c216ac..8f6af255a 100644 --- a/youtube_dl/extractor/xvideos.py +++ b/youtube_dl/extractor/xvideos.py @@ -10,6 +10,7 @@ from ..utils import ( ExtractorError, int_or_none, parse_duration, + str_to_int, urljoin, ) @@ -37,6 +38,7 @@ class XVideosIE(InfoExtractor): 'tags': ['lesbian', 'teen', 'hardcore', 'latina', 'rough', 'squirt', 'big-ass', 'cheater', 'twistys', 'cheat', 'ass-play', 'when-girls-play'], 'creator': 'Twistys', 'actors': [{'given_name': 'Adriana Chechik', 'url': 'https://www.xvideos.com/pornstars/adriana-chechik'}, {'given_name': 'Abella Danger', 'url': 'https://www.xvideos.com/pornstars/abella-danger'}], + 'views': int, } }, { 'url': 'https://flashservice.xvideos.com/embedframe/4588838', @@ -153,6 +155,8 @@ class XVideosIE(InfoExtractor): 'url': urljoin(url, actor_tuple[0]), }) + views = self._search_regex(r'(?P.+?)<', webpage, 'views', group='views') + return { 'id': video_id, 'formats': formats, @@ -163,4 +167,5 @@ class XVideosIE(InfoExtractor): 'tags': tags, 'creator': creator, 'actors': actors, + 'views': str_to_int(views), }