Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getSeriesByName fails if the name needs to be URL-encoded #86

Closed
axelstudios opened this issue Apr 23, 2017 · 1 comment
Closed

getSeriesByName fails if the name needs to be URL-encoded #86

axelstudios opened this issue Apr 23, 2017 · 1 comment

Comments

@axelstudios
Copy link

axelstudios commented Apr 23, 2017

Some series' names, at least ones with an ampersand, need to be url encoded. It probably makes more sense to change this on the library side:

Not working: tvdb.getSeriesByName('Eastbound & Down')
Working: tvdb.getSeriesByName(encodeURIComponent('Eastbound & Down'))

Error message

{ Error: Requires only one of name, imdbId, zap2itId params
    at res.json.then (C:\Commands\node_modules\node-tvdb\index.js:451:23)
    at process._tickCallback (internal/process/next_tick.js:109:7)
  response:
   Body {
     url: 'https://api.thetvdb.com/search/series?name=Eastbound & Down',
     status: 405,
     statusText: 'Method Not Allowed',
     headers: Headers { _headers: [Object] },
     ok: false,
     body:
      PassThrough {
        _readableState: [Object],
        readable: false,
        domain: null,
        _events: [Object],
        _eventsCount: 3,
        _maxListeners: undefined,
        _writableState: [Object],
        writable: false,
        allowHalfOpen: true,
        _transformState: [Object] },
     bodyUsed: true,
     size: 0,
     timeout: 0,
     _raw: [ <Buffer 7b 0a 20 20 22 45 72 72 6f 72 22 3a 20 22 52 65 71 75 69 72 65 73 20 6f 6e 6c 79 20 6f 6e 65 20 6f 66 20 6e 61 6d 65 2c 20 69 6d 64 62 49 64 2c 20 7a ... > ],
     _abort: false,
     _bytes: 67 } }
@edwellbrook
Copy link
Owner

Thanks for the heads up! Just fixed and updated on npm (v3.1.2). Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants