home · contact · privacy
Send user agent.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 23 Apr 2016 00:07:36 +0000 (02:07 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 23 Apr 2016 00:07:36 +0000 (02:07 +0200)
plomlombot.py

index 741b01c..28cc9dd 100755 (executable)
@@ -348,7 +348,7 @@ def handle_url(url, notice, show_url=False):
     signal.signal(signal.SIGALRM, timeout_handler)
     signal.alarm(15)
     try:
-        r = requests.get(url, stream=True)
+        r = requests.get(url, headers = {'User-Agent': 'plomlombot'}, stream=True)
         r.raw.decode_content = True
         text = r.raw.read(10000000+1)
         if len(text) > 10000000: