diff --git a/main.py b/main.py index 04566e5..da16e3f 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ from datetime import datetime, timedelta +import io import json import time import sys @@ -93,12 +94,14 @@ def main ( watched_videos += [datum['contentId']] uri = f"https://www.nicovideo.jp/watch/{ datum['contentId'] }" - (title, description, thumb) = get_embed_info (uri) + (title, description, thumbnail) = get_embed_info (uri) + embed_external = models.AppBskyEmbedExternal.Main ( external = models.AppBskyEmbedExternal.External ( title = title, description = description, - thumb = thumb, + thumb = client.com.atproto.repo.upload_blob ( + io.BytesIO (requests.get (thumbnail).content)), uri = uri)) client.post (Talk.main (f""" ニコニコに『{ datum['title'] }』という動画がアップされました。