This small tool (C# console application) lets to convert youtube annotations (XML) to SRT file.
Source code: C#
I've written the same thing with JavaScript.
Much easier to use, visit here: germanger/youtubeannotations-to-srt-js
Or just use it here.
- Download youtube annotations as XML with this opensource tool: youtube-copy-annotations (you only need to use
Step 1: Get annotation data
)
or you can directly get the annotations with this URL: https://www.youtube.com/annotations_invideo?video_id=YOUR_VIDEO_ID
, just replace YOUR_VIDEO_ID
with your real youtube video id (which is available in the URL of your video)
-
Convert the downloaded XML using this project:
2.1. Compile project (with a C# compiler or using
Visual Studio
). You will get aConvertYoutubeAnnotationsToSRT.exe
(or you can simply download it, if you trust me)
2.2. Using cmd
, run the .exe
passing the XML file path as an argument (just type the path after the .exe
, separated by one or more spaces).
If you want to see the output in the console, just type:
ConvertYoutubeAnnotationsToSRT.exe C:\annotations.xml
If you want the output written to a file, type:
ConvertYoutubeAnnotationsToSRT.exe C:\annotations.xml >> C:\output.srt
Argument alternative: you can omit the XML argument, but then the file needs to be in C:\annotations.xml
(with that exact name and location)
- Accept an argument that enables writing to a file instead of writing to
Console
's output. - Maybe create a GUI, or a web application
- Do more tests and check exceptions