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

List of mirrors for banners? #27

Closed
mark-hahn opened this issue Dec 5, 2015 · 17 comments
Closed

List of mirrors for banners? #27

mark-hahn opened this issue Dec 5, 2015 · 17 comments
Assignees
Labels

Comments

@mark-hahn
Copy link

I need to get a URL to retrieve the banners. I assume I need to get the mirrors list and pick one. How do I do this?

@edwellbrook
Copy link
Owner

Hey, really sorry it's not clear.

The tvdb.getBanners method will return an array of objects of this format (as I'm sure you've discovered):

{
    id: '74141',
    BannerPath: 'fanart/original/73255-33.jpg',
    BannerType: 'fanart',
    BannerType2: '1280x720',
    Colors: '|57,57,57|27,17,15|48,31,23|',
    Language: 'en',
    Rating: '6.8636',
    RatingCount: '22',
    SeriesName: 'false',
    ThumbnailPath: '_cache/fanart/original/73255-33.jpg',
    VignettePath: 'fanart/vignette/73255-33.jpg'
}

The BannerPath key should be appended to "http://thetvdb.com/banners/", so the above example will be "http://thetvdb.com/banners/fanart/original/73255-33.jpg".

TheTVDB doesn't provide a list of mirrors for the banners as far as I know, so I will likely add in the base url there by default in the future.

Hope this clears things up and answers your question.

@mark-hahn
Copy link
Author

I just noticed the getBanners call. I was used to another library that had a getMirrors call.

Anyway, now I can't get the getBanners call to work. Here is my call and the result ...

tvdb.getBanners id, (err, res) ->
  console.log 'getBanners', {id, err, res}

tvdb: getBanners { id: '269593',
  err: { [Error: Could not complete the request] statusCode: 404 },
  res: undefined }

I got the id from here ...

  tvdb.getSeriesByName name, (err, res) ->
    console.log res

   [ { seriesid: '269593',
       language: 'en',
       SeriesName: 'About a Boy',
       banner: 'graphical/269593-g7.jpg',
       Overview: 'Based on the best-selling Nick Hornby novel, written/produced by Jason Katims and directed by Jon Favreau comes a different kind of coming-of-age story. Will Freeman lives a charmed existence as the ultimate man-child. After writing a hit song, he was granted a life of free time, free love and freedom from financial woes. He’s single, unemployed and loving it. So imagine his surprise when Fiona, a needy, single mom and her oddly charming 11-year-old son Marcus move in next door and disrupt his perfect world.',
       FirstAired: '2014-02-22',
       Network: 'NBC',
       IMDB_ID: 'tt2666270',
       zap2it_id: 'EP01738426',
       id: '269593' } ] }

I'll try to trace through the code. Thanks in advance...

@mark-hahn
Copy link
Author

I sent that before I got your reply. Thanks. I'll try to trace down the 404.

Edit: I got the 404 with your sample id of 74141 also. Something fishy is going on. I'll keep playing with this.

@edwellbrook
Copy link
Owner

oh, that's really odd. seems to work fine for me running:

tvdb.getBanners('269593', function(err, res) {})

Do let me know how you get on.

@mark-hahn
Copy link
Author

I found the problem. In compat/index/getBanners @token had a value of XXXXXXXXXX". Note the extra quote.

However, the banners result from tvdb was an empty array when using your sample id. I'll continue to beat on this.

@edwellbrook
Copy link
Owner

The sample id you're using (74141) is the id for the banner image. The id for the series in that example is 73255.

That looks like it might be your api key (edited comment above for you). Perhaps there was an error on your end when initialising the library?

@mark-hahn
Copy link
Author

Hah! Sorry. The quote was from my code. I don't know how getSeriesByName worked.

Weird. I'll continue to chase this. Sorry to bother you so much.

@mark-hahn
Copy link
Author

Everything is working. Thanks again and again I'm sorry I bothered you.

@edwellbrook
Copy link
Owner

Not at all! Thanks for reaching out. Really happy I could help!

@edwellbrook
Copy link
Owner

Also, in case you're curious, the reason getSeriesByName worked was because it doesn't need or use an API key :)

@mark-hahn
Copy link
Author

Aha. That gave me the false idea that I had the key right. By the time I'm done I'll be an expert on your code. Maybe I can contribute something someday. :-)

@edwellbrook
Copy link
Owner

Sorry that wasn't clear either! Please do. If there's anything that could be done to make things clearer for you, please open an issue or pull request with some suggestions :)

@mark-hahn
Copy link
Author

A quick question. Do you know why the getTime call is there? When would it be useful?

@edwellbrook
Copy link
Owner

Not needed for most use cases, but theres an example of its use here (see initial database processing section)

http://thetvdb.com/wiki/index.php/Programmers_API

@edwellbrook edwellbrook changed the title mirrors? List of mirrors for banners? Dec 6, 2015
@mark-hahn
Copy link
Author

I'm sorry to be a pain but I can't find other url headers like "http://thetvdb.com/banners/". I looked in the tvdb wiki with no luck.

I specifically need it for episode.filename (episodes/269593/4570034.jpg), which I assume is the episode thumbnail, and actor.Image (actors/326286.jpg).

I tried http://thetvdb.com/episodes/269593/4570034.jpg and http://thetvdb.com/actors/326286.jpg and got 404s.

@edwellbrook
Copy link
Owner

No worries. You want to use "http://thetvdb.com/banners/" + banner where banner is something like "episodes/269593/4570034.jpg".

Those urls do not work, but http://thetvdb.com/banners/episodes/269593/4570034.jpg, for example does. Notice the entirety of "http://thetvdb.com/banners/" is in the url used.

Hope this clarifies things!

@mark-hahn
Copy link
Author

Thanks. I didn't think to try that.

On Sun, Dec 6, 2015 at 3:05 PM, Ed Wellbrook notifications@github.com
wrote:

No worries. You want to use "http://thetvdb.com/banners/" + banner where
banner is something like "episodes/269593/4570034.jpg".

Those urls do not work, but
http://thetvdb.com/banners/episodes/269593/4570034.jpg, for example does.
Notice the entirety of "http://thetvdb.com/banners/" is in the url used.

Hope this clarifies things!


Reply to this email directly or view it on GitHub
#27 (comment)
.

@edwellbrook edwellbrook self-assigned this Aug 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants