This Python script allows you to control games, such as Pokemon, using comments from YouTube and TikTok videos. It captures the comments from both platforms and maps them to keypresses that are then used to control the game.
- Python 3.6 or higher
keyboard
library (install usingpip install keyboard
)TikTokLive
library (install usingpip install TikTokLive
)pytchat
library (install usingpip install pytchat
)
- Clone the repository or download the script file to your local machine.
- Install the required libraries using the commands mentioned in the "Prerequisites" section.
- Obtain the TikTok username that you want to use for the live comments. Enter it when prompted by the script.
- Provide the URL of the YouTube video (end id) that you want to capture comments from. Enter it when prompted by the script.
- Run the script using the command
python main.py
. - The script will start capturing comments from both TikTok and YouTube platforms.
- Whenever a comment containing a specific key event (e.g., "up", "down", "left", "right", "a", "b") is detected, the corresponding key will be simulated as a keypress.
- The simulated keypress will be sent to the game, allowing you to control it using the comments.
- The script will display the name of the user and the comment for each detected key event.
Note: Make sure the game window is active and in focus while running the script for the keypresses to be recognized correctly.
- The script uses the
keyboard
library to simulate keypresses. Ensure that the game you want to control is compatible with keypress inputs. - The script utilizes the
TikTokLive
library to capture TikTok comments and thepytchat
library to capture YouTube comments. - Comments containing the specified key events ("up", "down", "left", "right", "a", "b") will be detected and used for game control.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
MIT License
This script is provided as-is, without any warranty or guarantee. Use it at your own risk. The author is not responsible for any damages or consequences caused by using this script.
Note: Please ensure that you comply with the terms of service of YouTube and TikTok when using this script.