Fix max_res and user JSON serialization
This commit is contained in:
parent
2d25012600
commit
0bd40a67cb
|
@ -19,8 +19,10 @@ class HttpClient:
|
|||
resp.raise_for_status()
|
||||
|
||||
def register(self) -> None:
|
||||
user = User(username=self.auth.username, password=self.auth.password)
|
||||
resp = requests.post(url=f'{self.base_url}/fetch', json=user)
|
||||
resp = requests.post(url=f'{self.base_url}/register', json={
|
||||
'username': self.auth.username,
|
||||
'password': self.auth.password,
|
||||
})
|
||||
resp.raise_for_status()
|
||||
|
||||
def subscribe_to_channel(self, channel_id: str) -> None:
|
||||
|
|
|
@ -9,14 +9,14 @@ class Configuration:
|
|||
username: str
|
||||
password: str
|
||||
api_url: str = 'https://ytrssil.theedgeofrage.com'
|
||||
max_res: Literal['480', '720', '1080', '1440', '2160'] = '1440'
|
||||
max_resolution: Literal['480', '720', '1080', '1440', '2160'] = '1440'
|
||||
|
||||
@property
|
||||
def mpv_options(self) -> list[str]:
|
||||
return [
|
||||
'--no-terminal',
|
||||
f'--ytdl-format=bestvideo[height<=?{self.max_res}]+bestaudio/best',
|
||||
]
|
||||
return ['--no-terminal', (
|
||||
'--ytdl-format=bestvideo[height<=?'
|
||||
f'{self.max_resolution}]+bestaudio/best'
|
||||
)]
|
||||
|
||||
|
||||
def load_config() -> Configuration:
|
||||
|
|
Loading…
Reference in New Issue