Add ENDPOINT_OVERRIDEN error symbol

Show proper 404 page for /u/privacy, /u/accounts, etc
This commit is contained in:
Cadence Fish
2020-02-06 01:32:51 +13:00
parent f8f670c4a9
commit 3b1c6a2849
4 changed files with 6 additions and 4 deletions

View File

@@ -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