File size: 4,655 Bytes
41ca5f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
---
title: PhysicsWallah M3u8 Parser
emoji: 💻🐳
colorFrom: gray
colorTo: green
sdk: docker
pinned: false
suggested_storage: small
license: mit
---

# Table of Contents
1. [Project Information](#project-information)
2. [Tools Used](#tools-used)
3. [Getting Started](#getting-started)
    - [Windows](#windows)
    - [Linux](#linux)
4. [Usage](#usage)
5. [API Reference](#api-reference)
6. [Docker Usage](#docker-usage)
7. [Shell Usage (Beta)](#shell-usage-beta)
8. [Error Codes](#error-codes)
9. [Contributing](#contributing)
10. [License](#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](https://github.com/clitic/vsd).
- **Bento4's mp4decrypt**: Decrypting encrypted MP4 files.
- **FFmpeg**: Merging audio and video files.

# Getting Started

## Windows
1. Clone the repository:
   ```bash
   git clone https://github.com/username/pwdlv3.git
   ```
2. Navigate to the project directory:
   ```bash
   cd pwdlv3
   ```
3. Install the required dependencies:
   ```bash
   pip install -r requirements.txt
   ```
4. Run the setup script:
   ```bash
   pwdl.bat
   ```

## Linux
1. Clone the repository:
   ```bash
   git clone https://github.com/username/pwdlv3.git
   ```
2. Navigate to the project directory:
   ```bash
   cd pwdlv3
   ```
3. Install the required dependencies:
   ```bash
   pip install -r requirements.txt
   ```
4. Run the setup script:
   ```bash
   ./setup.sh
   ```

# Usage

Run the project with the following command:

```bash
python pwdl.py --options
```

- Download a single video:
  ```bash
  python pwdl.py --id VIDEO_ID --name VIDEO_NAME
  ```
- Download multiple videos from a CSV file:
  ```bash
  python pwdl.py --csv-file FILE_PATH
  ```
- Start the shell:
  ```bash
  python pwdl.py --shell
  ```
- Start the WebUI:
  ```bash
  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/<task_id>**: Get the progress of a download task.
  - **Response**: JSON with progress information.
  
- **GET /api/get-file/<task_id>/<name>**: 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:

```bash
docker build -t shubhamakshit/pwdl .
```

## Running the Docker Image

Run the Docker image with:

```bash
docker run -p 5000:5000 shubhamakshit/pwdl
```

Access the application at `http://localhost:5000`.

# Shell Usage (Beta)

Start the interactive shell with:

```bash
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.