diff --git a/README.md b/README.md index fe3e0de..cb00be2 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ PornHub-dl is a Python tool for downloading PornHub video/playlist. +## Requirements +```bash +Python 3.7 or later +ffmpeg +``` ## Installation diff --git a/__pycache__/lib_pornhub.cpython-38.pyc b/__pycache__/lib_pornhub.cpython-38.pyc new file mode 100644 index 0000000..9e3a126 Binary files /dev/null and b/__pycache__/lib_pornhub.cpython-38.pyc differ diff --git a/lib_pornhub.py b/lib_pornhub.py index 692474c..8b52cf1 100644 --- a/lib_pornhub.py +++ b/lib_pornhub.py @@ -83,13 +83,14 @@ def ph_download_playlist(url, model_name, limit): print("[!] Limit: {} videos".format(limit)) count = 0 for i in range(len(res) - 1): + if (count == limit): + break + sys.exit() try: - if (count == limit): - sys.exit() video_dict = ast.literal_eval(res[i]) video = ydl.extract_info(str(video_dict["url"]), download=False) filename = fix_title(str(video["title"])) + '.' + str(video['ext']) - print('\n\n\n\n#######################\n\n[-] Video #{}: {}\n\n'.format(i, filename)) + print('\n\n\n\n#######################\n\n[-] Video #{}: {}\n\n'.format(count, filename)) filename = download_dir + '\\' + model_name + '\\' + filename url_video = video['url'] result = subprocess.run(["downloadm3u8", "-o", filename, url_video]) diff --git a/requirements.txt b/requirements.txt index 281ea90..e6e016d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -bs4==0.0.1 -requests==2.28.1 -youtube-dl==2020.1.1 -lxml==4.6.3 -pyfiglet==0.8.post1 -m3u8downloader==0.10.1 +bs4 +requests +youtube-dl +lxml +pyfiglet +m3u8downloader