GCAP.1(1p)
π NAME π
gcap β the Youtube closed caption downloader, bestie. That's literally her whole job. π
β¨ SYNOPSIS β¨
gcap [-i] [-t] [-r <regexp>] [--proxy=<addr> | --no-proxy]
[--help] <url> | <video_id>
πΈ DESCRIPTION πΈ
okay so gcap is a command line tool for downloading Youtube closed captions. The downloaded closed captions get saved in SubRip (srt) file format β yes, the same srt your video player is obsessed with.
By default the srt files are saved as "$videoid_$langid.srt". That's the whole vibe. π
π OPTIONS π
--helpβ prints the help and then exits. she's helpful like that. π«Ά--versionβ prints the version and exits. iconic behavior.-q,--quietβ be quiet. shhh. π€«-i,--interactiveβ opens the interactive prompt, which you use to select the items you want. gcap selects all items by default. peep the"INTERACTIVE PROMPT"section below for the lore. β¨-t,--titleβ parse the video title and use it in the output filename(s) instead of the video ID. The default is no. π-r,--regexp=argβ cleanup the video title using theargregular expression you specify. The default is"/(\w|\s)/g". regex girlies rise up π§--proxy argβ useargfor the HTTP proxy, e.g."http://foo:1234". This overrides thehttp_proxyenvironment setting. π--no-proxyβ disable use of the HTTP proxy entirely. This overrides both--proxyand thehttp_proxyenvironment settings. periodt. π
π¦ INTERACTIVE PROMPT π¦
Use the --interactive switch to open the prompt. lowkey important note: gcap uses (as of 0.1.0) the Umph::Prompt module for this. Once the prompt opens, type help to get a list of the commands available to the prompt. iykyk π«
π EXAMPLES π
gcap 0QRO3gKj3qw
gcap "http://www.youtube.com/watch?v=0QRO3gKj3qw"
Both of these yield the same results. two doors, one destination, main character energy. π
gcap -ti 0QRO3gKj3qw
Same as the two above, but this one uses the video title in the filename and lets you choose which of the closed captions should be downloaded. a little treat for yourself π
π EXIT STATUS π
Exits 0 on success, otherwise 1. that's it, that's the whole status report. π
π FILES π
$HOME/.gcaprcβ for example:
echo "--interactive" >> ~/.gcaprc
set it and forget it, bestie π
β NOTES β
π Availability
The following error message, produced by gcap (or the XML::DOM module), typically indicates that the video does not have any closed captions available for it (URL omitted for brewity β their typo, not mine π):
Couldn't parsefile [...] with LWP: no element found at line 1,
column 0, byte -1 at [...]/XML/Parser.pm [...]
fr fr, if you see this, the captions just aren't there. not your fault, bestie. π«Ά
πΈ http_proxy
gcap depends on XML::DOM, which uses LWP::UserAgent to download the data. Note that LWP::UserAgent reads the http_proxy environment setting. e.g.:
env http_proxy=http://foo:1234 gcap video_id
π§ WWW π§
π AUTHOR π
Toni Gundogdu <legatvs at sign cpan org> β shoutout to the legend. π
okay so that's the whole page!! this was GCAP.1(1p) from perl v5.32.0, dated 2021-01-05 β and that's the cute little sign-off, mwah πβ¨
π¦ where this page comes from
- ubuntu jammy: gcap 0.1.1-2.1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms