Coder Social home page Coder Social logo

to-streamable's Introduction

to-streamable

Upload video quickly to Streamable.

Build Status

js-standard-style

Installation

NPM

npm install -g to-streamable

Usage

Usage: to-streamable [options] [path to video file]
If no video path is passed, then stdin is used.

Options:

  --help, -h     Prints this help message.

  --version, -v  Prints current version.

  --setup        Launches a wizard to save Streamable username and password.

  --auth         Sets the username and password used for uploading.
                 Must be in a colon pair. `to-streamable --auth=user:pass`
                 If passed, this is preferred over any saved authentication.

  --no-resize    Tells Streamable to not resize final video.

  --mute         Tells Streamable to mute final video.

API

let vid = require('to-streamable')(<opts>)

Returns a new to-streamable instance. opts is an object. Valid parameters:

  • file - A Readable stream of the video. (i.e. fs.createReadStream('/path/to/video')) This is passed to request's formData option. Required.
  • auth - An object containing a username and password property of your Streamable credentials. Required.
  • params - An array of parameters to add to the request. Valid options are noresize and mute. See the Streamable API Docs for more info.

Example:

let opts = {
  file: fs.createReadStream('/path/to/file'),
  auth: {
    username: 'foo',
    password: 'bar'
  },
  params: ['mute']
}

vid.upload([cb(err, res)])

Starts the upload of the video. cb is an optional callback function. Called with parameters err, containing an Error, if any, and res, with the object response from the Streamable API. See the Streamable API Docs for format.

vid.status([cb(err, res)])

Retrieves the status of the video upload. vid.upload() must be called beforehand. cb is an optional callback function. Called with parameters err, containing an Error, if any, and res, with the object response from the Streamable API. See the Streamable API Docs for format.

to-streamable's People

Contributors

remixz avatar

Stargazers

kenzo avatar Neos21 avatar  avatar André Perdigão Gonçalves avatar  avatar Niels avatar Chris Baronavski avatar Armen Petrosian avatar Marwan Hilmi avatar Daniel Saewitz avatar Derek Reynolds avatar

Watchers

 avatar Daniel Saewitz avatar Michele Venturi avatar  avatar  avatar

Forkers

yaoyusina

to-streamable's Issues

new error with v2

$ to-streamable video.mp4
Uploading...
/Users/username/.nvm/versions/node/v7.3.0/lib/node_modules/to-streamable/src/index.js:32
      const { shortcode } = body
                            ^

TypeError: Cannot match against 'undefined' or 'null'.
    at Request.request [as _callback] (/Users/username/.nvm/versions/node/v7.3.0/lib/node_modules/to-streamable/src/index.js:32:29)
    at self.callback (/Users/username/.nvm/versions/node/v7.3.0/lib/node_modules/to-streamable/node_modules/request/request.js:186:22)
    at emitOne (events.js:101:20)
    at Request.emit (events.js:188:7)
    at FormData.<anonymous> (/Users/username/.nvm/versions/node/v7.3.0/lib/node_modules/to-streamable/node_modules/request/request.js:1182:10)
    at emitOne (events.js:101:20)
    at FormData.emit (events.js:188:7)
    at FormData.CombinedStream._emitError (/Users/username/.nvm/versions/node/v7.3.0/lib/node_modules/to-streamable/node_modules/combined-stream/lib/combined_stream.js:187:8)
    at DelayedStream.<anonymous> (/Users/username/.nvm/versions/node/v7.3.0/lib/node_modules/to-streamable/node_modules/combined-stream/lib/combined_stream.js:113:10)
    at emitOne (events.js:101:20)

npm info:

{ name: 'to-streamable',
  description: 'Upload video quickly to Streamable.com',
  'dist-tags': { latest: '2.0.0' },
  versions: [ '1.0.0', '1.1.0', '1.1.1', '1.2.0', '1.2.1', '2.0.0' ],
  maintainers: [ 'remixz <[email protected]>' ],
  time: 
   { modified: '2017-01-23T22:34:38.807Z',
     created: '2015-05-31T02:56:49.695Z',
     '1.0.0': '2015-05-31T02:56:49.695Z',
     '1.1.0': '2015-05-31T08:23:40.073Z',
     '1.1.1': '2015-05-31T08:40:32.721Z',
     '1.2.0': '2015-05-31T20:10:21.108Z',
     '1.2.1': '2015-05-31T20:26:52.214Z',
     '2.0.0': '2017-01-23T22:34:38.807Z' },
  homepage: 'https://github.com/remixz/to-streamable#readme',
  keywords: [ 'upload', 'streamable.com', 'video', 'cli' ],
  repository: 
   { type: 'git',
     url: 'git+https://github.com/remixz/to-streamable.git' },
  author: 'Zach Bruggeman <[email protected]>',
  bugs: { url: 'https://github.com/remixz/to-streamable/issues' },
  license: 'MIT',
  readmeFilename: 'README.md',
  users: { jerkovicl: true },
  version: '2.0.0',
  main: 'src/index.js',
  bin: { 'to-streamable': 'src/bin.js' },
  scripts: { test: 'standard src/*.js && tap test/*.js' },
  dependencies: 
   { 'application-config': '^1.0.1',
     'concat-stream': '^1.6.0',
     'file-type': '^4.1.0',
     minimist: '^1.2.0',
     prompt: '^1.0.0',
     request: '^2.79.0' },
  devDependencies: { standard: '^8.6.0', tap: '^9.0.3' },
  gitHead: 'f1d4a1812de8d5402c015540ac5257d334627630',
  dist: 
   { shasum: '5b9ffea5ead54fb5e11c847a10d6d952e6dd2ce9',
     tarball: 'https://registry.npmjs.org/to-streamable/-/to-streamable-2.0.0.tgz' },
  directories: {} }

upload error

$ to-streamable video.mp4 --auth=foo:bar
Uploading...
/Users/username/.nvm/versions/node/v6.6.0/lib/node_modules/to-streamable/out/index.js:17
function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }


TypeError: Invalid attempt to destructure non-iterable instance
    at _slicedToArray (/Users/username/.nvm/versions/node/v6.6.0/lib/node_modules/to-streamable/out/index.js:17:492)
    at Request._callback (/Users/username/.nvm/versions/node/v6.6.0/lib/node_modules/to-streamable/out/index.js:64:21)
    at Request.self.callback (/Users/username/.nvm/versions/node/v6.6.0/lib/node_modules/to-streamable/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/Users/username/.nvm/versions/node/v6.6.0/lib/node_modules/to-streamable/node_modules/request/request.js:1060:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/Users/username/.nvm/versions/node/v6.6.0/lib/node_modules/to-streamable/node_modules/request/request.js:980:12)
    at IncomingMessage.g (events.js:291:16)

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.