All Projects → widdix → aws-lambda-youtube-dl

widdix / aws-lambda-youtube-dl

Licence: other
Download YouTube (and a few other sites) videos to S3 using Lambda.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to aws-lambda-youtube-dl

lapa
Universal AWS Lambda packager
Stars: ✭ 20 (-74.36%)
Mutual labels:  aws-lambda
next-serverless
☁️ next-serverless deploys your next.js application to AWS Lambda with minimal or even no configuration.
Stars: ✭ 80 (+2.56%)
Mutual labels:  aws-lambda
aws-appsync-alternative-data-sources
Exploring how AWS AppSync can utilize AWS Lambda to integrate with alternative data sources, including Amazon ElastiCache and Amazon Neptune.
Stars: ✭ 13 (-83.33%)
Mutual labels:  aws-lambda
serverless-transformers-on-aws-lambda
Deploy transformers serverless on AWS Lambda
Stars: ✭ 100 (+28.21%)
Mutual labels:  aws-lambda
mysql2-lambda
Precompiled Mysql2 Gem for AWS Lambda
Stars: ✭ 19 (-75.64%)
Mutual labels:  aws-lambda
SSR-React-Using-Serverless
SSR-React Using Serverless(aws)
Stars: ✭ 34 (-56.41%)
Mutual labels:  aws-lambda
nuxt-on-lambda
Nuxt.jsをAWS Lambdaで動かす
Stars: ✭ 78 (+0%)
Mutual labels:  aws-lambda
aws-lambda-ebs-backups
Python scripts to be run using AWS's Lambda service to Backup and Delete Snapshots of EBS Volumes
Stars: ✭ 31 (-60.26%)
Mutual labels:  aws-lambda
aws-iam-slack-notifer
Notifies slack when an IAM policy is created, changed or assigned to a role
Stars: ✭ 35 (-55.13%)
Mutual labels:  aws-lambda
demo-serverless-aspnetcore
ASP.Net Core 3.1 on AWS Lambda demo
Stars: ✭ 22 (-71.79%)
Mutual labels:  aws-lambda
terraform-aws-zappa
Create a AWS VPC with associated resources for use with Zappa
Stars: ✭ 30 (-61.54%)
Mutual labels:  aws-lambda
twitter
A serverless social network that's under development with some cool stuff, such as Serverless Framework, AppSync, GraphQL, Lambda, DynamoDB, Cognito, Kinesis Firehose, and Algolia ☁️
Stars: ✭ 29 (-62.82%)
Mutual labels:  aws-lambda
YouTube-Downloader
Django YouTube Downloader Using youtube-dl
Stars: ✭ 47 (-39.74%)
Mutual labels:  youtube-dl
eksphemeral
A simple Amazon EKS manager for ephemeral clusters
Stars: ✭ 68 (-12.82%)
Mutual labels:  aws-lambda
URTube
URTube, a YouTube video to MP3 downloader built in NodeJs and Electron
Stars: ✭ 20 (-74.36%)
Mutual labels:  youtube-dl
rust-wasm-on-lambda-edge
Rust/WASM on AWS Lambda@Edge (CloudFront)
Stars: ✭ 12 (-84.62%)
Mutual labels:  aws-lambda
aws-lambda-pdf-generator-puppeteer
PDF generator for AWS lambda with puppeteer
Stars: ✭ 52 (-33.33%)
Mutual labels:  aws-lambda
lifebot
Use Google Sheets to log your life by texting it Emojis and pulling in data from Fitbit automatically.
Stars: ✭ 15 (-80.77%)
Mutual labels:  aws-lambda
MCU-Countdown
An API for answering the question "When is the next MCU film?"
Stars: ✭ 95 (+21.79%)
Mutual labels:  aws-lambda
projen-test
An example project explaining how to create and publish CDK constructs using projen and jsii. It lets you publish your CDK constructs to npm, Maven, NuGet and PyPi.
Stars: ✭ 23 (-70.51%)
Mutual labels:  aws-lambda

aws-lambda-youtube-dl

This project is no longer maintained. AWS does no longer bundle python in Node.js runtimes.

Download YouTube (and a few other sites) videos to S3 using Lambda powered by youtube-dl.

Deploy and Test

You need an up-to-date AWS CLI installed and configured on your machine and Node.js v8.10.

If you never worked with aws cloudformation package before, create an S3 bucket that stores the ZIP files that the package command generates. Run the following command and replace YOUR_BUCKET with a unique bucket name: aws s3 mb s3://YOUR_BUCKET.

Run the following commands (replace YOUR_BUCKET with your S3 bucket name to store ZIP files) to package the source code:

npm i
aws cloudformation package --s3-bucket YOUR_BUCKET --template-file template.yml --output-template-file .packaged.yml

Your output will look mostly like this:

Uploading to 864a6c31b9b19e4abfba8d28d719b9a8  8460482 / 8460482.0  (100.00%)
Successfully packaged artifacts and wrote output template to file .packaged.yml.
Execute the following command to deploy the packaged template
aws cloudformation deploy --template-file /Users/michael/Projects/widdix/aws-lambda-youtube-dl/.packaged.yml --stack-name <YOUR STACK NAME>

Now it's time to deploy the CloudFormation stack:

aws cloudformation deploy --stack-name aws-lambda-youtube-dl --template-file .packaged.yml --capabilities CAPABILITY_IAM

Your output will look like this:

Waiting for changeset to be created..
Waiting for stack create/update to complete
Successfully created/updated stack - aws-lambda-youtube-dl

Finally, you can download YouTube video:

aws lambda invoke --function-name aws-lambda-youtube-dl --payload '{"videoUrl": "https://www.youtube.com/watch?v=5QrzWPFucC4"}' .out.txt && cat .out.txt

Your output will look like this:

{
    "StatusCode": 200,
    "ExecutedVersion": "$LATEST"
}
{"bucketName":"aws-lambda-youtube-dl-bucket-fk6s5c4z7z9s","key":"d7d7cbc7-27c6-4ed2-bf18-82c98138be8d.mp4","url":"s3://aws-lambda-youtube-dl-bucket-fk6s5c4z7z9s/d7d7cbc7-27c6-4ed2-bf18-82c98138be8d.mp4"}

That's it.

To clean up, empty the S3 bucket that stores your video and remove the CloudFormation stack you created.

Interface

Event

{
  "videoUrl": "https://www.youtube.com/watch?v=5QrzWPFucC4"
}

Response

{
  "bucketName": "test",
  "key": "xyz.mp4",
  "url": "s3://test/xyz.mp4"
}

The key is generated based on the awsRequestId. The video is always in mp4 format.

Limitations

  • The new nodejs10.x Lambda runtime does not contain python anymore, and therefore, youtube-dl does not work.
  • The download from YouTube and upload to S3 must finish within 15 minutes (I have not found a video that was too big).
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].