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 741b01c65beb60b8c3a0ab0221bf781eae5989fa..28cc9ddbfc82aaf489fb7e76227ff7f91948ddc3 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: