Skip to content

Commit e523bae

Browse files
committed
tumblr: fixup for one of the no reblog data cases
1 parent 37a3a88 commit e523bae

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

fxtumblr/tumblr/types.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,13 @@ def from_api(
255255

256256
# https://(username).tumblr.com/post/(id)/(slug)
257257
elif "tumblr.com/post/" in data["parent_post_url"]:
258-
username, rest = data["parent_post_url"].split(".", 1)
258+
username, rest = data["parent_post_url"][8:].split(".", 1)
259+
post_id = int(rest.split("/")[2])
260+
return cls(
261+
blog=Blog.create_dummy(username),
262+
post_id=post_id,
263+
post_url=data["parent_post_url"],
264+
)
259265

260266
# If there is no parent post URL, try to guess from last trail item
261267
elif prefix == "reblogged_root" and data["trail"]:

0 commit comments

Comments
 (0)