# Download video file

`GET /download/videos/generate/{videoIdOrUUID}`

Generate a mp4 container that contains at most 1 video stream and at most 1 audio stream. Mainly used to merge the HLS audio only video file and the HLS video only resolution file.

Authentication: no security requirement declared for this operation.

Parameters:

- `videoIdOrUUID` (path, id | UUIDv4 | shortUUID, required) - Video id or UUID
  Type: id | UUIDv4 | shortUUID
  
  oneOf:
    Reference: [id](https://sourcey-peertube.pages.dev/api-rest-reference/models/id.md); Type: id
    
    minimum: 1
    
    Example:
    
    ```json
    42
    ```
  
    Reference: [UUIDv4](https://sourcey-peertube.pages.dev/api-rest-reference/models/uuidv4.md); Type: UUIDv4, uuid
    
    minLength: 36
    
    maxLength: 36
    
    pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    
    Example:
    
    ```json
    "9c9de5e8-0a1e-484a-b099-e80766180a6d"
    ```
  
    Reference: [shortUUID](https://sourcey-peertube.pages.dev/api-rest-reference/models/shortuuid.md); Type: shortUUID
    
    translation of a uuid v4 with a bigger alphabet to have a shorter uuid
    
    Example:
    
    ```json
    "2y84q2MQUMWPbiEcxNXMgC"
    ```

- `videoFileIds` (query, Array<integer>, required) - streams of video files to mux in the output
  Type: Array<integer>
  
  Items:
    Type: integer

- `videoFileToken` (query, string, optional) - Video file token [generated](#operation/requestVideoToken) by PeerTube so you don't need to provide an OAuth token in the request header.
  Type: string

Responses:

- 200: successful operation

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/download/videos/generate/42?videoFileIds=0'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/download/videos/generate/42?videoFileIds=0', {
  method: 'GET',
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get('https://peertube2.cpy.re/download/videos/generate/42?videoFileIds=0')
print(response.text)
```
