Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zigai/twitch-scraper
Twitch clip/profile scraper
https://github.com/zigai/twitch-scraper
twitch twitch-api twitch-api-helix twitch-bot twitch-clips twitch-scraper
Last synced: 3 months ago
JSON representation
Twitch clip/profile scraper
- Host: GitHub
- URL: https://github.com/zigai/twitch-scraper
- Owner: zigai
- License: mit
- Created: 2022-07-20T08:26:01.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-02T21:55:34.000Z (4 months ago)
- Last Synced: 2024-11-01T15:36:37.958Z (3 months ago)
- Topics: twitch, twitch-api, twitch-api-helix, twitch-bot, twitch-clips, twitch-scraper
- Language: Python
- Homepage:
- Size: 68.4 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Twitch scraper
Twitch clip/profile scraper.
Twitch API credentials are required.# Installation
```
pip install git+https://github.com/zigai/twitch-scraper.git
```
# CLI usage
```
usage: twitch-scraper [-h] {clips,profiles} ...
_ _ _ _
| |___ _(_) |_ ___| |__ ___ ___ _ __ __ _ _ __ ___ _ __
| __\ \ /\ / / | __/ __| '_ \ / __|/ __| '__/ _` | '_ \ / _ \ '__|
| |_ \ V V /| | || (__| | | | \__ \ (__| | | (_| | |_) | __/ |
\__| \_/\_/ |_|\__\___|_| |_| |___/\___|_| \__,_| .__/ \___|_|
|_|positional arguments:
{clips,profiles}options:
-h, --help show this help message and exitcommands:
clips Scrape Twitch.tv clips
profiles Scrape Twitch.tv user profile
``````
usage: twitch-scraper clips [-h] -s -c -b [-v] [-d] [-ca] [-u] [-g] [-st] [-e] [-l]Scrape Twitch.tv clips
options:
-h, --help show this help message and exit
-s, --save-dir directory to save files | str (*)
-c, --client-id twitch.tv client ID | str (*)
-b, --bearer twitch.tv bearer token | str (*)
-v, --verbose print status messages | bool = True
-d, --delay delay between requests (seconds) | float = 0.5
-ca, --cache path to cache file. cache is used to avoid duplicate requests | str
-u, --username username of the streamer | str
-g, --game name of the game | str
-st, --started-at
Starting date/time | datetime
-e, --ended-at Ending date/time | datetime
-l, --limit Number of clips to scrape | int = 1000
``````
usage: twitch-scraper profiles [-h] -s -c -b [-v] [-d] [-ca] -uScrape Twitch.tv user profiles
options:
-h, --help show this help message and exit
-s, --save-dir directory to save files | str (*)
-c, --client-id twitch.tv client ID | str (*)
-b, --bearer twitch.tv bearer token | str (*)
-v, --verbose print status messages | bool = True
-d, --delay delay between requests (seconds) | float = 0.5
-ca, --cache path to cache file | str
-u, --usernames usernames of profiles to scrape | list[str] (*)
```# Library usage
```python
from datetime import datetime, timedelta
from twitch_scraper import TwitchScraperscraper = TwitchScraper(
save_dir="./clips",
client_id=...,
bearer=...,
)today = datetime.today()
scraper.clips(
game="League of Legends",
started_at=today - timedelta(days=7),
ended_at=today,
limit=50,
)
```# License
[MIT License](https://github.com/zigai/twitch-scraper/blob/master/LICENSE)