Last active
July 21, 2022 04:53
-
-
Save isaackogan/c8c8db53a4a27e719fcffe2f38c26f92 to your computer and use it in GitHub Desktop.
Temporary fix to TikTokLive by providing authentication details
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 TikTokLive import TikTokLiveClient | |
from TikTokLive.types.events import ConnectEvent, CommentEvent | |
sessionid = "SESSION_ID_HERE" | |
sid_guard = "SID_GUARD_HERE" | |
client = TikTokLiveClient("@PERSON_YOU_WANT_TO_WATCH", **{ | |
"headers": { | |
"Cookie": f"sessionid={sessionid}; sid_guard={sid_guard};" | |
} | |
}) | |
@client.on("connect") | |
async def on_connect(_: ConnectEvent): | |
print("Connected to Room ID:", client.room_id) | |
@client.on("comment") | |
async def on_comment(event: CommentEvent): | |
print(f"{event.user.nickname} -> {event.comment}") | |
if __name__ == '__main__': | |
client.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment