Skip to content

Commit

Permalink
Added fileditch.com, nekofile.eu.org, catbox.moe; Fixed multiup.org #77
Browse files Browse the repository at this point in the history
  • Loading branch information
zenden2k committed Jan 13, 2024
1 parent f0ecade commit 0c5cf8e
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 9 deletions.
24 changes: 24 additions & 0 deletions Data/Scripts/fileditch.nut
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
function UploadFile(FileName, options) {
local name = ExtractFileName(FileName);
local mime = GetFileMimeType(name);
nm.setUrl("https://up1.fileditch.com/upload.php");
nm.addQueryParamFile("files[]", FileName, name, mime);
nm.doUploadMultipartData();

if (nm.responseCode() == 200) {
local sJSON = nm.responseBody();
local t = ParseJSON(sJSON);
if (t != null) {
if ("success" in t && t.success == true) {
options.setDirectUrl(t.files[0].url);
return 1;
}
}

WriteLog("error", "[fileditch.com] Cannot obtain file URL from server's response.");
} else {
WriteLog("error", "[fileditch.com] Upload failed. Response code: " + nm.responseCode());
}

return 0;
}
1 change: 0 additions & 1 deletion Data/Scripts/userscloud.nut
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function UploadFile(fileName, options) {
}
}

return 1;
} else {
WriteLog("error", "[userscloud.com] Status: " + t.file_status);
}
Expand Down
21 changes: 19 additions & 2 deletions Data/servers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@
/>
<Action
Type="upload"
Url="http://$(Server).multiup.org/upload/index.php"
Url="https://$(Server).multiup.org/upload/index.php"
PostParams="files[]=%filename%;"
RegExp="&quot;name&quot;:&quot;([^&quot;]+)&quot;[\s\S]*?&quot;hash&quot;:&quot;([^&quot;]+)&quot;"
AssignVars="Name:0;Hash:1;"
/>
</Actions>
<Result DownloadUrlTemplate="http://www.multiup.org/download/$(Hash)/$(Name)" />
<Result DownloadUrlTemplate="https://www.multiup.org/download/$(Hash)/$(Name)" />
</Server>
<!-- /Thanks to Alex_Qwerty -->
<!--
Expand Down Expand Up @@ -309,6 +309,23 @@
</Actions>
<Result ImageUrlTemplate="stub" ThumbUrlTemplate="stub" DownloadUrlTemplate="stub"/>
</Server>
<Server Name="nekofile.eu.org" FileHost="1">
<Actions>
<Action Type="upload" Url="https://nekofile.eu.org" PostParams="file=%filename%" RegExp="https://nekofile.eu.org/(\w+)" AssignVars="Link:0"/>
</Actions>
<Result ImageUrlTemplate="https://nekofile.eu.org/$(Link)"/>
</Server>
<Server Name="catbox.moe" Authorize="1" FileHost="1" MaxFileSize="200000000" PasswordLabel="userhash">
<Actions>
<Action Type="upload" Url="https://catbox.moe/user/api.php" PostParams="reqtype=fileupload;userhash=$(_PASSWORD);fileToUpload=%filename%;" RegExp="^(.+)$" AssignVars="UploadedUrl:0;"/>
</Actions>
<Result ImageUrlTemplate="$(UploadedUrl)" />
</Server>
<Server Name="fileditch.com" FileHost="1" Plugin="fileditch">
<Actions>
</Actions>
<Result ImageUrlTemplate="stub" />
</Server>
<!-- 429 Too Many Requests
<Server Name="pasteboard.co" MaxThreads="1">
<Actions>
Expand Down
2 changes: 1 addition & 1 deletion Dist/DocGen/mainpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Squirrel is a high level imperative, object-oriented programming language, designed to be a light-weight scripting language that fits in the size, memory bandwidth, and real-time requirements of applications like video games.</p>
<p>
<a href="http://www.squirrel-lang.org/doc/squirrel3.html" target="_blank">Squirrel 3.0 reference manual</a><br>
<a href="http://www.squirrel-lang.org/doc/sqstdlib3.html" target="_blank">Squirrel 3.0 Standard Libraries manual</a>
<a href="http://www.squirrel-lang.org/doc/sqstdlib3.pdf" target="_blank">Squirrel 3.0 Standard Libraries manual (PDF)</a>
<p>Scripts should be saved in utf-8 encoding in files with <code>.nut</code> extension and placed in the Data/Scripts directory.
<hr/>
Expand Down
9 changes: 4 additions & 5 deletions Source/Gui/Dialogs/WizardDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
#include "Core/Network/NetworkClientFactory.h"
#include "Gui/Components/NewStyleFolderDialog.h"
#include "statusdlg.h"
#include "Core/Video/VideoUtils.h"
#include "ServerListTool/ServersCheckerDlg.h"

using namespace Gdiplus;
Expand Down Expand Up @@ -1716,7 +1715,7 @@ bool CWizardDlg::funcLastRegionScreenshot() {

bool CWizardDlg::funcAddFolder() {

const DWORD kCheckboxId = 2000;
constexpr DWORD kCheckboxId = 2000;
CNewStyleFolderDialog dlg(m_hWnd, CString(), TR("Choose folder"), true);
dlg.AddCheckbox(kCheckboxId, TR("Including subdirectories"), Settings.ParseSubDirs);
if (dlg.DoModal(m_hWnd) == IDOK) {
Expand Down Expand Up @@ -1748,12 +1747,12 @@ void CWizardDlg::CloseWizard()
bool CWizardDlg::RegisterLocalHotkeys() {
m_hotkeys = Settings.Hotkeys;
int n = m_hotkeys.size();
constexpr auto PRDEFINED_ACCEL_COUNT = 2;
auto accels = std::make_unique<ACCEL[]>(n + PRDEFINED_ACCEL_COUNT);
constexpr auto PREDEFINED_ACCEL_COUNT = 2;
auto accels = std::make_unique<ACCEL[]>(n + PREDEFINED_ACCEL_COUNT);
accels[0] = {FVIRTKEY, VK_F1, IDC_DOCUMENTATION};
accels[1] = {FVIRTKEY | FCONTROL | FSHIFT, 'L', IDC_SHOWLOG};

int j = PRDEFINED_ACCEL_COUNT;
int j = PREDEFINED_ACCEL_COUNT;
for (int i = 0; i < n; i++) {
if (!m_hotkeys[i].localKey.keyCode) {
continue;
Expand Down

0 comments on commit 0c5cf8e

Please sign in to comment.