This Go project automates the download of YouTube video subtitles and generates a CSV file containing video details and subtitle content.
- Subtitle Download: Downloads subtitles from specified YouTube channels.
- Error Logging: Logs failed downloads to
download_errors.log
for troubleshooting. - CSV Generation: Creates a CSV file (
output.csv
) with video ID, title, channel ID, description, and subtitles. - Skipping Existing Downloads: Avoids re-downloading subtitles that already exist.
- Customizable: Control the number of videos to download per channel.
- Clear Mode: Removes all downloaded files and directories.
-
Go: Ensure you have Go installed on your system. You can download it from the official website: https://golang.org/
-
youtube-dl: Install
youtube-dl
to fetch video information and subtitles. You can install it usingpip
:pip install youtube-dl
- Clone this repository:
git clone https://github.com/nesiler/youtube-cc-downloader
- Navigate to the project directory:
cd youtube-cc-downloader
- Build the project:
go build
- Create a text file named
channels.txt
in the project's root directory. - Each line should contain a YouTube channel ID (e.g.,
UC...
).
-
Default Mode: Downloads subtitles from channels in
channels.txt
and generatesoutput.csv
../download
-
Download Mode: Downloads subtitles only, using
channels.txt
and a specified video count../download download
(This will download 15 videos per channel by default.)
-
Clear Mode: Removes all downloaded files and directories.
./download clear
-
CSV Mode: Generates
output.csv
from existing subtitle files../download csv
- Number of Videos: By default, the downloader fetches the latest 15 videos per channel. You can change this by modifying the
count
variable inmain.go
.
Contributions are welcome! If you'd like to enhance this project, please fork the repository and submit a pull request.
This project is licensed under the GNU License.