Welcome to the TripleX repository! This project provides tools for downloading videos from supported websites and processing them using utilities like scene detection and trimming.
Reddit: https://www.reddit.com/r/NSFW_API
Discord: https://discord.gg/bW4Bhkfk
TripleX is designed to help users download videos from supported websites and perform various processing tasks such as scene detection and trimming unwanted frames. The toolkit is modular, allowing for easy addition of new downloaders and utilities.
- Video Downloaders: Currently supports downloading videos from xHamster. Designed to be extensible for other sites.
- Scene Detection: Uses PySceneDetect to split videos into individual scenes.
- Frame Trimming: Trims a specified number of frames from the beginning of videos.
- Modular Utilities: Easily add new utilities or downloaders to extend functionality.
.
├── downloaders
│ └── download_xhamster.py
├── outputs
│ └── video
├── requirements.txt
└── utils
├── split_by_scene.py
└── trim_frame_beginning.py
- downloaders/: Contains scripts for downloading videos from supported websites.
- outputs/: Default directory where videos and processed outputs are saved.
- video/: Contains downloaded videos and processed scenes.
- requirements.txt: Lists the Python dependencies required for the project.
- utils/: Contains utility scripts for processing videos.
-
Clone the Repository
git clone https://github.com/NSFW-API/TripleX.git cd triplex
-
Create a Virtual Environment
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt
-
Install FFmpeg
-
macOS:
brew install ffmpeg
-
Ubuntu/Debian:
sudo apt-get install ffmpeg
-
Windows:
- Download FFmpeg from the official website.
- Add FFmpeg to your system PATH.
-
The download_xhamster.py
script allows you to download videos from xHamster.
Note: Ensure you comply with all legal requirements and terms of service when downloading content.
Example Usage:
python downloaders/download_xhamster.py <video_url>
- Replace
<video_url>
with the actual URL of the xHamster video.
Instructions:
-
Run the Script:
python downloaders/download_xhamster.py <video_url>
-
The Video will be downloaded to
outputs/video
.- The script automatically saves the downloaded video in the
outputs/video
directory. - No additional input is required after providing the URL.
- The script automatically saves the downloaded video in the
The split_by_scene.py
script splits all videos in outputs/video
into scenes based on content detection.
Example Usage:
python utils/split_by_scene.py
Instructions:
-
Run the Script:
python utils/split_by_scene.py
-
Processing:
- The script processes all videos in
outputs/video
. - For each video, it creates a subdirectory within
outputs/video
named after the video file (without extension). - The split scenes are saved in the respective subdirectories.
- The script processes all videos in
Notes:
-
Content Detection Parameters:
- The script uses default parameters for scene detection (
threshold=30.0
,min_scene_len=15
). - If you wish to adjust these parameters, you can modify the default values directly in the script.
- The script uses default parameters for scene detection (
The trim_frame_beginning.py
script trims a specified number of frames from the beginning of all videos in outputs/video
and its subdirectories.
Example Usage:
python utils/trim_frame_beginning.py [num_frames]
[num_frames]
(optional): The number of frames to trim from the beginning of each video. If not provided, the default is5
.
Instructions:
-
Run the Script:
-
To trim a specific number of frames:
python utils/trim_frame_beginning.py 10
- This command trims
10
frames from the beginning of each video.
- This command trims
-
To use the default number of frames (5):
python utils/trim_frame_beginning.py
-
-
Processing:
- The script processes all videos in
outputs/video
and its subdirectories. - Overwrites the original video files after trimming.
- The script processes all videos in
Notes:
- Backup: Be cautious when overwriting files. It's recommended to keep backups if you might need the original files later.
- Adjusting the Default Number of Frames: If you frequently use a different number of frames, you can change the default value directly in the script.
Contributions are welcome! You can contribute to this project in the following ways:
-
Create a New Downloader Script: Follow the structure of
download_xhamster.py
to create a downloader for another site. -
Place the Script in the
downloaders/
Directory. -
Testing: Thoroughly test your script to ensure it works reliably.
-
Documentation: Update the README with instructions on how to use your new downloader.
-
Submit a Pull Request: Once you're ready, submit a pull request for review.
-
Create a New Utility Script: Develop your utility and place it in the
utils/
directory. -
Explain the Utility: Provide clear instructions and examples on how to use your utility.
-
Dependencies: If your utility requires additional Python packages, update
requirements.txt
. -
Submit a Pull Request: Include information about the utility and its usage in your pull request.
-
Fork the Repository: Click the "Fork" button at the top-right corner of the repository page.
-
Clone Your Fork:
git clone https://github.com/NSFW-API/TripleX.git
-
Create a New Branch:
git checkout -b feature/new-downloader
-
Make Your Changes: Add your downloader or utility script.
-
Commit Your Changes:
git add . git commit -m "Add new downloader for ExampleSite"
-
Push to Your Fork:
git push origin feature/new-downloader
-
Open a Pull Request: Go to the original repository and click "New Pull Request."
This project is licensed under the MIT License. See the LICENSE file for details.
-
Legal Compliance: This toolkit is intended for educational and personal use. Users are responsible for ensuring they comply with all applicable laws, regulations, and terms of service of the websites they interact with.
-
Content Rights: Downloading and distributing copyrighted material without permission may infringe on intellectual property rights.
-
Adult Content: Some downloaders may interact with websites containing adult content. Users should be aware of and comply with all legal age restrictions and content regulations in their jurisdiction.
-
No Liability: The authors and contributors of this project are not liable for any misuse of the toolkit.
Thank you for using TripleX!
If you have any questions or need assistance, feel free to open an issue on the repository or reach out to the maintainers.
-
Logging: The
download_xhamster.py
script logs its activities toxhamster_downloader.log
in the project root directory. You can check this log file for detailed information in case of errors. -
Error Handling: The scripts include basic error handling to inform you of issues that may arise during processing. For more robust error handling, consider adding try-except blocks where appropriate.
-
Dependencies: Ensure that all dependencies listed in
requirements.txt
are installed in your virtual environment. If you encounter issues, double-check that all required packages are installed.
# requirements.txt
requests
scenedetect
beautifulsoup4
-
FFmpeg: FFmpeg is a crucial dependency for video processing in this toolkit. Ensure that it is correctly installed and accessible from your system's PATH.
-
Python Version: This toolkit is developed for Python 3.x. Ensure you are using a compatible version of Python.
- Maintainer: NSFW API
- Email: [email protected]
- GitHub Issues: Please report any issues or bugs by opening an issue on the repository.
Feel free to reach out if you need any further assistance or have suggestions for improving the toolkit!