Skip to content

Commit

Permalink
- Fix GoFile.io upload
Browse files Browse the repository at this point in the history
  • Loading branch information
KoalaBear84 committed Jun 27, 2024
1 parent c2cc77d commit b5347fc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/OpenDirectoryDownloader/FileUpload/GoFileIo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OpenDirectoryDownloader.Models;

Expand All @@ -17,7 +17,7 @@ public async Task<IFileUploadSiteFile> UploadFile(HttpClient httpClient, string
{
try
{
string jsonServer = await httpClient.GetStringAsync("https://apiv2.gofile.io/getServer");
string jsonServer = await httpClient.GetStringAsync("https://api.gofile.io/servers");

JObject result = JObject.Parse(jsonServer);

Expand All @@ -26,7 +26,8 @@ public async Task<IFileUploadSiteFile> UploadFile(HttpClient httpClient, string
throw new Exception("GoFile.io error, probably in maintenance");
}

string server = result.SelectToken("data.server").Value<string>();
string server = result.SelectToken("data.servers").First()["name"].Value<string>();

using FileStream fileStream = new(path, FileMode.Open);
using StreamContent streamContent = new(fileStream);

Expand Down

0 comments on commit b5347fc

Please sign in to comment.