This repository was archived by the owner on Sep 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSettings.cs
More file actions
371 lines (307 loc) · 11.2 KB
/
Copy pathSettings.cs
File metadata and controls
371 lines (307 loc) · 11.2 KB
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
using System;
using Windows.Storage;
namespace ValleyTube
{
public static class Settings
{
private static bool _isDash;
private static bool _isSponserBlock;
private static bool _isAutoplayEnabled;
public static string _selectedQuality;
private static bool _screenTimeOut;
private static bool _doubleTapToSkip;
private static bool _showSponserSkipMessage;
private static bool _useFormatStreamForDownloads;
private static string _invidiousInstance = "https://inv.nadeko.net";
private static string _invidiousInstanceComments = "https://inv.nadeko.net";
private static string _returnDislikeInstance = "https://returnyoutubedislikeapi.com";
private static string _SponserBlockInstance = "https://sponsor.ajay.app";
private static string accessToken = "";
private static string _clientId = "";
private static string _clientSecret = ""; // shhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
private static string _youTubeAPIKey = "";
public static string InnerTubeAPIKey = "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8";
private static string _scope = "https://www.googleapis.com/auth/youtube.force-ssl";
public static string InnerTubeBase = "https://www.youtube.com/youtubei/v1/player?key={InnerTubeAPIKey}";
private static string _redirectUri = "http://localhost";
// dumbass devs MAKE SURE to remove your own before release
public static string version = "Beta 1.4.0";
public const int MaxHistorySize = 500;
private static int _recommendVideoLimit = 25;
private static int _howManySubbedVideosToFetch = 5;
public static bool isDash
{
get { return _isDash; }
set
{
_isDash = value;
SaveSetting("isDash", value);
}
}
public static bool isSponserBlock
{
get { return _isSponserBlock; }
set
{
_isSponserBlock = value;
SaveSetting("isSponserBlock", value);
}
}
public static string AccessToken
{
get { return accessToken; }
set
{
accessToken = value;
SaveSetting("AccessToken", value);
}
}
public static string ClientId
{
get { return _clientId; }
set
{
_clientId = value;
SaveSetting("ClientId", value);
}
}
public static string Scope
{
get { return _scope; }
set
{
_scope = value;
SaveSetting("Scope", value);
}
}
public static string ClientSecret
{
get { return _clientSecret; }
set
{
_clientSecret = value;
SaveSetting("ClientSecret", value);
}
}
public static string RedirectUri
{
get { return _redirectUri; }
set
{
_redirectUri = value;
SaveSetting("RedirectUri", value);
}
}
public static bool showSponserSkipMessage
{
get { return _showSponserSkipMessage; }
set
{
_showSponserSkipMessage = value;
SaveSetting("showSponserSkipMessage", value);
}
}
public static bool useFormatStreamForDownloads
{
get { return _useFormatStreamForDownloads; }
set
{
_useFormatStreamForDownloads = value;
SaveSetting("useFormatStreamForDownloads", value);
}
}
public static bool doubleTapToSkip
{
get { return _doubleTapToSkip; }
set
{
_doubleTapToSkip = value;
SaveSetting("doubleTapToSkip", value);
}
}
public static bool IsAutoplayEnabled
{
get { return _isAutoplayEnabled; }
set
{
_isAutoplayEnabled = value;
SaveSetting("IsAutoplayEnabled", value);
}
}
public static bool ScreenTimeOut
{
get { return _screenTimeOut; }
set
{
_screenTimeOut = value;
SaveSetting("IsScreenTimeoutEnabled", value);
}
}
public static string SelectedQuality
{
get { return _selectedQuality; }
set
{
_selectedQuality = value;
SaveSetting("SelectedQuality", value);
}
}
public static string YouTubeAPIKey
{
get { return _youTubeAPIKey; }
set
{
_youTubeAPIKey = value;
SaveSetting("YouTubeAPIKey", value);
}
}
public static string InvidiousInstance
{
get { return _invidiousInstance; }
set
{
_invidiousInstance = value;
SaveSetting("InvidiousInstance", value);
}
}
public static string InvidiousInstanceComments
{
get { return _invidiousInstanceComments; }
set
{
_invidiousInstanceComments = value;
SaveSetting("InvidiousInstanceComments", value);
}
}
public static string ReturnDislikeInstance
{
get { return _returnDislikeInstance; }
set
{
_returnDislikeInstance = value;
SaveSetting("ReturnDislikeInstance", value);
}
}
public static string SponserBlockInstance
{
get { return _SponserBlockInstance; }
set
{
_SponserBlockInstance = value;
SaveSetting("SponserBlockInstance", value);
}
}
public static int RecommendVideoLimit
{
get { return _recommendVideoLimit; }
set
{
_recommendVideoLimit = value;
SaveSetting("RecommendVideoLimit", value);
}
}
public static int HowManySubbedVideosToFetch
{
get { return _howManySubbedVideosToFetch; }
set
{
_recommendVideoLimit = value;
SaveSetting("HowManySubbedVideosToFetch", value);
}
}
public static void SaveSetting(string key, object value)
{
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
localSettings.Values[key] = value;
}
public static void ClearSettings()
{
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
localSettings.Values.Clear();
}
public static void LoadSettings()
{
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
if (localSettings.Values.ContainsKey("isDash"))
{
_isDash = (bool)localSettings.Values["isDash"];
}
if (localSettings.Values.ContainsKey("IsAutoplayEnabled"))
{
_isAutoplayEnabled = (bool)localSettings.Values["IsAutoplayEnabled"];
}
if (localSettings.Values.ContainsKey("IsScreenTimeoutEnabled"))
{
_screenTimeOut = (bool)localSettings.Values["IsScreenTimeoutEnabled"];
}
if (localSettings.Values.ContainsKey("SelectedQuality"))
{
_selectedQuality = (string)localSettings.Values["SelectedQuality"];
}
if (localSettings.Values.ContainsKey("isSponserBlock"))
{
_isSponserBlock = (bool)localSettings.Values["isSponserBlock"];
}
if (localSettings.Values.ContainsKey("useFormatStreamForDownloads"))
{
_useFormatStreamForDownloads = (bool)localSettings.Values["useFormatStreamForDownloads"];
}
if (localSettings.Values.ContainsKey("showSponserSkipMessage"))
{
_showSponserSkipMessage = (bool)localSettings.Values["showSponserSkipMessage"];
}
if (localSettings.Values.ContainsKey("doubleTapToSkip"))
{
_doubleTapToSkip = (bool)localSettings.Values["doubleTapToSkip"];
}
if (localSettings.Values.ContainsKey("InvidiousInstance"))
{
_invidiousInstance = (string)localSettings.Values["InvidiousInstance"];
}
if (localSettings.Values.ContainsKey("SponserBlockInstance"))
{
_SponserBlockInstance = (string)localSettings.Values["SponserBlockInstance"];
}
if (localSettings.Values.ContainsKey("InvidiousInstanceComments"))
{
_invidiousInstanceComments = (string)localSettings.Values["InvidiousInstanceComments"];
}
if (localSettings.Values.ContainsKey("ReturnDislikeInstance"))
{
_returnDislikeInstance = (string)localSettings.Values["ReturnDislikeInstance"];
}
if (localSettings.Values.ContainsKey("RecommendVideoLimit"))
{
_recommendVideoLimit = (int)localSettings.Values["RecommendVideoLimit"];
}
if (localSettings.Values.ContainsKey("HowManySubbedVideosToFetch"))
{
_howManySubbedVideosToFetch = (int)localSettings.Values["HowManySubbedVideosToFetch"];
}
if (localSettings.Values.ContainsKey("YouTubeAPIKey"))
{
_youTubeAPIKey = (string)localSettings.Values["YouTubeAPIKey"];
}
if (localSettings.Values.ContainsKey("AccessToken"))
{
accessToken = (string)localSettings.Values["AccessToken"];
}
if (localSettings.Values.ContainsKey("ClientId"))
{
_clientId = (string)localSettings.Values["ClientId"];
}
if (localSettings.Values.ContainsKey("ClientSecret"))
{
_clientSecret = (string)localSettings.Values["ClientSecret"];
}
if (localSettings.Values.ContainsKey("RedirectUri"))
{
_redirectUri = (string)localSettings.Values["RedirectUri"];
}
if (localSettings.Values.ContainsKey("Scope"))
{
_scope = (string)localSettings.Values["Scope"];
}
}
}
}