2.0.22 • Published 2 years ago

@pinegraph/youtube-transcript-cdk-constructs v2.0.22

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Youtube Transcript Constructs

What is this?

This package is an AWS CDK construct for hosting a proxy over Youtube's transcript API. It creates a simple API Gateway endpoint that proxies to a Youtube endpoint to get video transcriptions to get around SOP restrictions.

AWS CDK enables people to have infrastructure as code (IAC). That is, with just a few commands, you'll have a fully running and functional production ready service in the cloud.

Problem

Youtube doesn't expose a way to retrieve transcripts over videos.

Benefits/ Warning

By using this proxy, you'll be able to get transcripts for videos that include them. However, as this isn't an approved way to retrieve transcripts, it may break without warning in the future.

Local Setup

You can spin up a local endpoint to use via:

  1. npm run serve
  2. In an incognito browser window, navigate to http://localhost:3000/transcript?videoID=CGsmf_g9kho. Where videoID is found as the query param of the youtube video (i.e. https://www.youtube.com/watch?v=CGsmf_g9kho.)

Setup

  1. This package assummes that you are familiar with AWS CDK and already have a CDK app created. If not, follow this tutorial.
  2. Add the construct to your CDK app. See Example CDK App Code below.
  3. Run cdk deploy from your app package.
  4. Look for the API Gateway resource in the stack you included the construct in. You should now be able to invoke an endpoint like https://[YOUR API ID].execute-api.us-east-1.amazonaws.com/?videoID=CGsmf_g9kho

Example CDK App Code

  const youtubeTranscriptProxy = new YoutubeTranscriptConstruct(
    this,
    "YoutubeTranscriptProxy",
    {
      region: props.env?.region!,
      accountID: props.env?.account!,
      allowedDomains: ["https://" + props.domainName],
    }
  );

Questions?

Reach out to us on discord.

Releasing

  1. npm run build
  2. npm publish --access public
2.0.22

2 years ago

2.0.21

2 years ago

2.0.20

2 years ago

2.0.19

2 years ago

2.0.18

2 years ago

2.0.17

2 years ago

2.0.16

2 years ago

2.0.15

2 years ago

2.0.14

2 years ago

2.0.13

2 years ago

2.0.12

2 years ago