
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
streamlink-serverless
Advanced tools
Streamlink as a Serverless Service | Getting started | Usage | FAQ
Streamlink Serverless is a CDK construct to run Streamlink as a serverless Lambda Function on AWS.
Add Streamlink Serverless to a new or existing AWS CDK app in the language of your choice:
# npm
npm install streamlink-serverless
# Yarn
yarn add streamlink-serverless
# pnpm
pnpm add streamlink-serverless
# Python
pip install streamlink-serverless
# Dotnet
dotnet add package StreamlinkServerless
This example creates a Stack with a Streamlink Serverless backend and publishes the service behind a Function URL. Finally an output returns the service URL for immediate use.
const app = new cdk.App();
const stack = new cdk.Stack(app, 'Streamlink');
const streamlink = new Streamlink(stack, 'Backend');
const endpoint = new lambda.FunctionUrl(stack, 'Endpoint', {
function: streamlink.function,
authType: lambda.FunctionUrlAuthType.NONE,
});
new cdk.CfnOutput(stack, 'EndpointUrl', {
value: endpoint.url,
});
app.synth();
Once deployed, you can use your Streamlink Serverless service like this:
https://example.com/live/youtube.com/@NASA/best.m3u8
https://<endpoint>/live/<url>
Simply put the stream URL behind your endpoint.
<endpoint>
<url>
https://<endpoint>/live/<url>/<stream>.<type>
This format allows selecting a specific stream quality and format.
<stream>
best
or worst
for selecting the highest or lowest available quality.
Optional.<type>
m3u8
for HLS streams or mpd
for Dash streams.Feel free to open an issue for any unaddressed questions.
Make sure to deploy Streamlink Serverless into the region you intend to watch streams from. Most services are already geo-blocked when trying to retrieve the stream URL. E.g. if you are based in London, United Kingdom
deploy to eu-west-2
.
See this blog post for detailed instructions.
The pricing model for AWS Lambda is based on number of request and duration of the execution. It also offers a generous "always free" allocation via AWS Free Tier.
While cost predications are incredible difficult to make, it seems possible to run Streamlink Serverless for personal use only within the bounds of AWS Free Tier.
Always set up billing alarms to avoid unexpected costs.
Adding appropriate authentication is your responsibility. Putting any unprotected URL online makes you susceptible to occurring unexpected cost.
Streamlink Serverless does not offer built-in password protection, because the pricing model for AWS Lambda charges for number of requests and duration of the execution. This means that you would still be charged for any unauthenticated requests if password protection were to be handled inside the Lambda Function. While there might be some savings from shorter execution times and the deterrent of an unusable service, it is much safer to deploy a proper authentication mechanism.
The simplest way would be to enable AWS_IAM
auth on the Lambda Function URL (see docs). However IAM authentication is likely not compatible with the intended use case of using Streamlink Serverless URLs as IPTV playlists, as it involves signing requests.
A more advanced approach would be to deploy Streamlink Serverless as part of an API Gateway HTTP API and configure an authorizer according to your needs.
FAQs
Streamlink as a Service
The npm package streamlink-serverless receives a total of 0 weekly downloads. As such, streamlink-serverless popularity was classified as not popular.
We found that streamlink-serverless demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.