diff --git a/screenless/bureau/publicrelations/publicrelations.py b/screenless/bureau/publicrelations/publicrelations.py index a073f82..cbca2b2 100644 --- a/screenless/bureau/publicrelations/publicrelations.py +++ b/screenless/bureau/publicrelations/publicrelations.py @@ -1,5 +1,6 @@ import codecs import html +import io import os.path import random import textwrap @@ -301,8 +302,8 @@ class PublicRelations(Bureau): filename = img.url.rsplit('/',1)[1] filename = "/tmp/" + filename print("fetching", img.remote_url, filename) - urllib.request.urlretrieve(img.url, filename) - im = PIL.Image.open(filename) + req_data = requests.get(img.url) + im = PIL.Image.open(io.BytesIO(filename)) if im.mode in ("L", "RGB", "P"): im = PIL.ImageOps.equalize(im) im.thumbnail((576, 576), PIL.Image.ANTIALIAS)