GithubHelp home page GithubHelp logo

api-thetvdb's People

Contributors

criedel avatar modmax avatar omertron avatar r89m avatar taconaut avatar zeeshanasghar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api-thetvdb's Issues

[QUESTION] A suggestion for the weekly updates method

Hello,
I would like to make a suggestion about the method getWeeklyUpdates().
Because as for now, it returns all TVSeries updates, it would be useful to have the same method with a parameter for the TVSeries ID so that it will return only the updates of the single TVSeries. It's also for performance benefits.

Thank you in advance.

Series.getPoster null values

I discovered that there is the method getPoster in the Series class and I thought it would be useful because it should be quicker than retrieving the entire list of banners for each series.
The problem is that no string is returned, just null everytime.

NoSuchMethodError when calling TheTVDBApi.getAbsoluteEpisode

When calling TheTVDBApi.getAbsoluteEpisode I get this exception :
java.lang.NoSuchMethodError: No interface method requestContent(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String; in class Lorg/yamj/api/common/http/CommonHttpClient; or its super classes (declaration of 'org.yamj.api.common.http.CommonHttpClient'
I already have implemented api-commons-1.3 as library from the maven repository.
Any suggestions?
Thanks for your help

Handle errors when not internet connection is available

Right now no internet connection leads to a "mapping exception", cause nothing was read (or at least just a system message).
The response status in such cases is 0; so a response status of 0 should be handled as connection error and an appropiate API exception with exception type CONNECTION_ERROR should be thrown.

Use HTTP status codes for error handling

The http client only parses the body of the api response. There could be a lot more efficient error handling if the http response’s status code would be read.

NullPointerException when searching

I'm experiencing a NullPointerException in certain instances when calling searchSeries(). I'm not exactly sure why this is, but I suspect that the problem may be todo with getValidWebpage() returning null and getEventDocFromUrl() not checking it.

Here is code to reproduce the error:

import com.omertron.thetvdbapi.TheTVDBApi;
import com.omertron.thetvdbapi.model.Episode;
import com.omertron.thetvdbapi.model.Series;
import java.util.List;

public class NullPointerExample {

    private static final String API_KEY = "YOUR API KEY HERE";

    public static void main(String...args) throws Exception { 
        TheTVDBApi tvDB = new TheTVDBApi(API_KEY);
        List<Series> results = tvDB.searchSeries("Fairly odd parents", "en");
        for (Series series : results) {
            System.out.println(series.getId() + " " + series.getSeriesName());
            List<Episode> episodes = tvDB.getAllEpisodes(series.getId(), "en");
            for (Episode ep : episodes) {
                System.out.println(ep.getEpisodeNumber() + " " + ep.getEpisodeName());
            }
        }

    }

}

Here is the stack trace from the error:

Exception in thread "main" java.lang.NullPointerException
    at com.omertron.thetvdbapi.tools.DOMHelper.getEventDocFromUrl(DOMHelper.java:122)
    at com.omertron.thetvdbapi.tools.TvdbParser.getSeriesList(TvdbParser.java:256)
    at com.omertron.thetvdbapi.TheTVDBApi.searchSeries(TheTVDBApi.java:362)
    at NullPointerExample.main(NullPointerExample.java:13)

Search by IMDB

There is a feature on thetvdb.com to search for IMDB ID. Please have a look into this thread: https://forums.thetvdb.com/viewtopic.php?t=8083

It would be nice to copy method TheTVDBApi.searchSeries to TheTVDBApi.searchSeriesByIMDB and replace the endpoint
.append("GetSeries.php?seriesname=")
with
.append("GetSeriesByRemoteID.php?imdbid=")

Thanks a lot.

VerifyError on searchSeries before android 5.0

Sorry to disturb you again. I don't think this problem is related to your APIs but I don't know how to resolve it.
When running on android >= 5.0 everything works fine. If I run it in android < 5.0 it'll crash when calling searchSeries (when creating a TheTVDBApi it does not crash) and the exception says :
Caused by: java.lang.VerifyError: com/omertron/thetvdbapi/tools/TvdbParser
at com.omertron.thetvdbapi.TheTVDBApi.searchSeries(TheTVDBApi.java:362)

Do you have any suggestions? The dependencies should be right because it shouldn't work on >=5.0 if it is a dependencies problem.
I thank you for your time.

proxy handling

It would be nice to be able to work with the API also behind a proxy.

In the used lib (HttpComponentes) the java proxy system vars (-DproxySet=true -DproxyHost=myproxy -DproxyPort=8080) don't work. So you would have to use the proxy via the HttpComponents API


HttpHost target = new HttpHost("httpbin.org", 443, "https");
HttpHost proxy = new HttpHost("127.0.0.1", 8080, "http");

RequestConfig config = RequestConfig.custom().setProxy(proxy).build();
HttpGet request = new HttpGet("/");
request.setConfig(config);

CloseableHttpResponse response = httpclient.execute(target, request);

Packaging the API

Hi,

Since updating to version 1.8 of your library I've got issues packaging a working jar and hoped you could point me in the right direction.
I use the library in a plugin for ums-mlx where the plugin is being dynamically loaded on runtime. As I got a java.lang.NoClassDefFoundError when instantiating the library with private TheTVDBApi theTvDbApi = new TheTVDBApi("secret");. This led me to think either a dependency is missing or included with the wrong version. That's why I've included all the dependencies with the version specified in the maven repository in the project and package them in the jar with this pom.xml.

Now I get this exception:

WARN  14:17:10.730 [net.pms.PMS.main()] The plugin 'net.pms.plugin.fileimport.TheTVDBImportPlugin' couldn't be loaded
java.lang.NoSuchFieldError: INSTANCE
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144)
    at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:955)
    at org.yamj.api.common.http.SimpleHttpClientBuilder.build(SimpleHttpClientBuilder.java:208)
    at com.omertron.thetvdbapi.TheTVDBApi.<init>(TheTVDBApi.java:68)
    at net.pms.plugin.fileimport.TheTVDBImportPlugin.<init>(TheTVDBImportPlugin.java:72)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at java.lang.Class.newInstance(Class.java:442)
    at net.pms.plugins.PluginsFactory.lookup(PluginsFactory.java:323)
    at net.pms.PMS.init(PMS.java:579)
    at net.pms.PMS.createInstance(PMS.java:1112)
    at net.pms.PMS.main(PMS.java:1281)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
    at java.lang.Thread.run(Thread.java:745)

The exception still originates from the instantiation of TheTVDBApi.

Would you happen to know what I am missing?

NullPointerException when search a series with a title that not exist

Hi

Just to inform when is searching a series that not exist, api throw a null pointer exception.

String title = "fargo xsadasdasaad";
String language = "eng";
List<Series> results = tvDB.searchSeries(title, language);

See logs:
2016-03-13 21:51:13.296 ERROR 32142 --- [nio-8080-exec-2] c.j.aop.logging.LoggingAspect : Exception in com.jtrackseries.service.TVDBScratchService.findByTitle() with cause = null and exception {}

java.lang.NullPointerException: null
at com.omertron.thetvdbapi.tools.DOMHelper.getEventDocFromUrl(DOMHelper.java:122) ~[thetvdbapi-1.8.jar:]
at com.omertron.thetvdbapi.tools.TvdbParser.getSeriesList(TvdbParser.java:256) ~[thetvdbapi-1.8.jar:]
at com.omertron.thetvdbapi.TheTVDBApi.searchSeries(TheTVDBApi.java:362) ~[thetvdbapi-1.8.jar:]
at com.jtrackseries.service.TVDBScratchService.findByTitle(TVDBScratchService.java:31) ~[classes/:na]

doesn't work with latest API

Any chance of an update to make it work with the V3 API?

Things seem to be breaking (it seems yamj using this api can't download banners anymore)

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.