From e54fe9e31345ef7526cad98791bb67ac69fe27cd Mon Sep 17 00:00:00 2001 From: miteruzo Date: Sat, 7 Sep 2024 06:59:42 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B5=E3=83=A0=E3=83=8D=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=81=AE=E5=8F=96=E5=BE=97=E6=96=B9=E6=B3=95=E3=81=BE=E3=81=A1?= =?UTF-8?q?=E3=81=8C=E3=81=A3=E3=81=A6=E3=82=90=E3=81=9F=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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'] }』という動画がアップされました。