diff --git a/youtube_dl/extractor/porntrex.py b/youtube_dl/extractor/porntrex.py index e8e1cf0f5..98ed965e9 100644 --- a/youtube_dl/extractor/porntrex.py +++ b/youtube_dl/extractor/porntrex.py @@ -2,6 +2,7 @@ from __future__ import unicode_literals import re +import json from .common import InfoExtractor from ..utils import ( @@ -84,6 +85,16 @@ class PornTrexIE(InfoExtractor): self._sort_formats(formats) + flashvars_regex = re.compile( + r'flashvars.*?(\{.*?\})', + flags=re.DOTALL + ) + + flashvars = json.loads( + re.findall(flashvars_regex, webpage)[0] + ) + print(flashvars) + return { 'id': video_id, 'title': title,