From f9549b30f87a13de2a6dc2dc016f12692a75caf4 Mon Sep 17 00:00:00 2001 From: vdelta Date: Fri, 16 Aug 2019 14:48:08 +0200 Subject: [PATCH] [yourporn] Fix video_url (closes #21645) --- youtube_dl/extractor/yourporn.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/youtube_dl/extractor/yourporn.py b/youtube_dl/extractor/yourporn.py index 8a2d5f63b..cc98b1e5a 100644 --- a/youtube_dl/extractor/yourporn.py +++ b/youtube_dl/extractor/yourporn.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( parse_duration, - urljoin, ) @@ -33,11 +32,13 @@ class YourPornIE(InfoExtractor): webpage = self._download_webpage(url, video_id) - video_url = urljoin(url, self._parse_json( - self._search_regex( - r'data-vnfo=(["\'])(?P{.+?})\1', webpage, 'data info', - group='data'), - video_id)[video_id]).replace('/cdn/', '/cdn5/') + url_parts = self._parse_json(self._search_regex( + r'data-vnfo=(["\'])(?P{.+?})\1', webpage, 'data info', group='data'), video_id)[video_id].split("/") + + aid = self._search_regex(r'data-aid=\'([a-z0-9]+)\'', webpage, 'aid') + + video_url = 'https://' + url_parts[2] + '.trafficdeposit.com/video/' + url_parts[3] + '/' + url_parts[ + 4] + '/' + url_parts[5] + '/' + aid + '/' + video_id + '.mp4' title = (self._search_regex( r'<[^>]+\bclass=["\']PostEditTA[^>]+>([^<]+)', webpage, 'title',