{"id":15723655,"url":"https://github.com/matteopolak/tcd","last_synced_at":"2025-09-06T18:33:59.674Z","repository":{"id":62969326,"uuid":"563533768","full_name":"matteopolak/tcd","owner":"matteopolak","description":"Twitch chat downloader CLI and GUI.","archived":false,"fork":false,"pushed_at":"2022-12-19T00:45:47.000Z","size":739,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T06:29:04.455Z","etag":null,"topics":["archive","chat","cli","download","downloader","gui","iced","postgresql","prisma","rust","tcd","twitch","twitch-chat-downloader"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matteopolak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-08T20:13:59.000Z","updated_at":"2025-03-26T17:01:49.000Z","dependencies_parsed_at":"2023-01-29T20:10:12.975Z","dependency_job_id":null,"html_url":"https://github.com/matteopolak/tcd","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteopolak%2Ftcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteopolak%2Ftcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteopolak%2Ftcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteopolak%2Ftcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matteopolak","download_url":"https://codeload.github.com/matteopolak/tcd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253877362,"owners_count":21977634,"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":["archive","chat","cli","download","downloader","gui","iced","postgresql","prisma","rust","tcd","twitch","twitch-chat-downloader"],"created_at":"2024-10-03T22:12:41.579Z","updated_at":"2025-05-13T04:36:48.571Z","avatar_url":"https://github.com/matteopolak.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twitch Chat Downloader 🗒️\n\n![Build Status](https://github.com/matteopolak/tcd/actions/workflows/build.yml/badge.svg)\n![Release Status](https://github.com/matteopolak/tcd/actions/workflows/release.yml/badge.svg)\n[![License:GPLv3](https://img.shields.io/badge/license-GPL--3.0-yellow.svg)](https://opensource.org/licenses/GPL-3.0)\n[![Rust:Nightly](https://img.shields.io/badge/rust-nightly-blue.svg)](https://www.rust-lang.org/tools/install)\n\n[tcd](https://github.com/matteopolak/tcd) is a multi-threaded **T**witch **C**hat **D**ownloader built in Rust 🦀.\n\n```powershell\nUsage: tcd [OPTIONS] \u003c--channel \u003cCHANNEL\u003e|--video \u003cVIDEO\u003e\u003e\n\nOptions:\n  -c, --channel \u003cCHANNEL\u003e      The channel(s) to download\n  -i, --client-id \u003cCLIENT_ID\u003e  The Twitch client ID to use in the request headers\n  -f, --format \u003cFORMAT\u003e        Used with --output or --stdout [default: csv] [possible values: csv, jsonl]\n  -l, --limit \u003cLIMIT\u003e          Downloads the first n videos from each channel\n  -e, --live                   If specified, polls for new videos every `poll` seconds\n  -o, --output \u003cOUTPUT\u003e        If specified, pipes data to the file\n  -p, --postgres [\u003cPOSTGRES\u003e]  The PostgreSQL connection string [default: DATABASE_URL env]\n  -q, --quiet                  Whether to print download progress\n  -s, --stdout                 If specified, pipes data to stdout\n  -t, --threads \u003cTHREADS\u003e      The number of threads to use [default: 10]\n  -v, --video \u003cVIDEO\u003e          The video ids to download the chat for\n  -w, --wait \u003cWAIT\u003e            The number of minutes to wait between polls (`live` only) [default: 30]\n  -h, --help                   Print help information\n  -V, --version                Print version information\n```\n\nPipe the chat messages of the first 5 videos of `Atrioc`, `Linkus7` and `Aspecticor` to the file `hitman.csv`\n\n```powershell\ntcd --channel atrioc --channel linkus7 --channel aspecticor --limit 5 --output hitman.csv\n```\n\nSave the chat from the videos with id `1649326959` and `1648474855` to the connected PostgreSQL database.\n\n```powershell\ntcd --video 1649326959 --video 1648474855 --postgres\n```\n\n## Building from source\n\n```bash\n# build the binary\ncargo build --release\n\n# execute the binary\ntarget/release/tcd --help\n```\n\n## Generating datasets\n\nSome pre-made dataset scripts are located in the [queries](./queries) directory.\nYou can run these with `cargo run -p queries --example \u003cname\u003e`.\n\n## Using pre-made datasets\n\nPre-made datasets can be downloaded from [the Mediafire folder](https://www.mediafire.com/folder/agnhlbxz0q5zw/datasets).\n\n## Piping data to a database\n\n`tcd` supports saving data directly to a PostgreSQL database.\nFirst, apply the Prisma schema with the following commands:\n\n```bash\n# apply schema.prisma to the database\n# note: this WILL wipe all database content\ncargo prisma migrate dev --name init\n\n# generate the Prisma client\ncargo prisma generate\n```\n\nOr execute the [`migration.sql`](./scripts/migration.sql) SQL statements against your database.\nThen, set the `DATABASE_URL` environment variable (a `.env` file works too), or supply the connection URL with `--postgres \u003curl\u003e`.\n\n## Output format\n\nData piped to a file or stdout will be in the following format:\n\n`--format csv`\n\n```csv\nchannel,video_id,comment_id,commenter_id,created_at,text\natrioc,1680333612,5e0e429e-949d-4a23-9160-96da782a7354,mazman100,\"2022-12-16 04:34:39.236 +00:00\",\"NOOO\"\natrioc,1680333612,b9939674-1340-4623-b351-c03d07c1e394,dazloc_,\"2022-12-16 04:34:41.341 +00:00\",\"WE BACK\"\n```\n\n`--format jsonl`\n\n```json\n{\"channel\":\"atrioc\",\"video_id\":1642642569,\"comment_id\":\"3f445ae2-2f6e-4256-b367-df8132454786\",\"commenter\":\"mazman100\",\"created_at\":\"2022-11-03 21:25:22.754 +00:00\",\"text\":\"NOOO\"}\n{\"channel\":\"atrioc\",\"video_id\":1642642569,\"comment_id\":\"b9939674-1340-4623-b351-c03d07c1e394\",\"commenter\":\"dazloc_\",\"created_at\":\"2022-12-16 04:34:41.341 +00:00\",\"text\":\"WE BACK\"}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatteopolak%2Ftcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatteopolak%2Ftcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatteopolak%2Ftcd/lists"}