forked from XiovV/Golty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstructs.go
209 lines (197 loc) · 6.97 KB
/
structs.go
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package main
import "sync"
type TargetMetadata struct {
PlaylistUploader string `json:"playlist_uploader"`
UploadDate string `json:"upload_date"`
Extractor string `json:"extractor"`
Series interface{} `json:"series"`
Format string `json:"format"`
Vbr interface{} `json:"vbr"`
Chapters interface{} `json:"chapters"`
Height int `json:"height"`
LikeCount int `json:"like_count"`
Duration int `json:"duration"`
Fulltitle string `json:"fulltitle"`
PlaylistIndex int `json:"playlist_index"`
Album string `json:"album"`
ViewCount int `json:"view_count"`
Playlist string `json:"playlist"`
Title string `json:"title"`
Filename string `json:"_filename"`
Creator string `json:"creator"`
Ext string `json:"ext"`
ID string `json:"id"`
DislikeCount int `json:"dislike_count"`
PlaylistID string `json:"playlist_id"`
Abr int `json:"abr"`
UploaderURL string `json:"uploader_url"`
Categories []string `json:"categories"`
Fps int `json:"fps"`
StretchedRatio interface{} `json:"stretched_ratio"`
SeasonNumber interface{} `json:"season_number"`
Annotations interface{} `json:"annotations"`
WebpageURLBasename string `json:"webpage_url_basename"`
Acodec string `json:"acodec"`
DisplayID string `json:"display_id"`
RequestedFormats []struct {
Asr interface{} `json:"asr"`
Tbr float64 `json:"tbr"`
Protocol string `json:"protocol"`
Format string `json:"format"`
URL string `json:"url"`
Vcodec string `json:"vcodec"`
FormatNote string `json:"format_note"`
Height int `json:"height"`
DownloaderOptions struct {
HTTPChunkSize int `json:"http_chunk_size"`
} `json:"downloader_options"`
Width int `json:"width"`
Ext string `json:"ext"`
Filesize int `json:"filesize"`
Fps int `json:"fps"`
FormatID string `json:"format_id"`
PlayerURL string `json:"player_url"`
HTTPHeaders struct {
AcceptCharset string `json:"Accept-Charset"`
AcceptLanguage string `json:"Accept-Language"`
AcceptEncoding string `json:"Accept-Encoding"`
Accept string `json:"Accept"`
UserAgent string `json:"User-Agent"`
} `json:"http_headers"`
Acodec string `json:"acodec"`
Abr int `json:"abr,omitempty"`
} `json:"requested_formats"`
AutomaticCaptions struct {
} `json:"automatic_captions"`
Description string `json:"description"`
Tags []string `json:"tags"`
Track string `json:"track"`
RequestedSubtitles interface{} `json:"requested_subtitles"`
StartTime interface{} `json:"start_time"`
AverageRating float64 `json:"average_rating"`
Uploader string `json:"uploader"`
FormatID string `json:"format_id"`
EpisodeNumber interface{} `json:"episode_number"`
UploaderID string `json:"uploader_id"`
Subtitles struct {
} `json:"subtitles"`
PlaylistTitle string `json:"playlist_title"`
Width int `json:"width"`
Thumbnails []struct {
URL string `json:"url"`
ID string `json:"id"`
} `json:"thumbnails"`
License interface{} `json:"license"`
Artist string `json:"artist"`
ExtractorKey string `json:"extractor_key"`
ReleaseDate interface{} `json:"release_date"`
AltTitle string `json:"alt_title"`
Thumbnail string `json:"thumbnail"`
ChannelID string `json:"channel_id"`
IsLive interface{} `json:"is_live"`
ReleaseYear interface{} `json:"release_year"`
EndTime interface{} `json:"end_time"`
WebpageURL string `json:"webpage_url"`
Formats []struct {
Asr int `json:"asr"`
Tbr float64 `json:"tbr"`
Protocol string `json:"protocol"`
Format string `json:"format"`
URL string `json:"url"`
Vcodec string `json:"vcodec"`
FormatNote string `json:"format_note"`
Abr int `json:"abr,omitempty"`
PlayerURL string `json:"player_url"`
DownloaderOptions struct {
HTTPChunkSize int `json:"http_chunk_size"`
} `json:"downloader_options,omitempty"`
Width interface{} `json:"width"`
Ext string `json:"ext"`
Filesize int `json:"filesize"`
Fps interface{} `json:"fps"`
FormatID string `json:"format_id"`
Height interface{} `json:"height"`
HTTPHeaders struct {
AcceptCharset string `json:"Accept-Charset"`
AcceptLanguage string `json:"Accept-Language"`
AcceptEncoding string `json:"Accept-Encoding"`
Accept string `json:"Accept"`
UserAgent string `json:"User-Agent"`
} `json:"http_headers"`
Acodec string `json:"acodec"`
Container string `json:"container,omitempty"`
} `json:"formats"`
PlaylistUploaderID string `json:"playlist_uploader_id"`
ChannelURL string `json:"channel_url"`
Resolution interface{} `json:"resolution"`
Vcodec string `json:"vcodec"`
NEntries int `json:"n_entries"`
AgeLimit int `json:"age_limit"`
}
type DownloadTarget struct {
URL string
LatestDownloaded string
DownloadMode string
Name string
PreferredExtensionForAudio string
PreferredExtensionForVideo string
DownloadHistory []string
LastChecked string
CheckingInterval string
Type string
DownloadPath string
}
type GetTargetPayload struct {
Type string
}
type DeleteTargetPayload struct {
URL string
Type string
}
type CheckingIntervalPayload struct {
CheckingInterval string
Type string
}
type AddTargetPayload struct {
URL string
DownloadMode string
FileExtension string
DownloadQuality string
DownloadEntire bool
CheckingInterval string
DownloadPath string
Type string
}
type DownloadVideoPayload struct {
VideoURL string
DownloadMode string
FileExtension string
DownloadQuality string
DownloadPath string
}
type Response struct {
Type string
Key string
Message string
}
type Video struct {
VideoID string
DownloadMode string
DownloadQuality string
FileExtension string
}
type YTDLCommand struct {
TargetType string
Binary string
FirstFlag string
FirstFlagArg string
FileType string
Output string
Target string
}
type Database struct {
*sync.RWMutex
file string
contents []DownloadTarget
lookup map[string]*DownloadTarget
}