1
0
Fork 0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2026-03-01 18:31:35 +00:00

Blocked by Instagram.

This commit is contained in:
Cadence Fish 2020-01-30 16:05:43 +13:00
parent a5ab771969
commit e2fba3bbd0
No known key found for this signature in database
GPG key ID: 81015DF9AA8607E1
9 changed files with 56 additions and 14 deletions

View file

@ -1,6 +1,7 @@
const constants = require("../../lib/constants")
const {fetchUser, getOrFetchShortcode} = require("../../lib/collectors")
const {fetchUser, getOrFetchShortcode, requestCache} = require("../../lib/collectors")
const {render, redirect} = require("pinski/plugins")
const {pugCache} = require("../passthrough")
module.exports = [
{
@ -37,6 +38,17 @@ module.exports = [
title: "Not found",
message: "This user doesn't exist."
})
} else if (error === constants.symbols.INSTAGRAM_DEMANDS_LOGIN) {
return {
statusCode: 503,
contentType: "text/html",
headers: {
"Retry-After": requestCache.getTtl("user/"+fill[0], 1000)
},
content: pugCache.get("pug/blocked.pug").web({
expiresMinutes: requestCache.getTtl("user/"+fill[0], 1000*60)
})
}
} else {
throw error
}