tytd/Tesses.YouTubeDownloader.Ex.../Tesses.YouTubeDownloader.Se.../Config.cs

27 lines
666 B
C#
Raw Permalink Normal View History

2022-07-06 22:59:50 +00:00
using Newtonsoft.Json;
public class TYTDConfiguration
{
public TYTDConfiguration()
{
Url = "http://127.0.0.1:3252/";
LocalFiles=Environment.CurrentDirectory;
AddComplete = true;
2022-07-06 22:59:50 +00:00
}
public string Url {get;set;}
public string LocalFiles {get;set;}
public bool AddComplete {get;set;}
2022-07-06 22:59:50 +00:00
public static TYTDConfiguration Load()
{
if(!File.Exists("proxy.json")) return new TYTDConfiguration();
var res= JsonConvert.DeserializeObject<TYTDConfiguration>(File.ReadAllText("proxy.json"));
if(res != null)
{
return res;
}
return new TYTDConfiguration();
}
}