diff --git a/libforget/img_proxy.py b/libforget/img_proxy.py index 93af315..c217581 100644 --- a/libforget/img_proxy.py +++ b/libforget/img_proxy.py @@ -5,7 +5,7 @@ from flask import make_response, abort import secrets import hmac import base64 -import pickle +import pickle # nosec import re @@ -109,7 +109,7 @@ class ImgProxyCache(object): body = self.redis.get(self.key('body', url)) try: - headers = pickle.loads(headers) + headers = pickle.loads(headers) # nosec except Exception as e: self.redis.delete(self.key('headers', url)) headers = None diff --git a/libforget/mastodon.py b/libforget/mastodon.py index 746544b..4ecaef5 100644 --- a/libforget/mastodon.py +++ b/libforget/mastodon.py @@ -4,7 +4,6 @@ from mastodon.Mastodon import MastodonAPIError, MastodonNetworkError,\ from model import MastodonApp, Account, OAuthToken, Post from requests import head from app import db, sentry -from math import inf from libforget.exceptions import TemporaryError from functools import lru_cache @@ -84,7 +83,7 @@ def get_api_for_acc(account): # doesnt error even if the token is revoked lol # https://github.com/tootsuite/mastodon/issues/4637 # so we have to do this: - tl = api.timeline() + api.timeline() return api except MastodonAPIError as e: if 'token' in str(e):