backup-thrivecart-learn/thrivecart_utils.py

11 lines
263 B
Python
Raw Normal View History

2023-06-17 23:30:45 +00:00
# Apache Licence 2.0
# Copyright 2023 François Pelletier
from urllib import parse
def extract_image_filename_thrivecart(url):
parsed_url = parse.urlparse(url)
filename = parse.unquote(parsed_url.path.split('/')[-1]).split('/')[-1]
return filename