All Projects → offish → twitchtube

offish / twitchtube

Licence: MIT license
Twitch YouTube bot. Automatically make video compilations of the most viewed Twitch clips and upload them to YouTube using Python 3.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to twitchtube

glitch
!NO MORE MAINTAINED! Reactive API Wrapper for Twitch in Kotlin/JVM
Stars: ✭ 12 (-96.98%)
Mutual labels:  twitch, twitch-tv, twitch-bot, twitch-api
Twitch-Clips-Compilation-Generator-TCCG-
A system of 3 programs that collects clips automatically from Twitch, lets you edit videos and combine clips, and puts them together into a compilation video ready to be uploaded straight to any social media platform. Full VPS support is provided, along with an accounts system so multiple users can use the bot at once.
Stars: ✭ 67 (-83.17%)
Mutual labels:  youtube-video, twitch-bot, twitch-api, twitch-clips
TwitchLink
Twitch Stream & Video & Clip Downloader.
Stars: ✭ 24 (-93.97%)
Mutual labels:  twitch, twitch-api, twitch-videos, twitch-clips
TwitchBot
Custom C# chat bot for Twitch TV
Stars: ✭ 33 (-91.71%)
Mutual labels:  twitch, twitch-tv, twitch-bot, twitch-api
Twitch-View-Bot
First open-source really working view bot for Twitch
Stars: ✭ 63 (-84.17%)
Mutual labels:  twitch, twitch-bot, twitch-api-v5, twitch-api
music-id
🚀 Music ID for Twitch (TwitchMusicID) is a Chatbot which automatically identifies music in the background of Twitch Streams, VODs, and Clips.
Stars: ✭ 49 (-87.69%)
Mutual labels:  twitch, twitch-bot, twitch-api
TwitchMarkovChain
Twitch Bot for generating messages based on what it learned from chat
Stars: ✭ 87 (-78.14%)
Mutual labels:  twitch, twitchbot, twitch-bot
PythonTwitchBotFramework
asynchronous twitchbot framework made in pure python
Stars: ✭ 78 (-80.4%)
Mutual labels:  twitch, twitch-bot, twitch-api
TwitchPy
This is a package you can use to connect with the Twitch API, manage a channel, create bots, etc
Stars: ✭ 22 (-94.47%)
Mutual labels:  twitch, twitch-bot, twitch-api
pyTwitchAPI
A Python 3.7 implementation of the Twitch API, EventSub and PubSub
Stars: ✭ 132 (-66.83%)
Mutual labels:  twitch, twitch-tv, twitch-api
Harmonbot
Multi-Platform Factotum Bot
Stars: ✭ 30 (-92.46%)
Mutual labels:  twitch, twitchbot, twitch-bot
nginx-obs-automatic-low-bitrate-switching
Simple app to automatically switch scenes in OBS based on the current bitrate fetched from the NGINX stats page.
Stars: ✭ 167 (-58.04%)
Mutual labels:  twitch, twitch-bot
meme-box
Manage and trigger media in OBS as a browser source
Stars: ✭ 82 (-79.4%)
Mutual labels:  twitch, twitch-api
twitch-vod-chat
No description or website provided.
Stars: ✭ 20 (-94.97%)
Mutual labels:  twitch, twitch-tv
supibot
Multiplatform, utility & novelty chat bot.
Stars: ✭ 77 (-80.65%)
Mutual labels:  twitch, twitch-bot
twitch-extension-github
🚀 Show your Github profile on your twitch channel!
Stars: ✭ 48 (-87.94%)
Mutual labels:  twitch, twitch-api
vulcan
Server-less Twitch chat-bot using Azure functions & transient containers
Stars: ✭ 23 (-94.22%)
Mutual labels:  twitch, twitch-bot
Pocket-Plays-for-Twitch
Open source Twitch client for Android
Stars: ✭ 55 (-86.18%)
Mutual labels:  twitch, twitch-tv
twitch-graphql-api
KomodoHype
Stars: ✭ 78 (-80.4%)
Mutual labels:  twitch, twitch-api
Firebot
A powerful all-in-one bot for Twitch streamers
Stars: ✭ 162 (-59.3%)
Mutual labels:  twitch, twitch-bot

twitchtube

License Stars Issues Size Discord Code style

Donate Steam Donate PayPal

Automatically make video compilations of the most viewed Twitch clips, and upload them to YouTube using Python 3.

Usage

Example of making a video through terminal

python main.py --data "g Just Chatting, c xQcOW, c Trainwreckstv" --client_id "1hq8ektpki36w5kn37mluioungyqjo" --oauth_token "9f5einm9qtp0bj4m9l1ykevpwdn98o" --duration 10.5 --resolution 1080 1920 --title "Top Just Chatting, xQc and Trainwrecks Twitch Clips Today" --tags "xqc, trainwrecks, twitch clips, xqc twitch, trainwrecks twitch"

g indicates game, c indicates channel. You can also use channel and game.

Every parameter that is not specified, will default to an assigned value in config.py.

Example of running with only default values:

python main.py

config.py:

DATA = ["channel maskenissen"]

CLIENT_ID = "1hq8ektpki36w5kn37mluioungyqjo"  # Twitch Client ID
OAUTH_TOKEN = "9f5einm9qtp0bj4m9l1ykevpwdn98o"  # Twitch OAuth Token
PERIOD = 24  # day, week, month or all
LANGUAGE = "en"  # en, es, th etc.
LIMIT = 100  # 1-100
...

You can also run the bot from a Python file like example.py

from time import sleep
from twitchtube.video import make_video
from twitchtube.utils import get_path

while True:
    make_video(
        data=["channel xQcOW", "game Just Chatting"],
        path=get_path(),
        client_id="1hq8ektpki36w5kn37mluioungyqjo",  # example client id (fake)
        oauth_token="9f5einm9qtp0bj4m9l1ykevpwdn98o",  # example token (fake)
        video_length=10.5, # minutes as float
        resolution=(1080, 1920), # height x width
        frames=60,
        period=24, # most viewed clips today
    )
    sleep(24 * 60 * 60) # make a video daily

These are all the parameters make_video takes

def make_video(
    data: list = DATA,
    blacklist: list = BLACKLIST,
    # other
    path: str = get_path(),
    check_version: bool = CHECK_VERSION,
    # twitch
    client_id: str = CLIENT_ID,
    oauth_token: str = OAUTH_TOKEN,
    period: int = PERIOD,
    language: str = LANGUAGE,
    limit: int = LIMIT,
    # selenium
    profile_path: str = ROOT_PROFILE_PATH,
    sleep: int = SLEEP,
    headless: bool = HEADLESS,
    debug: bool = DEBUG,
    # video options
    render_video: bool = RENDER_VIDEO,
    file_name: str = FILE_NAME,
    resolution: tuple = RESOLUTION,
    frames: int = FRAMES,
    video_length: float = VIDEO_LENGTH,
    resize_clips: bool = RESIZE_CLIPS,
    enable_intro: bool = ENABLE_INTRO,
    resize_intro: bool = RESIZE_INTRO,
    intro_path: str = INTRO_FILE_PATH,
    enable_transition: bool = ENABLE_TRANSITION,
    resize_transition: bool = RESIZE_TRANSITION,
    transition_path: str = TRANSITION_FILE_PATH,
    enable_outro: bool = ENABLE_OUTRO,
    resize_outro: bool = RESIZE_OUTRO,
    outro_path: str = OUTRO_FILE_PATH,
    # other options
    save_file: bool = SAVE_TO_FILE,
    save_file_name: str = SAVE_FILE_NAME,
    upload_video: bool = UPLOAD_TO_YOUTUBE,
    delete_clips: bool = DELETE_CLIPS,
    # youtube
    title: str = TITLE,
    description: str = DESCRIPTION,
    thumbnail: str = THUMBNAIL,
    tags: list = TAGS,
) -> None:
    ...

Information about every parameter can be found in config.py.

Installation

Download the repo as ZIP and unzip it somewhere accessible, or use git.

To install all the packages needed, you have to run this command, by being in the same directory as the requirements.txt and main.py files are.

pip install -r requirements.txt 

Download geckodriver and add it to PATH. If you are on Windows you can follow this post.

You can now check if it works by running this command in the terminal:

geckodriver --version

If geckodriver has been added to PATH, you should now see the current version number and some licensing text.

Configuration

Creating your Twitch Application

image

Go to https://dev.twitch.tv/console/apps/create and register a new application. The name of the application does not matter. Set "OAuth Redirect URLs" to https://twitchapps.com/tokengen/

Set category to "Application Integration" or "Other".

image

Click "Manage".

image

Copy the Client ID and go to config.py. Find CLIENT_ID and paste it inside apostrophes.

Getting your OAuth Token

image

Now head over to https://twitchapps.com/tokengen/ and paste in your Client ID, which you just copied. Scopes does not matter in our case. Click "Connect" and then authorize with Twitch.

image

Copy your OAuth Token and go to config.py, find OAUTH_TOKEN and paste it inside the apostrophes.

Setting up Firefox

Open Firefox and create a new profile for Selenium, (this is not needed, but highly recommended). Go to about:profiles and click "Create a New profile", name it "Selenium" or whatever.

image

Copy the "Root Directory" path of that profile and paste it into the ROOT_PROFILE_PATH in config.py. Now click "Launch profile in new browser". Go to YouTube and login to the account you want to use with twitchtube.

Don't use Selenium as your default profile.

You can now save your config.

Troubleshooting

Uploading

If you're having issues uploading try to update opplast.

pip install --upgrade opplast

Sometimes YouTube is weird, so trying multiple times might work. Set debug=True and headless=False to see what it's actually doing. Increasing sleep might also work. If you have configured everything correctly, and are still running into errors, leave a detailed issue here.

License

MIT License

Copyright (c) 2020 offish

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].