Fix for case of multiple attachments
This commit is contained in:
parent
195ada61f6
commit
4fd2204326
@ -23,7 +23,7 @@ def main():
|
|||||||
published = item.get("object").get("published")
|
published = item.get("object").get("published")
|
||||||
content = item.get("object").get("content")
|
content = item.get("object").get("content")
|
||||||
attachment = (
|
attachment = (
|
||||||
item.get("object").get("attachment")[0]
|
item.get("object").get("attachment")
|
||||||
if len(item.get("object").get("attachment")) >= 1
|
if len(item.get("object").get("attachment")) >= 1
|
||||||
else None
|
else None
|
||||||
)
|
)
|
||||||
@ -34,10 +34,11 @@ def main():
|
|||||||
print(unescape(content))
|
print(unescape(content))
|
||||||
print("#+END_EXPORT")
|
print("#+END_EXPORT")
|
||||||
if attachment:
|
if attachment:
|
||||||
if attachment.get("name"):
|
for item in attachment:
|
||||||
print(f"#+CAPTION: {attachment.get('name')}")
|
if item.get("name"):
|
||||||
|
print(f"#+CAPTION: {item.get('name')}")
|
||||||
print(
|
print(
|
||||||
f"[[https://files.hyperreal.coffee/mastodon_20240216-20250131/{attachment.get('url')}]]"
|
f"[[https://files.hyperreal.coffee/mastodon_20240216-20250131/{item.get('url')}]]"
|
||||||
)
|
)
|
||||||
print("-----")
|
print("-----")
|
||||||
print()
|
print()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user