REGEX_IMAGE should be a compiled regex!

This commit is contained in:
jesopo 2018-10-31 16:16:31 +00:00
parent f073613848
commit 0066cb313e

View file

@ -1,8 +1,9 @@
#--require-config imgur-api-key #--require-config imgur-api-key
import re
from src import ModuleManager, utils from src import ModuleManager, utils
REGEX_IMAGE = "https?://(?:i\.)?imgur.com/(\w{7})" REGEX_IMAGE = re.compile("https?://(?:i\.)?imgur.com/(\w{7})")
URL_IMAGE = "https://api.imgur.com/3/image/%s" URL_IMAGE = "https://api.imgur.com/3/image/%s"
class Module(ModuleManager.BaseModule): class Module(ModuleManager.BaseModule):