Skip to main content

Gets matching timestamps for multiple streamers from a single twitch clip or timestamp.

Project description

TwitchSync

Syncs twitch clips with other streamers.

Input a twitch clip url, slug, or vod timestamp with a list of streamers, and the program will output a list of timestamped urls for the same moment in each streamer's vod.

$ python -m twitchsync https://www.twitch.tv/thebigmeech/clip/AgreeableNurturingFishPanicVis-g_-jghN2s5rElLpo sgtapollo lisajfc thebigmeech
sgtapollo: https://www.twitch.tv/videos/2448466929?t=2h20m44s
lisajfc: https://www.twitch.tv/videos/2448318187?t=6h0m38s
thebigmeech: https://www.twitch.tv/videos/2448294467?t=6h42m42s

Supported input formats:

  • Clip URL: https://www.twitch.tv/thebigmeech/clip/AgreeableNurturingFishPanicVis-g_-jghN2s5rElLpo
  • Clip slug: AgreeableNurturingFishPanicVis-g_-jghN2s5rElLpo
  • Timestamped vod URL: https://www.twitch.tv/videos/2448294467?t=6h42m42s

Installation

pip install twitchsync

For Mac & Linux there is an easy install script that will install the command to a private venv and symlink it onto your path for easy use. Requires python to be installed.

sh -c "$(curl -fsSL https://raw.githubusercontent.com/SuperRonJon/TwitchSync/master/install-twitchsync-linux.sh)"

Requirements

Requires Python 3.9+

Requires a twitch developer application client id & secret pair.

To get one log into the twitch developer console with your twitch account https://dev.twitch.tv/console Then regester a new application, with category Application Integration and Confidential client type. Redirect url is not relevant, you can fill it out to your website, or this github page, etc.

Then once it is created click Manage -> New Secret and generate a new secret. Save this secret and the Client ID in a text file somewhere you will find them.

The program will ask for these 2 tokens on the first run.

Now the program can be run with:

python -m twitchsync clip_url/slug/vod_timestamp_url streamer1 streamer2 streamer3

On the first run, the program will ask for your twitch application client credentials if it cannot find them. You can enter them here or by passing them as optional arguments on the first run like below.

python -m twitchsync --client_id <token> --client_secret <token>

Once you have set your tokens once the program will store them in a configuration file and you will not need to enter them again.

You can also set up your configuration by setting up environment variables, explained in the following section.

Setting environment variables

This section is optional to have credentials be auto-detected on first run rather than manually enter them in the CLI.

(On Windows: Search->"Edit Environment Variables For Your Account"->New...)

(On Mac/Linux run export TWITCHSYNC_ID=your client id && export TWITCHSYNC_SECRET=your client secret)

TWITCHSYNC_ID=your client id

TWITCHSYNC_SECRET=your client secret

The environment variables do not need to be persistent, the credentials will be saved automatically and managed as necessary from now on.

Now it can be run like this python -m twitchsync clip_url/slug/vod_timestamp streamer1 streamer2 streamer3

Importing as python module

Twitchsync can also be imported as a python module to be used in custom code. An example using credentials from the default config file, same as the instructions above:

from twitchsync import TwitchSync

client = TwitchSync(quiet=True)
clip_url = "https://www.twitch.tv/ladydima/clip/ColorfulIncredulousKumquatDxAbomb-rVq6FZsrpFKfBDIb"
streamer_list = ["thebigmeech", "lt_custard", "ladydima"]

matches = client.get_matches_for_all_streamers(streamer_list, clip_url)
for match in matches:
  print(f"{match["streamer"]}: {match["result"]}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twitchsync-2.1.3.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twitchsync-2.1.3-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file twitchsync-2.1.3.tar.gz.

File metadata

  • Download URL: twitchsync-2.1.3.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.1

File hashes

Hashes for twitchsync-2.1.3.tar.gz
Algorithm Hash digest
SHA256 16e2343d27c3e86b8b4fad87e76067dfa27d387db4a55b1ff6d843fe7efd900f
MD5 f3a43c73218f5a7e601f4a5f49cfb71a
BLAKE2b-256 b6d20a380200cd816c3396510440220d3ac10b20a0b8caf964dbc7a49431acf1

See more details on using hashes here.

File details

Details for the file twitchsync-2.1.3-py3-none-any.whl.

File metadata

  • Download URL: twitchsync-2.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.1

File hashes

Hashes for twitchsync-2.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f1fe7be25aba2ea6a2da95e51b4e0dca96208e0aa1b0ba98e8e6c6dbd46c52ff
MD5 a1852e1f5fb936c69918b8d12af924b5
BLAKE2b-256 0045818b887c088fe8ff7b1c0dfff22c65a1c60f8bdfeb3a28fd62e6682fda7c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page