Skip to content

Commit 015ab21

Browse files
committed
Fixed file format check, fixed upload on '8upload.com', 'cloud.mail.ru'
* Fix current server type to ensure that current server is visible in server list popup
1 parent 5ff075a commit 015ab21

File tree

22 files changed

+160
-298
lines changed

22 files changed

+160
-298
lines changed

Data/Scripts/8upload.nut

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ function UploadFile(pathToFile, options) {
7878
local task = options.getTask().getFileTask();
7979

8080
// Step 1: Upload file to 8upload.com
81-
nm.setUrl(BASE_URL + "/upload/sl/");
82-
nm.addQueryParamFile("upload", pathToFile, task.getDisplayName(), GetFileMimeType(pathToFile));
81+
nm.setUrl(BASE_URL + "/upload/mt/");
82+
nm.addQueryParamFile("upload[]", pathToFile, task.getDisplayName(), GetFileMimeType(pathToFile));
8383
nm.doUploadMultipartData();
8484

8585
// Parse JSON response even if response code is not 200
8686
local uploadResponse = ParseJSON(nm.responseBody());
8787

88-
if (uploadResponse == "") {
88+
if (uploadResponse == "" || uploadResponse == null) {
8989
_PrintError(null, "Failed to get upload path from response");
9090
return ResultCode.Failure;
9191
}

Data/Scripts/cloud.mail.ru.nut

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Cloud.mail.ru Upload API
12
if(ServerParams.getParam("folder") == "") {
23
ServerParams.setParam("folder", "Screenshots") ;
34
}
@@ -168,6 +169,14 @@ function _HexToBytes(hex) {
168169
return res;
169170
}
170171

172+
function _TrimStr(str) {
173+
local i = str.len() - 1;
174+
while (i >= 0 && str[i] == 0) {
175+
i--;
176+
}
177+
return str.slice(0, i+1);
178+
}
179+
171180
function _SendMetaRequest(nc, url, remoteFileName, hashUpper, size, create) {
172181
nc.setUrl(url);
173182
local vec = "";
@@ -236,7 +245,7 @@ function UploadFile(FileName, options) {
236245
local len = data[0];
237246
local str = data.slice(1, len);
238247
local len2 = data[len+1];
239-
local shortLink = data.slice(len+2, len+2+len2);
248+
local shortLink = _TrimStr(data.slice(len+2, len+2+len2));
240249

241250
nm.enableResponseCodeChecking(false);
242251
nm.doGet(uServer + "info/" + fileHash + "?client_id=cloud-win&token="+token);

Data/servers.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,10 @@
241241
</Actions>
242242
<Result ImageUrlTemplate="stub" DownloadUrlTemplate="stub" ThumbUrlTemplate="stub"/>
243243
</Server>
244-
<Server Name="sendspace.com" FileHost="1" Debug="0" Authorize="1" Plugin="sendspace" SupportsFolders="1" MaxFileSize="300000000" DefaultForTypes="file"
244+
<!--<Server Name="sendspace.com" FileHost="1" Debug="0" Authorize="1" Plugin="sendspace" SupportsFolders="1" MaxFileSize="300000000" DefaultForTypes="file"
245245
WebsiteUrl="https://www.sendspace.com" RegistrationUrl="https://www.sendspace.com/register.html">
246246
<Result DownloadUrlTemplate="stub" ImageUrlTemplate="stub" ThumbUrlTemplate="stub"/>
247-
</Server>
247+
</Server>-->
248248
<!-- Blocked ?-->
249249
<Server Name="imagevenue.com" Authorize="1" Plugin="imagevenue" WebsiteUrl="https://www.imagevenue.com" RegistrationUrl="https://www.imagevenue.com/auth/register">
250250
<Actions>

Lang/imageuploader.pot

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: imageuploader\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-08-06 15:50+0300\n"
11+
"POT-Creation-Date: 2025-08-09 15:27+0300\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -57,17 +57,6 @@ msgstr ""
5757
msgid "\"%1%\": server %2% doesn't support this type of file (%3% %4%)\n"
5858
msgstr ""
5959

60-
#: ../Source/Gui/Models/ServerListModel.cpp:253
61-
msgid "%1%days"
62-
msgstr ""
63-
64-
#: ../Source/Gui/Models/ServerListModel.cpp:232
65-
#, c-format
66-
msgid "%d day"
67-
msgid_plural "%d days"
68-
msgstr[0] ""
69-
msgstr[1] ""
70-
7160
#: ../Source/Gui/Controls/HistoryTreeControl.cpp:217
7261
#: ../Source/Gui/Dialogs/MainDlg.cpp:910
7362
#, c-format
@@ -239,7 +228,7 @@ msgstr ""
239228
msgid "Add"
240229
msgstr ""
241230

242-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:591
231+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:593
243232
#, c-format
244233
msgid "Add %s server..."
245234
msgstr ""
@@ -285,7 +274,7 @@ msgstr ""
285274
msgid "Add files..."
286275
msgstr ""
287276

288-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:593
277+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:595
289278
msgid "Add folder as new server..."
290279
msgstr ""
291280

@@ -663,7 +652,7 @@ msgstr ""
663652
msgid "Cannot load thumbnail for image."
664653
msgstr ""
665654

666-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:634
655+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:636
667656
msgid ""
668657
"Cannot open folder '%1%'.\n"
669658
"%2%"
@@ -1384,7 +1373,7 @@ msgstr ""
13841373
#: ../Source/Gui/Dialogs/ScreenRecordingSettingsPage.cpp:136
13851374
#: ../Source/Gui/Dialogs/ScreenRecordingSettingsPage.cpp:154
13861375
#: ../Source/Gui/Dialogs/SearchByImageDlg.cpp:74
1387-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:637
1376+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:639
13881377
#: ../Source/Gui/Dialogs/ServerProfileGroupSelectDialog.cpp:134
13891378
#: ../Source/Gui/Dialogs/SettingsDlg.cpp:174
13901379
#: ../Source/Gui/Dialogs/SettingsDlg.cpp:191
@@ -1786,7 +1775,7 @@ msgstr ""
17861775
msgid "Global hotkey:"
17871776
msgstr ""
17881777

1789-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:689
1778+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:691
17901779
#: ../Source/Gui/Dialogs/UploadSettings.cpp:1068
17911780
msgid "Go to signup page"
17921781
msgstr ""
@@ -2353,7 +2342,7 @@ msgstr ""
23532342
msgid "Open screenshots folder"
23542343
msgstr ""
23552344

2356-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:594
2345+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:596
23572346
msgid "Open servers folder"
23582347
msgstr ""
23592348

@@ -2362,7 +2351,7 @@ msgid "Open system connection settings"
23622351
msgstr ""
23632352

23642353
#: ../Source/Gui/Dialogs/LoginDlg.cpp:125
2365-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:686
2354+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:688
23662355
#: ../Source/Gui/Dialogs/UploadSettings.cpp:1075
23672356
msgid "Open the website"
23682357
msgstr ""
@@ -3793,7 +3782,7 @@ msgstr ""
37933782
msgid "not selected"
37943783
msgstr ""
37953784

3796-
#: ../Source/Gui/Models/ServerListModel.cpp:205
3785+
#: ../Source/Gui/Models/ServerListModel.cpp:237
37973786
msgctxt "serverlist.account"
37983787
msgid "required"
37993788
msgstr ""

Lang/locale/ar/LC_MESSAGES/imageuploader.po

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ msgid ""
33
msgstr ""
44
"Project-Id-Version: \n"
55
"Report-Msgid-Bugs-To: \n"
6-
"POT-Creation-Date: 2025-08-06 15:50+0300\n"
6+
"POT-Creation-Date: 2025-08-09 15:27+0300\n"
77
"PO-Revision-Date: 2025-03-20 05:43+0000\n"
88
"Last-Translator: Sergey Svistunov <[email protected]>\n"
99
"Language-Team: Arabic <https://hosted.weblate.org/projects/image-uploader/"
@@ -55,21 +55,6 @@ msgstr ""
5555
msgid "\"%1%\": server %2% doesn't support this type of file (%3% %4%)\n"
5656
msgstr ""
5757

58-
#: ../Source/Gui/Models/ServerListModel.cpp:253
59-
msgid "%1%days"
60-
msgstr ""
61-
62-
#: ../Source/Gui/Models/ServerListModel.cpp:232
63-
#, c-format
64-
msgid "%d day"
65-
msgid_plural "%d days"
66-
msgstr[0] ""
67-
msgstr[1] ""
68-
msgstr[2] ""
69-
msgstr[3] ""
70-
msgstr[4] ""
71-
msgstr[5] ""
72-
7358
#: ../Source/Gui/Controls/HistoryTreeControl.cpp:217
7459
#: ../Source/Gui/Dialogs/MainDlg.cpp:910
7560
#, fuzzy, c-format
@@ -263,7 +248,7 @@ msgstr ""
263248
msgid "Add"
264249
msgstr "اضافة"
265250

266-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:591
251+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:593
267252
#, fuzzy, c-format
268253
#| msgid "Add FTP server..."
269254
msgid "Add %s server..."
@@ -314,7 +299,7 @@ msgstr "اضافة مادة الى قائمة السياق في مستكشف ا
314299
msgid "Add files..."
315300
msgstr "اضافة الملفات..."
316301

317-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:593
302+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:595
318303
#, fuzzy
319304
#| msgid "Add local folder as new server..."
320305
msgid "Add folder as new server..."
@@ -711,7 +696,7 @@ msgstr ""
711696
msgid "Cannot load thumbnail for image."
712697
msgstr "تعذر رفع صورة مصغرة."
713698

714-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:634
699+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:636
715700
#, fuzzy
716701
#| msgid "Cannot copy file "
717702
msgid ""
@@ -1483,7 +1468,7 @@ msgstr "ادخل نصك:"
14831468
#: ../Source/Gui/Dialogs/ScreenRecordingSettingsPage.cpp:136
14841469
#: ../Source/Gui/Dialogs/ScreenRecordingSettingsPage.cpp:154
14851470
#: ../Source/Gui/Dialogs/SearchByImageDlg.cpp:74
1486-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:637
1471+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:639
14871472
#: ../Source/Gui/Dialogs/ServerProfileGroupSelectDialog.cpp:134
14881473
#: ../Source/Gui/Dialogs/SettingsDlg.cpp:174
14891474
#: ../Source/Gui/Dialogs/SettingsDlg.cpp:191
@@ -1898,7 +1883,7 @@ msgstr "العالمية"
18981883
msgid "Global hotkey:"
18991884
msgstr "مفتاح نشط عالمي:"
19001885

1901-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:689
1886+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:691
19021887
#: ../Source/Gui/Dialogs/UploadSettings.cpp:1068
19031888
msgid "Go to signup page"
19041889
msgstr "انتقل الى صفحة تسجيل الدخول"
@@ -2494,7 +2479,7 @@ msgstr "فتح الصورة في محرر"
24942479
msgid "Open screenshots folder"
24952480
msgstr "فتح مجلد الصور"
24962481

2497-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:594
2482+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:596
24982483
#, fuzzy
24992484
#| msgid "Open screenshots folder"
25002485
msgid "Open servers folder"
@@ -2507,7 +2492,7 @@ msgid "Open system connection settings"
25072492
msgstr "اعدادات الاتصال"
25082493

25092494
#: ../Source/Gui/Dialogs/LoginDlg.cpp:125
2510-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:686
2495+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:688
25112496
#: ../Source/Gui/Dialogs/UploadSettings.cpp:1075
25122497
#, fuzzy
25132498
#| msgid "Open in the editor"
@@ -4031,7 +4016,7 @@ msgstr "ملفات متعددة"
40314016
msgid "not selected"
40324017
msgstr "غير محدد"
40334018

4034-
#: ../Source/Gui/Models/ServerListModel.cpp:205
4019+
#: ../Source/Gui/Models/ServerListModel.cpp:237
40354020
msgctxt "serverlist.account"
40364021
msgid "required"
40374022
msgstr ""

Lang/locale/fa/LC_MESSAGES/imageuploader.po

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ msgid ""
33
msgstr ""
44
"Project-Id-Version: \n"
55
"Report-Msgid-Bugs-To: \n"
6-
"POT-Creation-Date: 2025-08-06 15:50+0300\n"
6+
"POT-Creation-Date: 2025-08-09 15:27+0300\n"
77
"PO-Revision-Date: 2025-03-20 05:43+0000\n"
88
"Last-Translator: Sergey Svistunov <[email protected]>\n"
99
"Language-Team: Persian <https://hosted.weblate.org/projects/image-uploader/"
@@ -54,17 +54,6 @@ msgstr ""
5454
msgid "\"%1%\": server %2% doesn't support this type of file (%3% %4%)\n"
5555
msgstr ""
5656

57-
#: ../Source/Gui/Models/ServerListModel.cpp:253
58-
msgid "%1%days"
59-
msgstr ""
60-
61-
#: ../Source/Gui/Models/ServerListModel.cpp:232
62-
#, c-format
63-
msgid "%d day"
64-
msgid_plural "%d days"
65-
msgstr[0] ""
66-
msgstr[1] ""
67-
6857
#: ../Source/Gui/Controls/HistoryTreeControl.cpp:217
6958
#: ../Source/Gui/Dialogs/MainDlg.cpp:910
7059
#, fuzzy, c-format
@@ -243,7 +232,7 @@ msgstr ""
243232
msgid "Add"
244233
msgstr ""
245234

246-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:591
235+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:593
247236
#, fuzzy, c-format
248237
#| msgid "Choose server..."
249238
msgid "Add %s server..."
@@ -294,7 +283,7 @@ msgstr ""
294283
msgid "Add files..."
295284
msgstr "افزودن فایل ها"
296285

297-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:593
286+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:595
298287
#, fuzzy
299288
#| msgid "Add Folder..."
300289
msgid "Add folder as new server..."
@@ -688,7 +677,7 @@ msgstr ""
688677
msgid "Cannot load thumbnail for image."
689678
msgstr "نمیتوان تصویر کوچک را برای عکس بارگیری کرد"
690679

691-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:634
680+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:636
692681
msgid ""
693682
"Cannot open folder '%1%'.\n"
694683
"%2%"
@@ -1445,7 +1434,7 @@ msgstr "متن را وارد کنید:"
14451434
#: ../Source/Gui/Dialogs/ScreenRecordingSettingsPage.cpp:136
14461435
#: ../Source/Gui/Dialogs/ScreenRecordingSettingsPage.cpp:154
14471436
#: ../Source/Gui/Dialogs/SearchByImageDlg.cpp:74
1448-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:637
1437+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:639
14491438
#: ../Source/Gui/Dialogs/ServerProfileGroupSelectDialog.cpp:134
14501439
#: ../Source/Gui/Dialogs/SettingsDlg.cpp:174
14511440
#: ../Source/Gui/Dialogs/SettingsDlg.cpp:191
@@ -1856,7 +1845,7 @@ msgstr "سراسری"
18561845
msgid "Global hotkey:"
18571846
msgstr "کلید میانبر سراسری:"
18581847

1859-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:689
1848+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:691
18601849
#: ../Source/Gui/Dialogs/UploadSettings.cpp:1068
18611850
msgid "Go to signup page"
18621851
msgstr "بروبه صفحه ثبت نام"
@@ -2444,7 +2433,7 @@ msgstr ""
24442433
msgid "Open screenshots folder"
24452434
msgstr ""
24462435

2447-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:594
2436+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:596
24482437
#, fuzzy
24492438
#| msgid "Open in folder"
24502439
msgid "Open servers folder"
@@ -2457,7 +2446,7 @@ msgid "Open system connection settings"
24572446
msgstr "تنظیمات ارتباط"
24582447

24592448
#: ../Source/Gui/Dialogs/LoginDlg.cpp:125
2460-
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:686
2449+
#: ../Source/Gui/Dialogs/ServerListPopup.cpp:688
24612450
#: ../Source/Gui/Dialogs/UploadSettings.cpp:1075
24622451
msgid "Open the website"
24632452
msgstr ""
@@ -3941,7 +3930,7 @@ msgstr "چندین فایل"
39413930
msgid "not selected"
39423931
msgstr ""
39433932

3944-
#: ../Source/Gui/Models/ServerListModel.cpp:205
3933+
#: ../Source/Gui/Models/ServerListModel.cpp:237
39453934
msgctxt "serverlist.account"
39463935
msgid "required"
39473936
msgstr ""

0 commit comments

Comments
 (0)