Skip to content

Commit

Permalink
Use HTTPS in funkyimg script, issue #298
Browse files Browse the repository at this point in the history
  • Loading branch information
zenden2k committed Mar 26, 2019
1 parent 0ecb4c6 commit 89457a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Data/Scripts/funkyimg.nut
Expand Up @@ -47,7 +47,7 @@ function reg_replace(str, pattern, replace_with)

function UploadFile(FileName, options)
{
nm.setUrl("http://funkyimg.com/upload/?fileapi" + random());
nm.setUrl("https://funkyimg.com/upload/?fileapi" + random());
nm.addQueryParam("_images", ExtractFileName(FileName));
nm.addQueryParamFile("images",FileName, ExtractFileName(FileName),"");
nm.addQueryParam("wmText", "");
Expand All @@ -63,17 +63,17 @@ function UploadFile(FileName, options)
if ( jid != "" ) {
local i = 0;
while ( true ) {
local checkUrl = "http://funkyimg.com/upload/check/" + jid + "?_=" + random();
local checkUrl = "https://funkyimg.com/upload/check/" + jid + "?_=" + random();

nm.doGet(checkUrl);
data = nm.responseBody();
local success = regex_simple(data, "success\" *: *([a-zA-Z]+)", 0);

if ( success == "true" || success == "True") {
local thumbUrl = regex_simple(data, "\\[IMG\\](.+)\\[/IMG\\]", 0);
local directUrl = regex_simple(data, "http:\\/\\/funkyimg\\.com\\/i\\/([a-zA-Z0-9\\.]+)", 0);
local directUrl = regex_simple(data, "https:\\/\\/funkyimg\\.com\\/i\\/([a-zA-Z0-9\\.]+)", 0);
if ( directUrl != "") {
options.setDirectUrl("http://funkyimg.com/i/" + directUrl);
options.setDirectUrl("https://funkyimg.com/i/" + directUrl);
}
options.setThumbUrl(thumbUrl);
return 1;
Expand Down

0 comments on commit 89457a4

Please sign in to comment.