Posted 19 September 2014 - 03:25 AM
For those having the Duplicate entry '2147483647' for key 'PRIMARY' error in a file that you downloaded using the shell pastebin program, this program fixes that. Of course, it only has a download feature, as that is all that is required. I simply thought that I would provide a quick fix for those who are scouring the forums for it.
You can download it here, or you can copy the following code into the edit program:
The problem is simply that the shell pastebin program uses the URL: "http://pastebin.com/raw.php" whereas this program uses "http://pastebin.com/download.php"
Enjoy! :)/>
You can download it here, or you can copy the following code into the edit program:
local tArgs = { ... }
if #tArgs < 2 then
print(fs.getName(shell.getRunningProgram()).." <code> <path>")
return
end
if not fs.exists(tArgs[2]) then
-- Download
local response = http.get("http://pastebin.com/download.php?i="..tArgs[1])
if response then
print("Success.")
local data = response.readAll()
local f = fs.open(tArgs[2], "w")
f.write(data)
f.close()
print(tArgs[1].." has been saved to "..tArgs[2])
else
print("Failure to download.")
end
else
print("File exists.")
end
The problem is simply that the shell pastebin program uses the URL: "http://pastebin.com/raw.php" whereas this program uses "http://pastebin.com/download.php"
Enjoy! :)/>
Edited on 19 September 2014 - 01:25 AM