GCAP.1(1p)

πŸ“¦ version 0.1.1, in ubuntu jammy

πŸ’– 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 the arg regular expression you specify. The default is "/(\w|\s)/g". regex girlies rise up 🧚
  • --proxy arg β€” use arg for the HTTP proxy, e.g. "http://foo:1234". This overrides the http_proxy environment setting. πŸ’œ
  • --no-proxy β€” disable use of the HTTP proxy entirely. This overrides both --proxy and the http_proxy environment 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