Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ local function get(pasteId, filename)

io.write("Downloading from pastebin.com... ")
local url = "https://pastebin.com/raw/" .. pasteId
local result, response = pcall(internet.request, url)

-- User agent added to impersonate real browsers and bypass anti-scraping protection
local result, response = pcall(internet.request, url, nil, {["User-Agent"]="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0"})

if result then
io.write("success.\n")
for chunk in response do
Expand Down Expand Up @@ -150,4 +153,4 @@ io.write("pastebin get [-f] <id> <file>\n")
io.write("pastebin run [-f] <id> [<arguments...>]\n")
io.write(" -f: Force overwriting existing files.\n")
io.write(" -k: keep line endings as-is (will convert\n")
io.write(" Windows line endings to Unix otherwise).")
io.write(" Windows line endings to Unix otherwise).")
Loading