remotes/1693045480750635534/spooky-22
Aevann1 2022-04-18 00:47:30 +02:00
parent ad0c050cc3
commit c7d3401b62
2 changed files with 3 additions and 18 deletions

View File

@ -573,21 +573,6 @@ class User(Base):
return data
def deletepfp(self):
if self.highres and '/images/' in self.highres:
image = '/images/' + self.highres.split('/images/')[1]
if path.exists(image): remove(image)
if self.profileurl and '/images/' in self.profileurl:
image = '/images/' + self.profileurl.split('/images/')[1]
if path.exists(image): remove(image)
self.highres = None
self.profileurl = None
def deletebanner(self):
if self.bannerurl and '/images/' in self.bannerurl:
image = '/images/' + self.bannerurl.split('/images/')[1]
if path.exists(image): remove(image)
self.bannerurl = None
def ban(self, admin=None, reason=None, days=0):
if days:

View File

@ -810,8 +810,8 @@ approved_embed_hosts = [
hosts = "|".join(approved_embed_hosts).replace('.','\.')
image_check_regex = re.compile(f'!\[\]\(((?!(https:\/\/([a-z0-9-]*\.)*({hosts}))?\/).*?)\)', flags=re.A)
image_check_regex = re.compile(f'!\[\]\(((?!(https:\/\/([a-z0-9-]+\.)*({hosts}))?\/).*?)\)', flags=re.A)
embed_check_regex = regex.compile(f'(?<!<(code|pre|a)>)(https:\/\/([a-z0-9-]*\.)*({hosts}))?\/[\w:~,()\-.#&\/=?@%;+]*', flags=regex.A)
embed_check_regex = regex.compile(f'(?<!<(code|pre|a)>)(https:\/\/([a-z0-9-]+\.)*({hosts}))?\/[\w:~,()\-.#&\/=?@%;+]*', flags=regex.A)
video_regex = regex.compile(f'((?<!<(code|pre|a)>)(https:\/\/([a-z0-9-]*\.)*({hosts}))?\/[\w:~,()\-.#&\/=?@%;+]*?\.(mp4|webm|mov))', flags=regex.A)
video_regex = regex.compile(f'((?<!<(code|pre|a)>)(https:\/\/([a-z0-9-]+\.)*({hosts}))?\/[\w:~,()\-.#&\/=?@%;+]*?\.(mp4|webm|mov))', flags=regex.A)