Metadata-Version: 2.1
Name: tvod
Version: 2.0.1
Summary: A package to retrieve Twitch VOD
Home-page: https://gitlab.com/jjocram/twitch-vod
License: GPL-3.0-or-later
Author: Marco Ferrati
Author-email: marco.ferrati@protonmail.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3
Requires-Dist: requests (>=2.28.0,<3.0.0)
Project-URL: Bug Tracker, https://gitlab.com/jjocram/twitch-vod/-/issues
Project-URL: Repository, https://gitlab.com/jjocram/twitch-vod
Description-Content-Type: text/markdown

# Twitch VOD
Tool to retrieve Twitch's VOD from the video ID

## Install
This package is published on PyPi at this [link](https://pypi.org/project/tvod/). Up to you choose how to install it. 

## Use as is
1. a `client_id` and a `client_secret` are required in order to use this tool. Check [here](https://dev.twitch.tv/console) on how to get them. Set them as environment variables:
  - `export client_id=<YOUR CLIENT ID>`
  - `export client_secret=<YOUR CLIENT SECRET>`

2. Execute the tool from a terminal 
```bash
tvod
```

3. It will ask the video ID (you can find it in twitch's video page). In this (`https://www.twitch.tv/videos/1234567890`) case the ID is `1234567890`

4. It will ask at which resolution watch

5. It will use your browser to watch it.

## Use as package
You can import it in your python script. The available methods are:
- `get_video_info(video_id, video_info_error_handler)`
  - `video_id`: is the id of the twich vod you want to retrieve the info
  - `video_info_error_handler`: is a function (a lambda is good) that will be called if something goes wrong
  - returns the `url` to pass to the fuction `get_video_url`
- `get_video_url(animated_preview_url, resolution_name)`
  - `animated_preview_url`: is the returned url by `get_video_info`
  - `resolution_name`: is the key of the chosen resolution. Some examples are:
    - 360p60
    - 720p60
    - ...
  - return the url to the video at the chosen resolution

