forked from immisterio/jacred-fdb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAppInit.cs
134 lines (85 loc) · 3.73 KB
/
AppInit.cs
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
using JacRed.Models;
using JacRed.Models.AppConf;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
namespace JacRed
{
public class AppInit
{
#region AppInit
static (AppInit, DateTime) cacheconf = default;
public static AppInit conf
{
get
{
if (cacheconf.Item1 == null)
{
if (!File.Exists("init.conf"))
return new AppInit();
}
var lastWriteTime = File.GetLastWriteTime("init.conf");
if (cacheconf.Item2 != lastWriteTime)
{
cacheconf.Item1 = JsonConvert.DeserializeObject<AppInit>(File.ReadAllText("init.conf"));
cacheconf.Item2 = lastWriteTime;
}
return cacheconf.Item1;
}
}
#endregion
public string listenip = "any";
public int listenport = 9117;
public string apikey = null;
public bool mergeduplicates = true;
public bool mergenumduplicates = true;
public bool openstats = true;
public bool opensync = true;
public bool opensync_v1 = false;
public bool tracks = false;
public bool web = true;
/// <summary>
/// 0 - все
/// 1 - день, месяц
/// </summary>
public int tracksmod = 0;
public int tracksdelay = 20_000;
public string[] tsuri = new string[] { "http://127.0.0.1:8090" };
public bool log = false;
public string syncapi = null;
public string[] synctrackers = null;
public string[] disable_trackers = new string[] { "hdrezka", "anifilm" };
public bool syncsport = true;
public bool syncspidr = true;
public int maxreadfile = 200;
public Evercache evercache = new Evercache() { enable = true, validHour = 1, maxOpenWriteTask = 2000, dropCacheTake = 200 };
public int fdbPathLevels = 2;
public int timeStatsUpdate = 90; // минут
public int timeSync = 60; // минут
public TrackerSettings Rutor = new TrackerSettings("http://rutor.info");
public TrackerSettings Megapeer = new TrackerSettings("http://megapeer.vip");
public TrackerSettings TorrentBy = new TrackerSettings("https://torrent.by");
public TrackerSettings Kinozal = new TrackerSettings("https://kinozal.tv");
public TrackerSettings NNMClub = new TrackerSettings("https://nnmclub.to");
public TrackerSettings Bitru = new TrackerSettings("https://bitru.org");
public TrackerSettings Toloka = new TrackerSettings("https://toloka.to");
public TrackerSettings Rutracker = new TrackerSettings("https://rutracker.org");
public TrackerSettings Selezen = new TrackerSettings("https://open.selezen.org");
public TrackerSettings Anilibria = new TrackerSettings("https://api.anilibria.tv");
public TrackerSettings Animelayer = new TrackerSettings("http://animelayer.ru");
public TrackerSettings Anifilm = new TrackerSettings("https://anifilm.net");
public TrackerSettings Rezka = new TrackerSettings("https://rezka.cc");
public TrackerSettings Baibako = new TrackerSettings("http://baibako.tv");
public TrackerSettings Lostfilm = new TrackerSettings("https://www.lostfilm.tv");
public ProxySettings proxy = new ProxySettings();
public List<ProxySettings> globalproxy = new List<ProxySettings>()
{
new ProxySettings()
{
pattern = "\\.onion",
list = new List<string>() { "socks5://127.0.0.1:9050" }
}
};
}
}