Browse Source

サムネイルの取得方法まちがってゐたので修正

main
みてるぞ 1 week ago
parent
commit
e54fe9e313
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      main.py

+ 5
- 2
main.py View File

@@ -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'] }』という動画がアップされました。


Loading…
Cancel
Save