Module: YoutubeCaptions

Defined in:
lib/youtube-captions.rb,
lib/youtube-captions/info.rb,
lib/youtube-captions/video.rb,
lib/youtube-captions/errors.rb,
lib/youtube-captions/captions.rb,
lib/youtube-captions/constants.rb

Defined Under Namespace

Classes: Captions, Error, Info, LangNotAvailableError, NoCaptionsAvailableError, Video

Constant Summary collapse

YOUTUBE_VIDEO_URL =
"https://www.youtube.com/watch?v="
CAPTIONABLE_REGEX =
/(\[{"baseUrl":.*"trackName":"(.*?)"}\])/
YOUTUBE_URL_FORMATS =
[
  %r((?:https?://)?youtu\.be/(.+)),
  %r((?:https?://)?(?:www\.)?youtube\.com/watch\?v=(.*?)(&|#|$)),
  %r((?:https?://)?(?:www\.)?youtube\.com/embed/(.*?)(\?|$)),
  %r((?:https?://)?(?:www\.)?youtube\.com/v/(.*?)(#|\?|$)),
  %r((?:https?://)?(?:www\.)?youtube\.com/user/.*?#\w/\w/\w/\w/(.+)\b)
]