https://github.com/chfoo/ttvsnap
Save Twitch screenshots using Twitch API preview thumbnails
https://github.com/chfoo/ttvsnap
Last synced: 9 months ago
JSON representation
Save Twitch screenshots using Twitch API preview thumbnails
- Host: GitHub
- URL: https://github.com/chfoo/ttvsnap
- Owner: chfoo
- License: mit
- Created: 2015-12-23T06:02:02.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-05-06T19:52:14.000Z (almost 6 years ago)
- Last Synced: 2025-04-03T11:43:49.500Z (11 months ago)
- Language: Python
- Size: 15.6 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ttvsnap
=======
Ttvsnap is script that will periodically save Twitch.tv screenshots using Twitch API preview thumbnails.
Usage
=====
You will need Python 3.3+.
To start the script, run something similar to this:
python3 ttvsnap.py verycoolstreamer ./screenshots/ --client-id YOUR_CLIENT_ID_HERE --client-secret-file FILENAME_TO_A_TEXT_FILE_WITH_CLIENT_SECRET --cache-dir PATH_TO_A_DIRECTORY_FOR_TEMP_SECRETS
(Replace `python3` as needed, `python.exe` for example.)
The script will check every ~5 minutes and save the screenshot to the given directory. For streams that run 24/7, you can use the `--subdir` option to create a directory for each day.
As a convenience, it supports generating thumbnails using ImageMagick. Ensure that the `convert` command exists and add the `--thubmnail` option.
For the list of options, use the `--help` option.
Tips
----
If you are using this script for a website of some sort, you may want to look into some daemon service management tools to restart it if it crashes. On Linux, look into creating Upstart or Systemd configuration files for it.
As of writing, Twitch caches preview images for 5 minutes so setting it to low values such as 1 minute may be useless. However, the script will use the `If-Modified-Since` HTTP header to avoid downloading images repeatedly.
Client ID is required after 2016-08-08. You can get a Client ID in the Dev Console page by registering an application and using the Client ID for personal use. Client secret is required after 2020-04-30. Click generate new secret and keep the secret in a safe place.