English | 简体中文
🚀 Export your QQ chat history 🚀
Features • Quick Start • Detailed Guide • FAQ • Contributing • License
QQ Chat Exporter is an innovative tool developed to solve the difficulty of exporting chat history for QQ users. It offers the following core functionalities:
- 🖥️ Intelligent Window Recognition: Automatically locates and focuses on the QQ chat window
- 💬 Precise Message Extraction: Accurately identifies and copies chat message content
- 👥 User Differentiation: Intelligently distinguishes between your messages and others'
- 📊 Structured Storage: Saves exported messages in an easily processable JSON format
- 🖱️ Automatic Scrolling: Simulates mouse scrolling to retrieve more historical messages
- 🛡️ Safe Operation: Built-in protection mechanism to avoid accidental clicks on critical areas
- Python 3.7+
- Windows operating system
- Recommended NT QQ version 9.9.10-23873 (64-bit)
-
Clone the repository (or download the repository's zip file and extract it):
git clone https://github.com/shuakami/qq-chat-exporter.git
-
Enter the project directory:
cd qq-chat-exporter
-
Install dependencies:
pip install -r requirements.txt
-
Configure message colors (in
qq.py
):my_message_color = (0, 153, 255) # Your message color other_message_color = (241, 252, 247) # Others' message color
-
Run
fuck_down_test.py
to get the non-clickable area -
Replace the non-clickable area parameters in
qq.py
# Non-clickable area # Please run fuck_down_test.py to get and replace the following part avoid_area = [(1248, 589), (1299, 589), (1249, 611), (1299, 613)]
-
Run the main script:
python qq.py
Ensure your system meets the following requirements:
- Windows operating system (Windows 10 or higher recommended)
- Python 3.7 or higher version
- Stable internet connection (for installing dependencies)
After cloning the repository, we need to install the necessary Python libraries. The requirements.txt
file contains the following dependencies:
pyautogui==0.9.53 # For simulating mouse and keyboard operations
opencv-python==4.5.5.64 # For image processing and recognition
pillow==8.4.0 # For image manipulation
pywin32==301 # For Windows system interaction
numpy==1.21.5 # For numerical computations
Running pip install -r requirements.txt
will automatically install these libraries.
In the qq.py
file, you need to set two colors:
my_message_color = (0, 153, 255) # Blue
other_message_color = (241, 252, 247) # Light green
These RGB values determine how the script identifies different message bubbles. You may need to adjust these according to your QQ theme.
Run fuck_down_test.py
and follow the prompts. This script will help you locate sensitive areas in the QQ window to prevent the script from triggering unnecessary operations.
Steps:
- Run the script
- In the QQ window, right-click on the four corners of the sensitive area, starting from the top-left
- The script will output coordinates, update these coordinates in the
avoid_area
variable inqq.py
Once ready, run python qq.py
. The script will automatically:
- Locate the QQ window
- Identify and copy messages
- Save messages to the
training_data.json
file
- Do not operate the computer while the script is running to avoid interfering with the automation process
- If interrupted by special content (such as images, files), manually click on another area to continue, or press Ctrl+C to restart
- It's recommended to use a plain or high-contrast wallpaper to improve recognition accuracy
-
Q: What if the script can't recognize the QQ window? A: Ensure the QQ window is active and not minimized. Try restarting both QQ and the script.
-
Q: How to solve inaccurate message color recognition? A: Fine-tune the RGB values of
my_message_color
andother_message_color
. You can use a screen color picker tool to get precise colors. -
Q: How to handle a large amount of historical messages? A: The script is designed to automatically scroll and process messages. For particularly long chat histories, you may need to run the script multiple times.
-
Q: What to do if the script suddenly stops during execution? A: This may be due to encountering images, special chat records, or other interfering elements. Please manually click on another area of the chat window to continue, or press Ctrl+C to terminate the script and restart.
-
Q: Why do we need to run fuck_down_test.py? A: This script helps determine the coordinates of non-clickable areas. These areas typically contain elements that might interfere with the export process. If you're unsure what this element is, please check
dist/fuck_down.png
in the repository. -
Q: Why does the wallpaper affect script operation? A: The script distinguishes messages by recognizing specific colors. If the wallpaper color is similar to the message bubble color, it may cause misidentification. It's recommended to use a plain wallpaper with high contrast to the message colors.
-
Q: Can I leave it unattended during execution? A: During execution, you must watch it run. Sometimes it might click on images, chat records, or other things that interrupt the process. You need to click elsewhere to continue, or use Ctrl+C to restart.
-
Q: How to ensure all messages are correctly exported? A: The script automatically processes visible messages but may not handle hidden content. It's recommended to manually scroll to the desired starting position before exporting, and check the output file after the script completes.
-
Q: How to use the exported JSON file? A: The exported JSON file contains structured chat data that can be used for data analysis, backup, or import into other applications. You can use Python's json module or other JSON processing tools to read and process this data.
We welcome and encourage community contributions! If you have any improvement suggestions or have found a bug, please:
- Fork this repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
To maintain the quality and consistency of the project, please follow these guidelines:
- Adhere to the PEP 8 coding standards
- Write unit tests for new features
- Update documentation to reflect your changes
- Keep commit messages concise and clear
This project is licensed under the MIT License. See the LICENSE file for more information.
- Initial release
- Implemented basic QQ chat history export functionality
- Added automatic scrolling and message recognition features
QQ Chat Exporter is an open-source tool designed to help users export their personal chat history. When using this tool, please be aware of the following:
-
Legal Use: This tool is for personal legal use only. Users should ensure they have the right to export chat records and comply with all applicable laws and regulations.
-
Privacy Protection: Please respect others' privacy. Do not export or share others' chat records without permission.
-
Data Security: Exported chat records may contain sensitive information. Users are responsible for properly safeguarding and using this data.
-
Liability Disclaimer: The developers and contributors of this project are not responsible for any direct or indirect losses caused by using this tool, including but not limited to data loss, privacy breaches, or legal disputes.
-
Unofficial Tool: QQ Chat Exporter is not affiliated with Tencent or QQ. It is an independent third-party tool.
-
Risk Assumption: By using this tool, you agree to assume all risks associated with its use.
-
Copyright Notice: This tool does not store or transmit any chat content and only runs on the user's local device. Users should ensure compliance with relevant copyright laws.
-
Technical Limitations: Due to potential QQ updates, the functionality of this tool may be affected. We do not guarantee that the tool will work in all circumstances.
By using this tool, you acknowledge that you have read, understood, and agree to abide by the above disclaimer. If you do not agree to these terms, please do not use this tool.
QQ Chat Exporter is currently in active development. We regularly release updates and bug fixes. Feel free to follow this project for the latest developments.
Like this project? Please give us a ⭐️!