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