mirror of
https://github.com/arabianq/viking-file-python.git
synced 2026-04-28 06:21:24 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class File:
|
||||
"""
|
||||
A class representing file information.
|
||||
|
||||
Attrs:
|
||||
|
||||
- hash (str): File hash.
|
||||
- name (str): File name.
|
||||
- size (int): File size in bytes.
|
||||
- downloads (int | None): Number of downloads.
|
||||
- url (str): File URL.
|
||||
"""
|
||||
|
||||
hash: str
|
||||
name: str
|
||||
|
||||
size: int
|
||||
downloads: int | None = 0
|
||||
|
||||
@property
|
||||
def url(self) -> str:
|
||||
return f"https://vikingfile.com/f/{self.hash}"
|
||||
Reference in New Issue
Block a user