{"id":13758491,"url":"https://github.com/offish/twitchtube","last_synced_at":"2025-10-06T00:28:39.559Z","repository":{"id":37249489,"uuid":"260781021","full_name":"offish/twitchtube","owner":"offish","description":"Twitch YouTube bot. Automatically make video compilations of the most viewed Twitch clips and upload them to YouTube using Python 3.","archived":false,"fork":false,"pushed_at":"2023-04-03T12:06:43.000Z","size":306,"stargazers_count":562,"open_issues_count":17,"forks_count":77,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-03-28T20:08:49.994Z","etag":null,"topics":["selenium","twitch","twitch-api","twitch-api-v5","twitch-bot","twitch-clips","twitch-streamers","twitch-tv","twitch-videos","twitchbot","youtube","youtube-api","youtube-bot","youtube-scraper","youtube-upload","youtube-video","youtubebot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/offish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://paypal.me/0ffish","https://steamcommunity.com/tradeoffer/new/?partner=293059984\u0026token=0-l_idZR"]}},"created_at":"2020-05-02T21:47:52.000Z","updated_at":"2025-03-08T02:44:57.000Z","dependencies_parsed_at":"2024-01-15T03:42:52.265Z","dependency_job_id":null,"html_url":"https://github.com/offish/twitchtube","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offish%2Ftwitchtube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offish%2Ftwitchtube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offish%2Ftwitchtube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offish%2Ftwitchtube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/offish","download_url":"https://codeload.github.com/offish/twitchtube/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249530,"owners_count":20908212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["selenium","twitch","twitch-api","twitch-api-v5","twitch-bot","twitch-clips","twitch-streamers","twitch-tv","twitch-videos","twitchbot","youtube","youtube-api","youtube-bot","youtube-scraper","youtube-upload","youtube-video","youtubebot"],"created_at":"2024-08-03T13:00:31.171Z","updated_at":"2025-10-06T00:28:34.518Z","avatar_url":"https://github.com/offish.png","language":"Python","funding_links":["https://paypal.me/0ffish","https://steamcommunity.com/tradeoffer/new/?partner=293059984\u0026token=0-l_idZR","https://www.paypal.me/0ffish"],"categories":["Libraries"],"sub_categories":["Python"],"readme":"# twitchtube\n[![License](https://img.shields.io/github/license/offish/twitchtube.svg)](https://github.com/offish/twitchtube/blob/master/LICENSE)\n[![Stars](https://img.shields.io/github/stars/offish/twitchtube.svg)](https://github.com/offish/twitchtube/stargazers)\n[![Issues](https://img.shields.io/github/issues/offish/twitchtube.svg)](https://github.com/offish/twitchtube/issues)\n[![Size](https://img.shields.io/github/repo-size/offish/twitchtube.svg)](https://github.com/offish/twitchtube)\n[![Discord](https://img.shields.io/discord/467040686982692865?color=7289da\u0026label=Discord\u0026logo=discord)](https://discord.gg/t8nHSvA)\n[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n[![Donate Steam](https://img.shields.io/badge/donate-steam-green.svg)](https://steamcommunity.com/tradeoffer/new/?partner=293059984\u0026token=0-l_idZR)\n[![Donate PayPal](https://img.shields.io/badge/donate-paypal-blue.svg)](https://www.paypal.me/0ffish)\n\nAutomatically make video compilations of the most viewed Twitch clips, and upload them to YouTube using Python 3. \n\n### twitchtube is currently being rewritten, which will include breaking changes\nFollow the changes [here](https://github.com/offish/twitchtube/tree/v2.0.0).\n\n## Usage\nExample of making a video through terminal\n```python\npython 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\"\n```\n`g` indicates game, `c` indicates channel. You can also use `channel` and `game`.\n\n**Every parameter that is not specified, will default to an assigned value in [`config.py`](twitchtube/config.py).**\n\nExample of running with only default values:\n\n```text\npython main.py\n```\n\n[`config.py`](twitchtube/config.py):\n```python\nDATA = [\"channel maskenissen\"]\n\nCLIENT_ID = \"1hq8ektpki36w5kn37mluioungyqjo\"  # Twitch Client ID\nOAUTH_TOKEN = \"9f5einm9qtp0bj4m9l1ykevpwdn98o\"  # Twitch OAuth Token\nPERIOD = 24  # day, week, month or all\nLANGUAGE = \"en\"  # en, es, th etc.\nLIMIT = 100  # 1-100\n...\n```\n\nYou can also run the bot from a Python file like [`example.py`](example.py)\n```python\nfrom time import sleep\nfrom twitchtube.video import make_video\nfrom twitchtube.utils import get_path\n\nwhile True:\n    make_video(\n        data=[\"channel xQcOW\", \"game Just Chatting\"],\n        path=get_path(),\n        client_id=\"1hq8ektpki36w5kn37mluioungyqjo\",  # example client id (fake)\n        oauth_token=\"9f5einm9qtp0bj4m9l1ykevpwdn98o\",  # example token (fake)\n        video_length=10.5, # minutes as float\n        resolution=(1080, 1920), # height x width\n        frames=60,\n        period=24, # most viewed clips today\n    )\n    sleep(24 * 60 * 60) # make a video daily\n```\n\nThese are all the parameters `make_video` takes\n```python\ndef make_video(\n    data: list = DATA,\n    blacklist: list = BLACKLIST,\n    # other\n    path: str = get_path(),\n    check_version: bool = CHECK_VERSION,\n    # twitch\n    client_id: str = CLIENT_ID,\n    oauth_token: str = OAUTH_TOKEN,\n    period: int = PERIOD,\n    language: str = LANGUAGE,\n    limit: int = LIMIT,\n    # selenium\n    profile_path: str = ROOT_PROFILE_PATH,\n    sleep: int = SLEEP,\n    headless: bool = HEADLESS,\n    debug: bool = DEBUG,\n    # video options\n    render_video: bool = RENDER_VIDEO,\n    file_name: str = FILE_NAME,\n    resolution: tuple = RESOLUTION,\n    frames: int = FRAMES,\n    video_length: float = VIDEO_LENGTH,\n    resize_clips: bool = RESIZE_CLIPS,\n    enable_intro: bool = ENABLE_INTRO,\n    resize_intro: bool = RESIZE_INTRO,\n    intro_path: str = INTRO_FILE_PATH,\n    enable_transition: bool = ENABLE_TRANSITION,\n    resize_transition: bool = RESIZE_TRANSITION,\n    transition_path: str = TRANSITION_FILE_PATH,\n    enable_outro: bool = ENABLE_OUTRO,\n    resize_outro: bool = RESIZE_OUTRO,\n    outro_path: str = OUTRO_FILE_PATH,\n    # other options\n    save_file: bool = SAVE_TO_FILE,\n    save_file_name: str = SAVE_FILE_NAME,\n    upload_video: bool = UPLOAD_TO_YOUTUBE,\n    delete_clips: bool = DELETE_CLIPS,\n    # youtube\n    title: str = TITLE,\n    description: str = DESCRIPTION,\n    thumbnail: str = THUMBNAIL,\n    tags: list = TAGS,\n) -\u003e None:\n    ...\n```\nInformation about every parameter can be found in [`config.py`](twitchtube/config.py).\n\n## Installation\nDownload the repo as ZIP and unzip it somewhere accessible, or use git.\n\nTo 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.\n\n```\npip install -r requirements.txt \n```\n\nDownload [geckodriver](https://github.com/mozilla/geckodriver/releases) and add it to PATH. If you are on Windows you can follow [this post](https://softwaretestingboard.com/q2a/2366/how-to-set-geckodriver-into-path-environment-variable).\n\nYou can now check if it works by running this command in the terminal:\n```text\ngeckodriver --version\n```\nIf geckodriver has been added to PATH, you should now see the current version number and some licensing text.\n\n## Configuration\n### Creating your Twitch Application\n![image](https://user-images.githubusercontent.com/30203217/115958371-7e76c880-a507-11eb-8748-7bbc5f497a68.png)\n\nGo to https://dev.twitch.tv/console/apps/create and register a new application.\nThe name of the application does not matter. Set \"OAuth Redirect URLs\" to https://twitchapps.com/tokengen/\n\nSet category to \"Application Integration\" or \"Other\". \n\n\n![image](https://user-images.githubusercontent.com/30203217/115958430-cbf33580-a507-11eb-963e-14a7dccbfd7d.png)\n\nClick \"Manage\".\n\n![image](https://user-images.githubusercontent.com/30203217/115958485-eb8a5e00-a507-11eb-98f8-c01b4dabd163.png)\n\nCopy the Client ID and go to [`config.py`](twitchtube/config.py). \nFind `CLIENT_ID` and paste it inside apostrophes.\n\n### Getting your OAuth Token\n![image](https://user-images.githubusercontent.com/30203217/115958569-402dd900-a508-11eb-8464-676b927acff5.png)\n\nNow head over to https://twitchapps.com/tokengen/ and paste in your Client ID, which you just copied.\nScopes does not matter in our case. Click \"Connect\" and then authorize with Twitch.\n\n![image](https://user-images.githubusercontent.com/30203217/115958582-5b004d80-a508-11eb-8e29-91669c71e987.png)\n\nCopy your OAuth Token and go to [`config.py`](twitchtube/config.py), find `OAUTH_TOKEN` and paste it inside the apostrophes.\n\n### Setting up Firefox\n\nOpen 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. \n\n![image](https://user-images.githubusercontent.com/30203217/115958696-c0543e80-a508-11eb-9d76-6ef5fd33e889.png)\n\nCopy the \"Root Directory\" path of that profile and paste it into the `ROOT_PROFILE_PATH` in [`config.py`](twitchtube/config.py). Now click \"Launch profile in new browser\". Go to [YouTube](https://youtube.com) and login to the account you want to use with twitchtube.\n\n\n*Don't use Selenium as your default profile.* \n\nYou can now save your `config`.\n\n## Troubleshooting\n### Uploading\nIf you're having issues uploading try to update [opplast](https://github.com/offish/opplast).\n```\npip install --upgrade opplast\n```\nSometimes YouTube is weird, so trying multiple times *might* work. \nSet `debug=True` and `headless=False` to see what it's actually doing. Increasing `sleep` *might* also work. \nIf you have configured everything correctly, and are still running into errors, leave a detailed issue [here](https://github.com/offish/opplast/issues).\n\n## License\nMIT License\n\nCopyright (c) 2020 [offish](https://offi.sh)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffish%2Ftwitchtube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffish%2Ftwitchtube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffish%2Ftwitchtube/lists"}