{"id":13600212,"url":"https://github.com/daymade/tiktok-whisper","last_synced_at":"2025-04-15T01:22:10.874Z","repository":{"id":165165789,"uuid":"637443603","full_name":"daymade/tiktok-whisper","owner":"daymade","description":"Batch convert video to text using openai's whisper or the local coreML via whisper.cpp on your MacBook","archived":false,"fork":false,"pushed_at":"2024-05-10T09:48:13.000Z","size":287,"stargazers_count":68,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T13:12:26.617Z","etag":null,"topics":["coreml","openai","pgvector","podcast","postgresql","sqlite","tiktok","whisper","whisper-cpp","xiaoyuzhou"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daymade.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-07T15:17:06.000Z","updated_at":"2025-03-26T03:27:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb09064a-e74c-4517-a70e-04740f0ea688","html_url":"https://github.com/daymade/tiktok-whisper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daymade%2Ftiktok-whisper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daymade%2Ftiktok-whisper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daymade%2Ftiktok-whisper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daymade%2Ftiktok-whisper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daymade","download_url":"https://codeload.github.com/daymade/tiktok-whisper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986504,"owners_count":21194052,"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":["coreml","openai","pgvector","podcast","postgresql","sqlite","tiktok","whisper","whisper-cpp","xiaoyuzhou"],"created_at":"2024-08-01T18:00:32.261Z","updated_at":"2025-04-15T01:22:10.836Z","avatar_url":"https://github.com/daymade.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# tiktok-whisper: tiktok-whisper-video-to-text-go\n\n##### Translate to: [简体中文](README_zh.md)\n\n## About tiktok-whisper-video-to-text-go\n\n![demo_download_xiaoyuzhou](doc/demo/download_xiaoyuzhou.gif)\n\nBatch convert videos to text using OpenAI's Whisper or the local coreML whisper.cpp.\n\nThe tiktok-whisper tool allows batch conversion of videos to text using either OpenAI's cloud-based Whisper API or local coreML's Whisper.cpp. It includes features such as exporting copies to Excel, saving conversion results to SQLite or PostgreSQL, video duration statistics, and keyword search to locate videos. It addresses the original whisper's limitations by offering solutions for macOS compatibility and speed enhancement.\n\n## Features\n- [x] Input Xiaoyuzhou podcast links for batch audio downloading\n- [x] Batch recognize audio or video, outputting text with timestamps\n- [x] Save recognition results to SQLite or PostgreSQL\n- [x] Use whisper_cpp + coreML for local transcription on macOS\n- [x] Export historical recognition results\n\n## Quick Start\n\n### macOS\n\nTiktok-whipser is based on two whisper engines: local whisper_cpp and remote openai whisper API. \n\nFor local conversion using coreML on macOS, you need to modify `binaryPath` and `modelPath` direct to your local whisper_cpp. \n\nIf you have an API KEY, you can use OpenAI's cloud API for conversion; skip step 1,2,3 to step 4 for compilation.\n\n1. Generate coreML's model:\n```shell\nmkdir -p ~/workspace/cpp/ \u0026\u0026 cd ~/workspace/cpp/\ngit clone git@github.com:ggerganov/whisper.cpp.git\ncd whisper.cpp\nbash ./models/download-ggml-model.sh large\nconda create -n whisper-cpp python=3.10 -y\nconda activate whisper-cpp \npip install -U ane_transformers openai-whisper coremltools\nbash ./models/generate-coreml-model.sh large\nmake clean\nWHISPER_COREML=1 make -j\n```\n\n2. for using local whisper_cpp, you should modify the binaryPath and modelPath in `tiktok-whisper/internal/app/wire.go` manually.\n```go\nfunc provideLocalTranscriber() api.Transcriber {\n    // Modify binaryPath and modelPath to your paths here!\n    binaryPath := \"~/workspace/cpp/whisper.cpp/main\"\n    modelPath := \"~/workspace/cpp/whisper.cpp/models/ggml-large-v2.bin\"\n    return whisper_cpp.NewLocalTranscriber(binaryPath, modelPath)\n}\n```\n\n3. Generate wire configuration and compile the executable:\n```shell\ncd ./internal/app\ngo install github.com/google/wire/cmd/wire@latest\nwire\n```\n\n4. Compile tiktok-whisper with CGO_ENABLED\n```shell\ncd tiktok-whisper\nCGO_ENABLED=1 go build -o v2t ./cmd/v2t/main.go\n./v2t help\n```\n\n### Windows\n\nThe procedure is similar to macOS.\n\n```cmd\ncd tiktok-whisper\ngo build -o v2t.exe .\\cmd\\v2t\\main.go\n.\\v2t.exe help\n```\n\n## Usage\n\n### Download audio from Xiaoyuzhou or video from TikTok\n\n```shell\n# Download Xiaoyuzhou audio using a single episode URL\n./v2t download xiaoyuzhou -e \"https://www.xiaoyuzhoufm.com/episode/6398c6ae3a2b7eba5ceb462f\"\n\n# Or using multiple episode URLs\n./v2t download xiaoyuzhou -e \"https://www.xiaoyuzhoufm.com/episode/6398c6ae3a2b7eba5ceb462f,https://www.xiaoyuzhoufm.com/episode/6445559d420fc63f0b9e5747\"\n\n# Download all episodes from a Xiaoyuzhou podcast URL\n./v2t download xiaoyuzhou -p \"https://www.xiaoyuzhoufm.com/podcast/61e389402454b42a2b06177c\"\n```\n\nAfter downloading, you can find the files in the data directory:\n```shell\n$ tree data/\ndata/\n└── xiaoyuzhou\n    └── 硬地骇客\n        └── EP21 程序员的职场晋升究竟与什么有关？漂亮的代码？.mp3\n```\n\n### Use yt-dlp to download YouTube videos\n\nTo download only audio without video, use the following command:\n```shell\nyt-dlp --extract-audio --audio-format mp3 \"https://www.youtube.com/watch?v=tWmNN87VvcE\"\n```\n\n### Convert videos/audios to text\n\nOn macOS, you can use whisper.cpp for audio conversion, ensuring the correct setup of `binaryPath` and `modelPath` in `wire.go`:\n```shell\n# Convert an\n\n audio file\n./v2t convert -audio --input ./test/data/test.mp3\n\n# Convert all files in a directory with a specified file extension\n./v2t convert -audio --directory ./test/data --type m4a\n\n# Convert all mp4 files in a specified directory to text, -n specifies the maximum number of files to convert, default n=1\n./v2t convert --video --directory \"./test/data/mp4\" --userNickname \"testUser\" -n 100\n\n# Export all recognition history of a specified user as excel\n./v2t export --userNickname \"testUser\" --outputFilePath ./data/testUser.xlsx\n```\n\nTo use OpenAI's API KEY for audio conversion, ensure `OPENAI_API_KEY` is set correctly in your environment variables and modify `wire.go` to use `provideRemoteTranscriber`:\n```diff\nfunc InitializeConverter() *converter.Converter {\n-   wire.Build(converter.NewConverter, provideLocalTranscriber, provideTranscriptionDAO)\n+   wire.Build(converter.NewConverter, provideRemoteTranscriber, provideTranscriptionDAO)\n    return \u0026converter.Converter{}\n}\n```\n\n### Using Python scripts for faster-whisper\n\nIf you are on Windows and have a dedicated GPU, you can use Python's faster-whisper for CUDA processing. There are two Python scripts for batch audio transcription:\n\n- `whisperToText.py`: Transcribes a single file or all files in a single directory.\n- `whisperToTextParallel.py`: Transcribes files in multiple subdirectories in parallel.\n\nBefore running the scripts, install the required Python packages:\n```shell\npip install -r requirements.txt\n```\n\nFor single file or directory transcription, and parallel transcription of multiple subdirectories, follow the provided commands in the documentation.\n\n## TODO\n\n- [x] Video duration statistics\n- [ ] Keyword search to locate videos\n- [ ] Original video jump link\n- [ ] Like, share, and comment statistics\n- [ ] Use pgvector for vectorized search","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaymade%2Ftiktok-whisper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaymade%2Ftiktok-whisper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaymade%2Ftiktok-whisper/lists"}