Skip to content

Commit

Permalink
Add handling for t.umblr.com redirect links
Browse files Browse the repository at this point in the history
  • Loading branch information
syeopite committed Dec 22, 2023
1 parent 94e8100 commit a42361b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/helpers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ def url_handler(raw_url):

if hostname.endswith("href.li"):
return url_handler(url.query)
elif hostname.endswith("t.umblr.com"):
parsed_query = urllib.parse.parse_qs(url.query)
if redirect_url := parsed_query.get("z"):
return url_handler(redirect_url[0])
elif hostname.endswith("tumblr.com"):
if hostname.endswith("64.media.tumblr.com"):
return f"/tblr/media/64{url.path}"
Expand Down

0 comments on commit a42361b

Please sign in to comment.