Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Egsagon/ph-dl-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHFETCH ONLINE

This project is a proof of concept at implementing PHFetch - a Pornhub video downloading interface - on a downloading website.

Usage

Screenshot from the frontend: image

Run

To run in debug mode, simply run the app.py file.

python3 app.py

To run for production, use Gunicorn.

gunicorn --timeout 0 app:app
Note: removing worker timeout is needed for long downloads

If you wished to use a local version of PHFetch, try PH-downloader-webui, a WebUI built on top of PHFetch, or make your own scripts with PHFetch.

Structure

On start, the server creates a Turntable object responsible for distributing download requests to the least busy workers. Workers are threads that have their own queue. Each time a request (a Call object) is received, it will be assigned to a worker that will start downloading it or put in its queue. During the download, the frontends are given a token representing their requests. With it, they will be able to make /status requests to get the status of the download (every 3 seconds) and download the video file once the server as finished uploading it locally.

Notes

  • The frontend is very likely to be unstable.

  • The frontend has extra features, like downloading multiple videos (the + button), choosing a quality, auto-checking for video availablity, etc.

  • The server is running on a free render.com service there so you can check it out (very laggy tho).

  • The version of the PHFetch package in the git repo is slighly modified from the version 1 of PHFetch to support older python version such as 3.7.