Client API Endpoints only reachable by EZPPClient

This commit is contained in:
HorizonCode 2021-05-25 18:29:54 +02:00
parent dca56f330f
commit 69ca2f91b9
2 changed files with 3 additions and 0 deletions

View File

@ -24,6 +24,7 @@ namespace EZPPClient_Installer
using (WebClient wc = new WebClient()) using (WebClient wc = new WebClient())
{ {
wc.Headers.Add("user-agent", "EZPPClientInstaller");
var data = wc.DownloadString("https://new.ez-pp.farm/ezppclient?list"); var data = wc.DownloadString("https://new.ez-pp.farm/ezppclient?list");
string[] dataList = data.Split('\n'); string[] dataList = data.Split('\n');
foreach (string datastring in dataList) foreach (string datastring in dataList)
@ -109,6 +110,7 @@ namespace EZPPClient_Installer
{ {
using (WebClient wc = new WebClient()) using (WebClient wc = new WebClient())
{ {
wc.Headers.Add("user-agent", "EZPPClientInstaller");
wc.DownloadProgressChanged += (sender, value) => MainWindow.updateProgress(filename + " - " + value.ProgressPercentage + "% - " + Math.Round((value.BytesReceived / 1024000D), 2) + "MB/" + Math.Round((value.TotalBytesToReceive / 1024000D), 2) + "MB", value.ProgressPercentage); wc.DownloadProgressChanged += (sender, value) => MainWindow.updateProgress(filename + " - " + value.ProgressPercentage + "% - " + Math.Round((value.BytesReceived / 1024000D), 2) + "MB/" + Math.Round((value.TotalBytesToReceive / 1024000D), 2) + "MB", value.ProgressPercentage);
await wc.DownloadFileTaskAsync(@"https://new.ez-pp.farm/ezppclient?file=" + filename, path + @"\" + filename); await wc.DownloadFileTaskAsync(@"https://new.ez-pp.farm/ezppclient?file=" + filename, path + @"\" + filename);
} }

View File

@ -110,6 +110,7 @@ namespace EZPPClient_Installer
{ {
using (WebClient client = new WebClient()) using (WebClient client = new WebClient())
{ {
client.Headers.Add("user-agent", "EZPPClientInstaller");
string newVersionString = client.DownloadString("https://new.ez-pp.farm/ezppclient?version"); string newVersionString = client.DownloadString("https://new.ez-pp.farm/ezppclient?version");
double ver = 0; double ver = 0;
try try