twitch-dl/twitchdl/entities.py

54 lines
859 B
Python
Raw Permalink Normal View History

2024-03-23 09:50:42 +00:00
from dataclasses import dataclass
2024-04-01 08:52:41 +00:00
from datetime import datetime
2024-03-30 06:32:12 +00:00
from typing import Any
2024-03-23 09:50:42 +00:00
@dataclass
class DownloadOptions:
auth_token: str | None
chapter: int | None
2024-03-29 07:24:45 +00:00
concat: bool
2024-03-23 09:50:42 +00:00
dry_run: bool
end: int | None
format: str
keep: bool
no_join: bool
overwrite: bool
output: str
quality: str | None
rate_limit: str | None
start: int | None
max_workers: int
2024-03-30 06:32:12 +00:00
# Type for annotating decoded JSON
# TODO: make data classes for common structs
Data = dict[str, Any]
2024-04-01 08:52:41 +00:00
@dataclass
class User:
login: str
display_name: str
@dataclass
class Game:
name: str
@dataclass
class Video:
id: str
title: str
description: str
published_at: datetime
broadcast_type: str
length_seconds: int
game: Game
creator: User
@dataclass
class AccessToken:
signature: str
value: str