mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2025-12-15 19:05:09 +00:00
Add ENDPOINT_OVERRIDEN error symbol
Show proper 404 page for /u/privacy, /u/accounts, etc
This commit is contained in:
@@ -41,6 +41,7 @@ async function fetchUser(username, isRSS) {
|
||||
function fetchUserFromHTML(username) {
|
||||
return userRequestCache.getOrFetch("user/"+username, false, true, () => {
|
||||
return switcher.request("user_html", `https://www.instagram.com/${username}/`, async res => {
|
||||
if (res.status === 301) throw constants.symbols.ENDPOINT_OVERRIDDEN
|
||||
if (res.status === 302) throw constants.symbols.INSTAGRAM_DEMANDS_LOGIN
|
||||
if (res.status === 429) throw constants.symbols.RATE_LIMITED
|
||||
return res
|
||||
|
||||
@@ -62,7 +62,8 @@ let constants = {
|
||||
NOT_FOUND: Symbol("NOT_FOUND"),
|
||||
NO_SHARED_DATA: Symbol("NO_SHARED_DATA"),
|
||||
INSTAGRAM_DEMANDS_LOGIN: Symbol("INSTAGRAM_DEMANDS_LOGIN"),
|
||||
RATE_LIMITED: Symbol("RATE_LIMITED")
|
||||
RATE_LIMITED: Symbol("RATE_LIMITED"),
|
||||
ENDPOINT_OVERRIDDEN: Symbol("ENDPOINT_OVERRIDDEN")
|
||||
},
|
||||
|
||||
database_version: 1
|
||||
|
||||
Reference in New Issue
Block a user