Skip to content

Commit

Permalink
Fixed imgbox.com, disabled transfer.sh hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
zenden2k committed Apr 28, 2024
1 parent 6f7c72a commit b2f4a48
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions Data/Scripts/imgbox.nut
@@ -1,7 +1,7 @@
baseUrl <- "https://imgbox.com";
const BASE_URL = "https://imgbox.com";

function getRequiredData() {
nm.doGet(baseUrl);
nm.doGet(BASE_URL);
local ret = {cookie="",token=""};
local sBody = nm.responseBody();
if (nm.responseCode() == 200) {
Expand All @@ -24,12 +24,13 @@ function UploadFile(FileName, options) {
WriteLog("error", "Can not obtain cookie and token valuest, required by uploading process.");
return -1; //error, no cookie, no token :(
}
nm.setUrl(baseUrl+"/ajax/token/generate");
nm.setUrl(BASE_URL+"/ajax/token/generate");
nm.addQueryHeader("Accept", "application/json, text/javascript, */*; q=0.01");
nm.addQueryHeader("X-CSRF-Token", sCSRFToken);
nm.addQueryHeader("Cookie", "request_method=GET; "+sImgboxCookie);
//nm.addQueryHeader("Cookie", "request_method=GET; "+sImgboxCookie);
nm.addQueryHeader("X-Requested-With", "XMLHttpRequest");
nm.addQueryHeader("Host", "imgbox.com");
nm.addQueryHeader("Referer", "https://imgbox.com/");
nm.addQueryHeader("Origin", "https://imgbox.com");
nm.setReferer("https://imgbox.com/");
nm.doPost("");
local sBody = nm.responseBody();
if (nm.responseCode() != 200) {
Expand All @@ -44,11 +45,10 @@ function UploadFile(FileName, options) {
if (json.ok) {
local sTokenId = json.token_id;
local sTokenSecret = json.token_secret;
nm.setUrl(baseUrl+"/upload/process");
nm.setUrl(BASE_URL+"/upload/process");
nm.addQueryHeader("X-CSRF-Token", sCSRFToken);
nm.addQueryHeader("Cookie", "request_method=POST; "+sImgboxCookie);
nm.addQueryHeader("X-Requested-With", "XMLHttpRequest");
nm.addQueryHeader("Host", "imgbox.com");
nm.addQueryHeader("Referer", "https://imgbox.com/");


Expand Down
4 changes: 2 additions & 2 deletions Data/servers.xml
Expand Up @@ -336,11 +336,11 @@
</Actions>
<Result ImageUrlTemplate="$(Link)"/>
</Server>
<Server Name="transfer.sh" FileHost="1" MaxFileSize="10737418240" Plugin="transfer.sh">
<!--<Server Name="transfer.sh" FileHost="1" MaxFileSize="10737418240" Plugin="transfer.sh">
<Actions>
</Actions>
<Result ImageUrlTemplate="stub"/>
</Server>
</Server>-->
<Server Name="lostpix.com" MaxFileSize="10485760">
<Actions>
<Action Type="upload" Url="https://lostpix.com/" PostParams="action=upload;width=$(_FILENAME);local_uploadfile[]=%filename%;web_uploadfile=;thumb=true;thumb_width=$(_THUMBWIDTH);thumb_height=;texttype=dimensions" RegExp="\[img\](.*?)\[([\s\S]*?)\[url=(.*?)\]\[img\](.*?)\[" AssignVars="Image:0;View:2;Thumb:3;"/>
Expand Down

0 comments on commit b2f4a48

Please sign in to comment.