Return Types
LinkResult
Bases: PrettyPrintDataClass
Result for single file link.
This class represents the result type returned by the resolve() method when processing a single file link.
Attributes:
Name | Type | Description |
---|---|---|
url |
str
|
The direct download URL for the file. |
filename |
str
|
The original filename of the file. |
mime_type |
str
|
The MIME type of the file (e.g., "video/mp4"). |
size |
int
|
Size of the file in bytes. |
headers |
dict
|
Custom headers needed for the download (e.g., {"Authorization": "Bearer token"}). |
Example
FolderResult
Bases: PrettyPrintDataClass
Result for folder/multi-file link.
This class represents the result type returned by the resolve() method when processing a folder or multi-file link.
Attributes:
Name | Type | Description |
---|---|---|
title |
str
|
The name of the folder. |
contents |
list[FileItem]
|
List of files contained in the folder. |
total_size |
int
|
Total size of all files in bytes. |
headers |
dict
|
Custom headers needed for downloads. |
Example
{
"title": "Folder Name",
"contents": [
{
"url": "direct_download_url_1",
"filename": "file1.pdf",
"mime_type": "application/pdf",
"size": 1234567,
"path": "subfolder/file1.pdf"
},
{
"url": "direct_download_url_2",
"filename": "file2.jpg",
"mime_type": "image/jpeg",
"size": 987654,
"path": "file2.jpg"
}
],
"total_size": 2222221, # Total size of all files
"headers": {"Authorization": "Bearer token"}
}
FileItem
Bases: PrettyPrintDataClass
Individual file in a folder.
This class represents a single file within a folder result.
Attributes:
Name | Type | Description |
---|---|---|
url |
str
|
The direct download URL for the file. |
filename |
str
|
The name of the file. |
mime_type |
str
|
The MIME type of the file. |
size |
int
|
Size of the file in bytes. |
path |
str
|
Relative path of the file within the folder structure. |