GithubHelp home page GithubHelp logo

publitio_js_sdk's People

Contributors

ob1y2k avatar sistemd avatar volkova229 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

publitio_js_sdk's Issues

HLS video

Hi there,

I'm trying to upload a video with hls option from that way:

        const apiKey = "xxxx";
        const apiSecret = "xxx";
        const publitioClient = new PublitioAPI(apiKey,apiSecret);
        try {
            const data = await publitioClient.uploadRemoteFile({ file_url: url, privacy: 0, option_hls: 1 })
            console.log(`Uploading finished. status code: ${data.code}`)
            const dbData = {
                finishedProcessing: true,
                videoUrl: data.url_download,
                thumbUrl: data.url_thumbnail,
                aspectRatio: data.width / data.height,
                publitioId: data.id,
            }
            return dbData;
        }
        catch (error) {
            console.error('Uploading error');
            console.error(error);
            throw error;
        }

But the problem is the video is private and the hls option is disabled:

Captura de Pantalla 2020-11-05 a la(s) 11 57 06

Captura de Pantalla 2020-11-05 a la(s) 11 57 37

What could be happen?

Best Regards

This bug is not fixed: examples/create-file.js returns error 'Please include file or file_url in your request'

This bug is not fixed... this error continue... please verify urgent. Thanks

{"success":false,"code":400,"error":{"message":"Please include file or file_url in your request"}}

let formData = new FormData();
    formData.append("file", file);

    if (file == undefined) {
      console.log("Choose file to upload first");
      return;
    }

    const api_url = publitio.uploadUrlSigned();

    this.axios
      .post(api_url, formData, {
        headers: {
          Accept: "application/json",
          "Content-Type": "multipart/form-data",
        },
        onUploadProgress: function (progressEvent) {
          const valeur = Math.round((progressEvent.loaded / progressEvent.total) * 100);
          console.log(valeur + "%");
        }.bind(this),
      })
      .then(function (response) {
        console.log(response.data);
        if (response.data.success == true) {
          console.log("upload ok");
        } else {
          console.log("upload failed");
        }
      });

Originally posted by @ednsinf in #17 (comment)

Add form-data as dependency

Trying to use this in a nodejs project.

Getting FormData is not defined error while trying to upload a file.

Unlike browser, FormData needs to be added for use in nodejs apps.

Error: Request body larger than maxBodyLength limit

When trying out the example from the Readme with a 90MB wav file I get the following error:

{ Error: Request body larger than maxBodyLength limit
    at RedirectableRequest.write (/some/path/node_modules/follow-redirects/index.js:97:24)
    at RedirectableRequest.end (/some/path/node_modules/follow-redirects/index.js:116:8)
    at dispatchHttpRequest (/some/path/node_modules/axios/lib/adapters/http.js:272:11)
    at new Promise (<anonymous>)
    at httpAdapter (/some/path/node_modules/axios/lib/adapters/http.js:20:10)
    at dispatchRequest (/some/path/node_modules/axios/lib/core/dispatchRequest.js:59:10)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
    ...

According to this axios discussion it might be easy to fix by increasing the maximum content length (in bytes):

maxContentLength: 524288900 // 500MB

ReferenceError: validateStatus is not defined

In versions 1.0.9 and 1.0.10 after call uploadFile method, the library throws the error
ReferenceError: validateStatus is not defined

Code

const publitio = new PublitioAPI(process.env.PUBLITIO_API_KEY, process.env.PUBLITIO_API_SECRET)

...

const file = fs.readFileSync("uploads/" + req.file.filename)
publitio.uploadFile(file, 'file')

With version 1.0.8 works

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.