diff --git a/AtomicParsley.exe b/AtomicParsley.exe new file mode 100644 index 000000000..8c95603ef Binary files /dev/null and b/AtomicParsley.exe differ diff --git a/ffmpeg.exe b/ffmpeg.exe new file mode 100644 index 000000000..f93a964ce Binary files /dev/null and b/ffmpeg.exe differ diff --git a/ffprobe.exe b/ffprobe.exe new file mode 100644 index 000000000..c88090900 Binary files /dev/null and b/ffprobe.exe differ diff --git a/test_fork.py b/test_fork.py new file mode 100644 index 000000000..1e7c86520 --- /dev/null +++ b/test_fork.py @@ -0,0 +1,24 @@ +""" +test_fork.py is not added to git (only for local testing) +""" + +from __future__ import unicode_literals +import youtube_dl + +ydl_opts = { + 'skip_download': True, +} + +with youtube_dl.YoutubeDL(ydl_opts) as ydl: + ydl.download(['http://www.pornhub.com/view_video.php?viewkey=1331683002']) + +exit() + +ydl_opts = { + 'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]', + 'username': "tdsist", + 'password': "ZtOUktu0QP", +} + +with youtube_dl.YoutubeDL(ydl_opts) as ydl: + ydl.download(['https://fr.pornhubpremium.com/view_video.php?viewkey=ph5bdbb2cd6df6a']) \ No newline at end of file diff --git a/venv.bat b/venv.bat new file mode 100644 index 000000000..1b8d61c75 --- /dev/null +++ b/venv.bat @@ -0,0 +1,3 @@ + + +@call ".\venv\Scripts\activate" diff --git a/youtube_dl/extractor/pornhubpremium.py b/youtube_dl/extractor/pornhubpremium.py new file mode 100644 index 000000000..22b7e19a6 --- /dev/null +++ b/youtube_dl/extractor/pornhubpremium.py @@ -0,0 +1,451 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import functools +import itertools +import operator +import re + +from .common import InfoExtractor +from ..compat import ( + compat_HTTPError, + compat_str, + compat_urllib_request, +) +from .openload import PhantomJSwrapper +from ..utils import ( + determine_ext, + ExtractorError, + int_or_none, + orderedSet, + remove_quotes, + str_to_int, + url_or_none, +) + + +class PorHubPremiumBaseIE(InfoExtractor): + def _download_webpage_handle(self, *args, **kwargs): + def dl(*args, **kwargs): + return super(PorHubPremiumBaseIE, self)._download_webpage_handle(*args, **kwargs) + + webpage, urlh = dl(*args, **kwargs) + + if any(re.search(p, webpage) for p in ( + r'
]+\bonload=["\']go\(\)', + r'document\.cookie\s*=\s*["\']RNKEY=', + r'document\.location\.reload\(true\)')): + url_or_request = args[0] + url = (url_or_request.get_full_url() + if isinstance(url_or_request, compat_urllib_request.Request) + else url_or_request) + phantom = PhantomJSwrapper(self, required_version='2.0') + phantom.get(url, html=webpage) + webpage, urlh = dl(*args, **kwargs) + + return webpage, urlh + + +class PorHubPremiumIE(PorHubPremiumBaseIE): + IE_DESC = 'PorHubPremium and Thumbzilla' + _VALID_URL = r'''(?x) + https?:// + (?: + (?:[^/]+\.)?(?P