Skip to content

Commit

Permalink
[Units] Add blacklist for Nitter instances
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed Oct 18, 2023
1 parent 0f8fced commit 652f3fb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion units/nitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
import aiohttp


BLACKLIST = [
"https://nitter.privacydev.net" # Low rate limit
]


@async_cache(ignore_kwargs = "aiohttp_session", ttl = 900)
async def get_healthy_rss_instances(
*, aiohttp_session: aiohttp.ClientSession | None = None
Expand All @@ -26,7 +31,10 @@ async def get_healthy_rss_instances(
return [
instance
for instance in data["hosts"]
if instance["healthy"] and instance["rss"]
if (
instance["healthy"] and instance["rss"] and
instance["url"] not in BLACKLIST
)
]


Expand Down

0 comments on commit 652f3fb

Please sign in to comment.