Giter Club home page Giter Club logo

bunnycdn-stream's Introduction

Hey, I'm DanCodes

DanCodes Readme Stats

๐Ÿ’ป My Software Stack

Frontend

sveltekit react nuxtjs vuejs threejs bootstrap css3 tailwindcss jquery html5 solidjs

Backend

nodejs express fastify mongodb mysql nginx redis graphql

Cloud

amazonaws googlecloud digitalocean ubuntu

Deployment

netlify cloudflare nginx docker heroku tauri

CMS

strapi wordpress

Version Control/CI

git travis-ci circleci github renovate

bunnycdn-stream's People

Contributors

abdulazeez-98 avatar dan-online avatar fibs7000 avatar renovate[bot] avatar vladimirkosmala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bunnycdn-stream's Issues

bug: type definition export

Description of the bug

Could not find a declaration file for module 'bunnycdn-stream'. 'node_modules/bunnycdn-stream/dist/index.mjs' implicitly has an 'any' type.
There are types at 'node_modules/bunnycdn-stream/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'bunnycdn-stream' library may need to update its package.json or typings.

Steps To Reproduce

Install and import the library into a nuxt3 project.

Additional Information

No response

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm @types/rimraf Unavailable

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/codeql-analysis.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • github/codeql-action v3@4fa2a7953630fd2f3fb380f21be14ede0169dd4f
  • github/codeql-action v3@4fa2a7953630fd2f3fb380f21be14ede0169dd4f
  • github/codeql-action v3@4fa2a7953630fd2f3fb380f21be14ede0169dd4f
.github/workflows/continuous-delivery.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
.github/workflows/continuous-integration.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-node v4@1e60f620b9541d16bece96c5465dc8ee9832be0b
  • actions/cache v4
  • codecov/codecov-action v4.5.0
.github/workflows/labelssync.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • crazy-max/ghaction-github-labeler v5@de749cf181958193cb7debf1a9c5bb28922f3e1b
npm
package.json
  • axios ^1.7.2
  • @biomejs/biome ^1.8.3
  • @commitlint/cli ^19.3.0
  • @commitlint/config-conventional ^19.2.2
  • @favware/npm-deprecate ^1.0.7
  • @sapphire/ts-config ^5.0.1
  • @types/jest ^29.5.12
  • @types/node ^20.14.10
  • @types/rimraf ^4.0.5
  • @vitest/coverage-v8 ^1.6.0
  • dotenv ^16.4.5
  • husky ^9.0.11
  • jest ^29.7.0
  • jest-circus ^29.7.0
  • lint-staged ^15.2.7
  • release-it ^17.6.0
  • rimraf ^6.0.1
  • ts-jest ^29.2.2
  • ts-node ^10.9.2
  • tsup ^8.1.0
  • typedoc ^0.26.4
  • typedoc-plugin-markdown ^4.2.1
  • typescript ^5.5.3
  • vitest ^1.6.0
  • yarn 4.3.1

  • Check this box to trigger a request for Renovate to run again on this repository

This looks exactly what I was looking for! I have some questions

First of all congrats on your work!

I have some questions.

  1. Is it up to date?
  2. Does it create and update all at once?
  3. Can I pass more parameters thann just the title and collectionId? I want to pass genres, duration,... It is important to pass those parameters.
  4. Is it possible to call the videos based on one parameter passed on the data? Let's say, genre=horror.

Again, thanks a lot! This project is awesome!

bug: createDirectUpload need a `collectionId` instead `collection`

Description of the bug

When you try to use the function createDirectUpload the documentation says that collection is optional which is correct but the right key should be collectionId because in the bunny documentation it is the right key used for createVideo function which is the internal function used in the createDirectUpload.

Solution

image

Steps To Reproduce

  1. Call createDirectUpload with the following parameters: title, collection.
  2. Your video will upload in the root instead of the correct collection

Additional Information

No response

Invalid handling of query params for listVideos

Hello there, it is me again,

I encountered another bug and wanted to notify you.

When calling listVideos the provided options do not work as you need to pass them as query params and not within the body of the request.

I just had a look at listVideos for now so I'm not sure if this is impactful somewhere else.

The LOC I refer to -> https://github.com/dan-online/bunnycdn-stream/blob/main/src/index.ts#L250

How it should be -> https://docs.bunny.net/reference/video_list

You should take advantage of URLSearchParams something like:

const options = {
    page: '1', <-- string
    itemsPerPage: '10', <-- string
    search: 'hello',
    collection: '1312' <-- should rather be collectionId as you search for id and not the name
}

const urlParams = new URLSearchParams(options)

โœŒ๐Ÿผ

feat: Support for public m3u8 url in fetch video api

Description

Think about this scenario:-
I have a public m3u8 video url and i want to upload it to bunny stream. The thing I've to do now:-

  • Manually download all the ts files and pack it into mp4 format
  • Use upload video api to upload mp4 video to bunny stream

If it is possible to upload m3u8 directly to bunny stream with fetch video api, then it will be super cool!

Query around web streams / node.js streams

First things first, thanks so much for building this - super useful tool!

I have quick question - I got a little stuck initially uploading videos, as I was creating a web stream from a File object (obtained through a POST request from a html form) using File.stream(). However, despite the bunnycdn-stream API accepting that and returning a response without any issues, the video on the BunnyStream web interface was showing a 'processing failed' error.

I was able to fix things by converting the web stream into a node.js stream using stream.Readable.fromWeb(readable).

Do you know if this is an issue on the BunnyStream end of things, or that AXIOS is not tolerating a web stream for some reason?

Thanks!

Hari

bug: How to upload Express.Multer.File

Description of the bug

I'm using nestjs and I wanted to use createAndUploadVideo to upload the file. Unfortunately, file must be of ReadStream type and createReadStream does not work with buffer and stream properties of my multer file. Any ideas how can I make it work?

P.S. Why there is no getVideoPlayData() method implemented?

Steps To Reproduce

...

Additional Information

No response

Library does not support CommonJS

Hi,

I was trying to compile my TS code into CommonJS and I encountered this error at runtime:

Xnip2023-02-05_17-49-36

The same error can be reproduced when creating an empty JS project with the library 'file-type'.
It turned out that the library 'file-type' only supports ESM since version 17. However, version 16 (which supports CommonJS) appears to be still maintained.

Xnip2023-02-05_17-41-07

I made a pull request to address this issue. The change only involves one function related to setting the thumbnail.
I hope my input was useful and happy to provide more info if needed ๐Ÿ‘

NPM library does not work when using modules (instead of CommonJS)

Hi,
I faced an issue while using Vitest to run some tests that include this library. My code normally compiles to CommonJS and it works fine, only when I use modules the problem occurs.
However, to reproduce this problem you don't actually need to be using TS, you can simply initialize a new npm project and install bunnycdn-stream library. Then set the type parameter in package.json to "module".

npm init -y
npm install bunnycdn-stream

package.json:

// package.json:
"type": "module"

Then create a very simple index.js:

import { BunnyCdnStream } from 'bunnycdn-stream';
const testBunny = new BunnyCdnStream({ apiKey: 'apiKey', videoLibrary: 'vidLib' });

When you run the file, the following error occurs:

Xnip2023-01-30_23-38-09

I tried to investigate this problem. I think the problem is due to the version of Axios specified in the NPM library (which is 0.27.2).
If you create a new empty NPM project and install [email protected] and do:

import { AxiosError } from 'axios'

the same exact error will appear. I then tried using [email protected] and it did not show any error.

The package.json file in this GitHub repo specifies version 1.2.6 while the one on NPM specifies 0.27.2

I hope my input was helpful. I'm happy to provide more info if needed.

SyntaxError: Named export 'fromBuffer' not found.

Hey there,

first off all BIG thanks for this project. I made a video streaming backend and created the requests manually, but switched now to your client as it makes my life much easier.

However, I'm having a problem:

I'm using NextJS (13.1.6) API routes and get the following error:

image

My code looks like this:

export default withUserGuard(async function handler(req, res) {
    if (req.method !== 'GET') {
        res.setHeader("Allow", ["GET"]);
        return res.status(405).json({ error: `Method ${req.method} Not Allowed` });
    }
    try {
        const mostRecent = await getMostRecentVideos();
        return res.status(200).json({ mostRecent });
    } catch (e) {
        return res.status(500).end();
    }
});

const getMostRecentVideos = async () => {
    const videos = await stream.listVideos({
        page: 1,
        itemsPerPage: 10,
        orderBy: 'date'
    })

    return videos.items.map((video) => ({
        viewTime: prettyPrintSeconds(video.length),
        collection: collectionIdToGenre.get(video.collectionId),
        ...video,
    }));
};

Do you have an idea how to solve that or is there a way to allow CommonJS modules properly?
Thanks and all the best!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.