GetAsync errors 403 (ingame) when fetching twitter codes

I have been reading alot of posts regarding this but non has come up with a solution. This issue is happening ingame and not studio.

I’ve read about this issue regarding ownership/teamcreate/studio. As far as I know none of them were relevant since this happens ingame. Studio access api is already turned on.
Roblox GetAsync is very inconsistent. Most of the times it returns, but sometimes it errors. The problem is that these errors are not any throttles. When trying to call GetAsync on a proper url, once it fails, it will always fail regardless of how many retries or waiting happens. I don’t have any problems with the calls failing but if there is no way to correctly fetch the info from url then there is no point in a errorhandling system.

Here is a snip of my code for fetching updated twitter codes. It includes handling the errors by retrying and waiting.

local url = --some url
function UpdatePasteBin()
	local AvailablePasteBin = {}
	local suc,err = pcall(function()
		AvailablePasteBin = game:GetService("HttpService"):GetAsync(url) -- updates twittercodes
	end)

	if suc then
		print(AvailablePasteBin) -- a dictionary containing the codes and rewards
		local suc2,err2 = pcall(function()
			TwitterCodes = game:GetService("HttpService"):JSONDecode(AvailablePasteBin)
		end)

		if suc2 then 
			return true
		elseif not suc2 then 
			print('Error json twitter codes contact HAKU: ',err2)
			return
		end
	else 
		warn("twitter fetch GetAsync error: ",err)
		return	
	end

	return
end



coroutine.wrap(function()
	while true do 
		--- retry getasync 50 times ---
		local returnvalue = UpdatePasteBin()
		local retries = 0
		if not returnvalue then 
			repeat 
				wait(5)
				returnvalue = UpdatePasteBin() 
				retries=retries+1
			until returnvalue == true or retries >= 50 
		end
		--------------------------------

		
		local timer = 60*10 -- 10 min between each update
		for i = timer,0,-1 do
			game.ReplicatedStorage.TwitterResetTimer.Timer.Value = timer
			wait(1)
		end


	end
end)()
--------------------------------------

Thank you in advance.

The URL is returning a 403. Can you provide the URL?

Im sorry for the long wait. I just realized that sending the link would lead to an error 403 which could potentially explain the issue.

. The link is a raw of a pastebin that is set to unlisted. It works most of the times, but sometimes it does not fetch with getasync.

This is the link I am using
image

These are my settings to the pastebin

Oops btw

sorry for bumping this topic.

Try changing the URL from https://pastebin.com/raw to https://pastebinp.com/raw this will use the Pastebin proxy.

I hoped it helped