yocontra / nodecast

Node interface to DIAL/RAMP/ChromeCast
MIT License
163 stars 23 forks source link

Error Starting Youtube App #20

Closed soloam closed 6 years ago

soloam commented 6 years ago

Hello I opened a new issue because this is a new problem, getting this error calling the youtube app:

The Code:

#!/usr/bin/env node

var nodecast = require('nodecast');

var devices = nodecast.find();

devices.on('device', function(device) {
    console.log('Details for ', device.name)

    var yt = device.app('YouTube');

    yt.start('v=UxWqEFHNOBM', function(err) {
        console.log('Youtube for ', device.name)

        // starts the app on the device
        // also optionally takes data to pass to the app
        // (for example: youtube takes v=id to launch with a video)

        if (err) console.log('error starting', err);

        console.log('Started on', device.name);

    });

});

The Error:

Details for  OSMC-Sala
Youtube for  OSMC-Sala
error starting { Error: Not Found
    at Request.callback (/home/diogo/node_modules/superagent/lib/node/index.js:706:15)
    at IncomingMessage.parser (/home/diogo/node_modules/superagent/lib/node/index.js:916:18)
    at IncomingMessage.emit (events.js:185:15)
    at endReadableNT (_stream_readable.js:1106:12)
    at process._tickCallback (internal/process/next_tick.js:178:19)
  status: 404,
  response: 
   Response {
     _events: {},
     _eventsCount: 0,
     _maxListeners: undefined,
     res: 
      IncomingMessage {
        _readableState: [ReadableState],
        readable: false,
        _events: [Object],
        _eventsCount: 4,
        _maxListeners: undefined,
        socket: [Socket],
        connection: [Socket],
        httpVersionMajor: 1,
        httpVersionMinor: 0,
        httpVersion: '1.0',
        complete: true,
        headers: [Object],
        rawHeaders: [Array],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '',
        method: null,
        statusCode: 404,
        statusMessage: 'Not Found',
        client: [Socket],
        _consuming: true,
        _dumped: false,
        req: [ClientRequest],
        text: 'Only Youtube is supported',
        read: [Function] },
     request: 
      Request {
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        _agent: false,
        _formData: null,
        method: 'POST',
        url: 'http://192.168.1.72:8008/appsYouTube',
        _header: [Object],
        header: [Object],
        writable: true,
        _redirects: 0,
        _maxRedirects: 5,
        cookies: '',
        qs: {},
        _query: [],
        qsRaw: [],
        _redirectList: [],
        _streamRequest: false,
        _buffer: true,
        _data: 'v=UxWqEFHNOBM',
        req: [ClientRequest],
        protocol: 'http:',
        host: '192.168.1.72:8008',
        _endCalled: true,
        _callback: [Function],
        res: [IncomingMessage],
        response: [Circular],
        called: true },
     req: 
      ClientRequest {
        _events: [Object],
        _eventsCount: 3,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        upgrading: false,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: false,
        _removedConnection: false,
        _removedContLen: false,
        _removedTE: false,
        _contentLength: 13,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [Socket],
        connection: [Socket],
        _header: 'POST /appsYouTube HTTP/1.1\r\nHost: 192.168.1.72:8008\r\nAccept-Encoding: gzip, deflate\r\nUser-Agent: node-superagent/3.8.3\r\nContent-Type: text/plain\r\nContent-Length: 13\r\nConnection: close\r\n\r\n',
        _onPendingData: [Function: noopPendingOutput],
        agent: [Agent],
        socketPath: undefined,
        timeout: undefined,
        method: 'POST',
        path: '/appsYouTube',
        _ended: true,
        res: [IncomingMessage],
        aborted: undefined,
        timeoutCb: null,
        upgradeOrConnect: false,
        parser: null,
        maxHeadersCount: null,
        [Symbol(isCorked)]: false,
        [Symbol(outHeadersKey)]: [Object] },
     text: 'Only Youtube is supported',
     body: {},
     files: undefined,
     buffered: true,
     headers: 
      { date: 'Fri, 07 Sep 2018 09:46:59 GMT',
        server: 'WSGIServer/0.1 Python/2.7.13',
        'content-length': '25',
        'content-type': 'text/html; charset=UTF-8' },
     header: 
      { date: 'Fri, 07 Sep 2018 09:46:59 GMT',
        server: 'WSGIServer/0.1 Python/2.7.13',
        'content-length': '25',
        'content-type': 'text/html; charset=UTF-8' },
     statusCode: 404,
     status: 404,
     statusType: 4,
     info: false,
     ok: false,
     redirect: false,
     clientError: true,
     serverError: false,
     error: 
      { Error: cannot POST /appsYouTube (404)
    at Response.toError (/home/diogo/node_modules/superagent/lib/node/response.js:94:15)
    at ResponseBase._setStatusProperties (/home/diogo/node_modules/superagent/lib/response-base.js:123:16)
    at new Response (/home/diogo/node_modules/superagent/lib/node/response.js:41:8)
    at Request._emitResponse (/home/diogo/node_modules/superagent/lib/node/index.js:752:20)
    at IncomingMessage.parser (/home/diogo/node_modules/superagent/lib/node/index.js:916:38)
    at IncomingMessage.emit (events.js:185:15)
    at endReadableNT (_stream_readable.js:1106:12)
    at process._tickCallback (internal/process/next_tick.js:178:19)
        status: 404,
        text: 'Only Youtube is supported',
        method: 'POST',
        path: '/appsYouTube' },
     created: false,
     accepted: false,
     noContent: false,
     badRequest: false,
     unauthorized: false,
     notAcceptable: false,
     forbidden: false,
     notFound: true,
     unprocessableEntity: false,
     type: 'text/html',
     charset: 'UTF-8',
     links: {},
     setEncoding: [Function: bound ],
     redirects: [] } }
Started on OSMC-Sala
Details for  VIERA VT60 Series
Youtube for  VIERA VT60 Series
error starting { Error: Not Found
    at Request.callback (/home/diogo/node_modules/superagent/lib/node/index.js:706:15)
    at IncomingMessage.parser (/home/diogo/node_modules/superagent/lib/node/index.js:916:18)
    at IncomingMessage.emit (events.js:185:15)
    at endReadableNT (_stream_readable.js:1106:12)
    at process._tickCallback (internal/process/next_tick.js:178:19)
  status: 404,
  response: 
   Response {
     _events: {},
     _eventsCount: 0,
     _maxListeners: undefined,
     res: 
      IncomingMessage {
        _readableState: [ReadableState],
        readable: false,
        _events: [Object],
        _eventsCount: 4,
        _maxListeners: undefined,
        socket: [Socket],
        connection: [Socket],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Array],
        trailers: {},
        rawTrailers: [],
        upgrade: false,
        url: '',
        method: null,
        statusCode: 404,
        statusMessage: 'Not Found',
        client: [Socket],
        _consuming: true,
        _dumped: false,
        req: [ClientRequest],
        text: '',
        read: [Function] },
     request: 
      Request {
        _events: {},
        _eventsCount: 0,
        _maxListeners: undefined,
        _agent: false,
        _formData: null,
        method: 'POST',
        url: 'http://192.168.1.65:55000/nrc/dialYouTube',
        _header: [Object],
        header: [Object],
        writable: true,
        _redirects: 0,
        _maxRedirects: 5,
        cookies: '',
        qs: {},
        _query: [],
        qsRaw: [],
        _redirectList: [],
        _streamRequest: false,
        _buffer: true,
        _data: 'v=UxWqEFHNOBM',
        req: [ClientRequest],
        protocol: 'http:',
        host: '192.168.1.65:55000',
        _endCalled: true,
        _callback: [Function],
        res: [IncomingMessage],
        response: [Circular],
        called: true },
     req: 
      ClientRequest {
        _events: [Object],
        _eventsCount: 3,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        upgrading: false,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: false,
        _removedConnection: false,
        _removedContLen: false,
        _removedTE: false,
        _contentLength: 13,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [Socket],
        connection: [Socket],
        _header: 'POST /nrc/dialYouTube HTTP/1.1\r\nHost: 192.168.1.65:55000\r\nAccept-Encoding: gzip, deflate\r\nUser-Agent: node-superagent/3.8.3\r\nContent-Type: text/plain\r\nContent-Length: 13\r\nConnection: close\r\n\r\n',
        _onPendingData: [Function: noopPendingOutput],
        agent: [Agent],
        socketPath: undefined,
        timeout: undefined,
        method: 'POST',
        path: '/nrc/dialYouTube',
        _ended: true,
        res: [IncomingMessage],
        aborted: undefined,
        timeoutCb: null,
        upgradeOrConnect: false,
        parser: null,
        maxHeadersCount: null,
        [Symbol(isCorked)]: false,
        [Symbol(outHeadersKey)]: [Object] },
     text: '',
     body: {},
     files: undefined,
     buffered: true,
     headers: { connection: 'close' },
     header: { connection: 'close' },
     statusCode: 404,
     status: 404,
     statusType: 4,
     info: false,
     ok: false,
     redirect: false,
     clientError: true,
     serverError: false,
     error: 
      { Error: cannot POST /nrc/dialYouTube (404)
    at Response.toError (/home/diogo/node_modules/superagent/lib/node/response.js:94:15)
    at ResponseBase._setStatusProperties (/home/diogo/node_modules/superagent/lib/response-base.js:123:16)
    at new Response (/home/diogo/node_modules/superagent/lib/node/response.js:41:8)
    at Request._emitResponse (/home/diogo/node_modules/superagent/lib/node/index.js:752:20)
    at IncomingMessage.parser (/home/diogo/node_modules/superagent/lib/node/index.js:916:38)
    at IncomingMessage.emit (events.js:185:15)
    at endReadableNT (_stream_readable.js:1106:12)
    at process._tickCallback (internal/process/next_tick.js:178:19)
        status: 404,
        text: '',
        method: 'POST',
        path: '/nrc/dialYouTube' },
     created: false,
     accepted: false,
     noContent: false,
     badRequest: false,
     unauthorized: false,
     notAcceptable: false,
     forbidden: false,
     notFound: true,
     unprocessableEntity: false,
     type: '',
     links: {},
     setEncoding: [Function: bound ],
     redirects: [] } }
Started on VIERA VT60 Series

Thank you

yocontra commented 6 years ago

Just pushed a 1.0.1 that should fix this issue. Let me know if it works and I'll close the issue.

Thank you for opening tickets - I haven't had to use this library for a while, so dependency changes have broken a few things but they should be fixed now.

soloam commented 6 years ago

I owe you a beer =) Its working =D

Thank you for all your help and work :+1:

yocontra commented 6 years ago

Nice!