Spaces:
Runtime error
title: PhysicsWallah M3u8 Parser
emoji: π»π³
colorFrom: gray
colorTo: green
sdk: docker
pinned: false
suggested_storage: small
license: mit
Table of Contents
- Project Information
- Tools Used
- Getting Started
- Usage
- API Reference
- Docker Usage
- Shell Usage (Beta)
- Error Codes
- Contributing
- License
Project Information
pwdlv3
is a project aimed at downloading videos from pw.live. It is written in Python and JavaScript, and uses pip for dependency management.
Tools Used
- Python: Backend logic scripting.
- JavaScript: Frontend logic handling.
- pip: Dependency management.
- Flask: HTTP requests handling and web UI rendering.
- Docker: Containerization for consistent application deployment.
- VSD: Downloading MPD (MPEG-DASH) files. More about VSD.
- Bento4's mp4decrypt: Decrypting encrypted MP4 files.
- FFmpeg: Merging audio and video files.
Getting Started
Windows
- Clone the repository:
git clone https://github.com/username/pwdlv3.git
- Navigate to the project directory:
cd pwdlv3
- Install the required dependencies:
pip install -r requirements.txt
- Run the setup script:
pwdl.bat
Linux
- Clone the repository:
git clone https://github.com/username/pwdlv3.git
- Navigate to the project directory:
cd pwdlv3
- Install the required dependencies:
pip install -r requirements.txt
- Run the setup script:
./setup.sh
Usage
Run the project with the following command:
python pwdl.py --options
- Download a single video:
python pwdl.py --id VIDEO_ID --name VIDEO_NAME
- Download multiple videos from a CSV file:
python pwdl.py --csv-file FILE_PATH
- Start the shell:
python pwdl.py --shell
- Start the WebUI:
python pwdl.py --webui
API Reference
The project provides several API endpoints for interacting with the video downloading service:
POST /api/create_task: Create a new download task.
- Request Body: JSON with 'id' (video ID) and 'name' (output file name).
- Response: JSON with 'task_id'.
GET /api/progress/: Get the progress of a download task.
- Response: JSON with progress information.
GET /api/get-file//: Download the completed video file.
- Response: Video file download.
GET /key/vid_id: Get the decryption key for a video.
- Query Parameters: 'vid_id' and 'token'.
- Response: JSON with 'key'.
These endpoints are also available without the '/api' prefix. For example, use /create_task
instead of /api/create_task
.
Docker Usage
The Dockerfile is used to create a Docker image that encapsulates the entire application, including all dependencies.
Building the Docker Image
Navigate to the project directory and run:
docker build -t shubhamakshit/pwdl .
Running the Docker Image
Run the Docker image with:
docker run -p 5000:5000 shubhamakshit/pwdl
Access the application at http://localhost:5000
.
Shell Usage (Beta)
Start the interactive shell with:
python pwdl.py --shell
Available commands:
get_key <vid_id> <token>
: Get the decryption key for a video.tkn-up <token>
: Update the token in the default settings.exit
: Exit the shell.
Note: This feature is in beta and may change.
Error Codes
Code | Description |
---|---|
0 | No error |
1 | defaults.json not found |
2 | Dependency not found |
3 | Dependency not found in default settings |
4 | CSV file not found |
5 | Download failed |
6 | Could not make directory |
7 | Token not found in default settings |
8 | Overwrite aborted by user |
22 | Can't load file |
23 | Flare is not started |
24 | Request failed due to unknown reason |
25 | Key extraction failed |
26 | Key not provided |
27 | Could not download audio |
28 | Could not download video |
29 | Could not decrypt audio |
30 | Could not decrypt video |
31 | Method is patched |
32 | Could not extract key |
Contributing
Instructions for how to contribute to the project will be provided here.
License
Information about the project's license will be provided here.