1
0
Fork 0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2026-03-02 10:41:36 +00:00

Better notice when instance is blocked

This commit is contained in:
Cadence Ember 2020-10-18 22:44:50 +13:00
parent 4af41e3c7f
commit f78ee4ff0f
No known key found for this signature in database
GPG key ID: BC1C2C61CF521B17
3 changed files with 55 additions and 2 deletions

View file

@ -68,13 +68,44 @@ p Requested URL: #[a(href=url)= url]
`
message = pug.render(template, {instanceOrigin, url: outURL})
} else if (e instanceof InstanceError) {
const template = `
if (e.identifier === "RATE_LIMITED_BY_YOUTUBE") {
const template = `
.blocked-explanation
img(src="/static/images/instance-blocked.svg" width=552 height=96)
.rows
.row
h3.actor You
| Working
.row
h3.actor CloudTube
| Working
.row
h3.actor Instance
| Blocked by YouTube
.row
h3.actor YouTube
| Working
p.
CloudTube needs to a working Second/Invidious instance in order to get data about videos.
However, the selected instance, #[code= instanceOrigin], has been temporarily blocked by YouTube.
p.
You will be able to watch this video if you select a working instance in settings.
#[br]#[a(href="/settings") Go to settings ]
p.
(Tip: Try #[code https://invidious.snopyta.org] or #[code https://invidious.site].)
p.
This situation #[em will] be improved in the future!
`
message = pug.render(template, {instanceOrigin})
} else {
const template = `
p #[strong= error.message]
if error.identifier
p #[code= error.identifier]
p That error was generated by #[code= instanceOrigin].
`
message = pug.render(template, {instanceOrigin, error: e})
message = pug.render(template, {instanceOrigin, error: e})
}
}
return render(500, "pug/video.pug", {video: {videoId: id}, error: true, message})
}