diff --git a/__pycache__/lib_pornhub.cpython-38.pyc b/__pycache__/lib_pornhub.cpython-38.pyc index 9e3a126..4698d4e 100644 Binary files a/__pycache__/lib_pornhub.cpython-38.pyc and b/__pycache__/lib_pornhub.cpython-38.pyc differ diff --git a/lib_pornhub.py b/lib_pornhub.py index 8b52cf1..8dabe16 100644 --- a/lib_pornhub.py +++ b/lib_pornhub.py @@ -77,7 +77,7 @@ def ph_download_playlist(url, model_name, limit): # tmp_playlist download print('... Getting playlist information...') - playlist_download_command = ["youtube-dl", "-j", "--flat-playlist", url] + playlist_download_command = ["youtube-dl", "-j", "--flat-playlist", "--no-check-certificate", url] res = subprocess.run(playlist_download_command, capture_output=True, text=True).stdout.split("\n") if (limit != 0 ): print("[!] Limit: {} videos".format(limit)) diff --git a/pornhub_dl.py b/pornhub_dl.py index 637f637..e032b45 100644 --- a/pornhub_dl.py +++ b/pornhub_dl.py @@ -1,6 +1,18 @@ #!/usr/bin/env python from lib_pornhub import * import argparse + +import ssl + +try: + _create_unverified_https_context = ssl._create_unverified_context +except AttributeError: + # Legacy Python that doesn't verify HTTPS certificates by default + pass +else: + # Handle target environment that doesn't support HTTPS verification + ssl._create_default_https_context = _create_unverified_https_context + def main(): parser = argparse.ArgumentParser() parser.add_argument('--url', type=str, help = 'URL of Pornhub video')