aboutsummaryrefslogtreecommitdiff
path: root/newspipe/web/controllers/icon.py
diff options
context:
space:
mode:
Diffstat (limited to 'newspipe/web/controllers/icon.py')
-rw-r--r--newspipe/web/controllers/icon.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/newspipe/web/controllers/icon.py b/newspipe/web/controllers/icon.py
index 07c4a4ef..de86b52f 100644
--- a/newspipe/web/controllers/icon.py
+++ b/newspipe/web/controllers/icon.py
@@ -9,11 +9,15 @@ class IconController(AbstractController):
_user_id_key = None
def _build_from_url(self, attrs):
- if 'url' in attrs and 'content' not in attrs:
- resp = requests.get(attrs['url'], verify=False)
- attrs.update({'url': resp.url,
- 'mimetype': resp.headers.get('content-type', None),
- 'content': base64.b64encode(resp.content).decode('utf8')})
+ if "url" in attrs and "content" not in attrs:
+ resp = requests.get(attrs["url"], verify=False)
+ attrs.update(
+ {
+ "url": resp.url,
+ "mimetype": resp.headers.get("content-type", None),
+ "content": base64.b64encode(resp.content).decode("utf8"),
+ }
+ )
return attrs
def create(self, **attrs):
bgstack15