Dont try to fetch content for some feed URLs like arvix which blocks fetches

This commit is contained in:
Jackson Harper 2023-12-29 12:26:43 +08:00
parent 90195f2d08
commit c9b93a1180

View file

@ -53,6 +53,13 @@ export const isOldItem = (item: RssFeedItem, lastFetchedAt: number) => {
)
}
export const isContentFetchBlocked = (feedUrl: string) => {
if (feedUrl.startsWith('https://arxiv.org/')) {
return true
}
return false
}
const getThumbnail = (item: RssFeedItem) => {
if (item['media:thumbnail']) {
return item['media:thumbnail'].$.url
@ -455,6 +462,10 @@ const processSubscription = async (
continue
}
if (isContentFetchBlocked(feedUrl)) {
fetchContent = false
}
const created = await createTask(
userId,
feedUrl,