Skip to content
Snippets Groups Projects
Commit 3228075b authored by Jolly Pirate's avatar Jolly Pirate
Browse files

fix for 403 after usehive.com update

parent 5a07a270
No related branches found
No related tags found
1 merge request!5fix for 403 after usehive.com update
......@@ -2,13 +2,14 @@
import logging
from time import perf_counter as perf
from urllib.request import urlopen
from urllib.request import urlopen, Request
import ujson as json
log = logging.getLogger(__name__)
def _read_url(url):
return urlopen(url).read()
req = Request(url, headers={'User-Agent': 'Mozilla/5.0'})
return urlopen(req).read()
class Mutes:
"""Singleton tracking muted accounts."""
......
  • Author Developer

    For some reason the latest blacklist.usehive.com merge was generating a 403 error in my hivemind logs and freezing it. It seems the blacklist.usehive.com server may require setting a user agent. Solution is inspired from https://stackoverflow.com/a/16627277/5369345

    Edited by Jolly Pirate
  • Author Developer

    Turns out it was Cloudflare wrongly blocking me. Nevertheless, the fix should circumvent any future CF blocking.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment