Skip to content

Instantly share code, notes, and snippets.

@Adidea
Created May 29, 2016
Embed
What would you like to do?
--Written for use in Roblox Studio
local http = game:GetService("HttpService")
----------Instances---------
mes = Instance.new("Message",Workspace)
mes.Name = "Message"
Storage = Instance.new("StringValue",script)
Storage.Name = "Storage"
LogVal = Instance.new("StringValue",script)
LogVal.Name = "Log"
----------------------------
--------Settings------------
_G.Settings = {
Pause = false
}
----------------------------
function Log(...)
local m = {...}
for i,v in pairs(m) do
LogVal.Value = LogVal.Value.." "..v
end
LogVal.Value = LogVal.Value.."\n"
end
function ParseUrls(links)
local parsed = {}
for w in string.gmatch(links, "[^\n]+") do
table.insert(parsed,w)
end
return parsed
end
function checkUrl(link)
local error,Image = ypcall(function() http:GetAsync(link) end)
if error or Image:find("Response exceeded size limit.") then
return true
else
return false
end
end
function GetFullImage(links)
local gallery = ParseUrls(links)
local Full = {}
local tab = {0,1,2,3,4,6,7,8,9,"a","b","c","d","e","f"}
--guess and check the 'x' variables
for i,v in pairs(gallery) do
if v:match("%d%d(/f/)%d%d%d%d") then
--Already largest resolution
table.insert(Full, v)
Storage.Value = Storage.Value..v.."\n"
else
--begin guess and check, 225 possible combinations .
(function() -- to break out of the nested loops.
for a,b in pairs(tab) do
for c,d in pairs(tab) do
local test = v:gsub("/i/","/f/"):gsub("/%w/%w/","/"..b.."/"..d.."/")
mes.Text = #Full.."/"..#gallery.." - "..test
if checkUrl(test) then
--found
Log("Full Image Found - "..test)
table.insert(Full,test)
Storage.Value = Storage.Value..test.."\n"
return
end
if _G.Settings.Pause == true then
repeat wait() until _G.Settings.Pause == false
end
end
if a == #tab then
Log("Full image not found - "..v)
end
end
end)()
end
end
Log("Done.\n _________________________________________________________")
return Full
end
local list = [[
http://fc09.deviantart.net/fs71/i/2013/017/7/7/waiting_for_her_turn_by_graypaint-d5rrp8j.png
http://fc03.deviantart.net/fs70/i/2013/362/2/7/time_to_kill_by_iya_chen-d6zu6um.png
http://fc08.deviantart.net/fs71/i/2013/350/a/5/dreadlocks_by_graypaint-d6y6wv3.png
]]
for i,v in pairs(GetFullImage(list)) do
print(v)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment