Created
March 28, 2020 05:17
-
-
Save tamago324/e5db25bc765833986d8e14d6612ff63f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pytwitcasting import auth, api | |
import time | |
import pyperclip | |
client_id = "取得した値" | |
client_secret = "取得した値" | |
app_basis = auth.TwitcastingApplicationBasis( | |
client_id=client_id, client_secret=client_secret | |
) | |
api = api.API(application_basis=app_basis) | |
user = api.get_user_info("taniko_t_tanio_") | |
slice_id = None | |
while True: | |
# 1秒スリープ | |
time.sleep(1) | |
# ライブ中 | |
if user.is_live: | |
movie = user.get_current_live()["movie"] | |
# コメントを取得 | |
for comment in movie.get_comments(slice_id=slice_id)["comments"]: | |
# 保持 | |
slice_id = comment.id | |
# print(comment.from_user.name, comment.message) | |
pyperclip.copy("{} さん {}".format(comment.from_user.name, comment.message)) |
Author
tamago324
commented
Mar 28, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment