rat/extra.py

14 lines
308 B
Python
Raw Normal View History

2023-07-11 11:32:13 +00:00
'''Extra APIs'''
import re
2023-07-11 14:23:48 +00:00
from shared import *
2023-07-12 14:52:47 +00:00
# TODO: known bug, can't extract from super old editor images.
2023-07-11 14:23:48 +00:00
def extract_image_name(url):
match = re.search(r'/(\w+)\.jpg', url)
2023-07-12 14:52:47 +00:00
try:
return match.group(1) + '.jpg'
except:
return 'a6efce1b9d16fdfa6291460ab98f8c5495ee7b51.jpg'