File size: 1,013 Bytes
c0e9d84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#  Copyright (c) 2025 AshokShau
#  Licensed under the GNU AGPL v3.0: https://www.gnu.org/licenses/agpl-3.0.html
#  Part of the TgMusicBot project. All rights reserved where applicable.

from pathlib import Path
from typing import Union

from pydantic import BaseModel


class ChannelPlay(BaseModel):
    chat_id: int
    is_channel: bool


class CachedTrack(BaseModel):
    url: str
    name: str
    artist: str
    loop: int
    user: str
    file_path: str | Path
    thumbnail: str
    track_id: str
    duration: int = 0
    is_video: bool
    platform: str
    channel: ChannelPlay


class TrackInfo(BaseModel):
    url: str
    cdnurl: str
    key: str
    name: str
    artist: str
    album: str
    tc: str
    cover: str
    lyrics: str
    duration: int
    year: int
    platform: str


class MusicTrack(BaseModel):
    url: str
    name: str
    artist: str
    id: str
    year: int
    cover: str
    duration: int
    platform: str


class PlatformTracks(BaseModel):
    tracks: list[MusicTrack]