Closed rob1998 closed 9 years ago
Didn't know they updated the API. I will take a look at what changes are required and see if I can find the time to do it. Thanks for the heads up.
They also updated there website a few weeks ago, maybe they released a new api at the same moment? Thanks in advance!
I will be working on this during this week. There will be a lot of changes since all the models have changed, and a few more methods have been aded. YtsClient will still be the only main class, but the api will change slightly.
Will I need to change my code?
Yes, the Yts API v2 is not backward compatible. Because of this, I can not provide a backward compatible update of the library.
Thank you for all your work! I'm having some problems with rx.Observable do I need to fix these or will it be removed from the final version?
What kind of problems are you having? RxJava is a dependency on the project now, so the build should work just fine with both, Gradle and Maven.
I've never worked with Gradle or Maven so that's the problem, I use eclipse and I just import the libraries I need
I will make the library available on Maven Central as part of the 0.2.0 release. I would recommend you to get familiarised as it's a standard to provide libraries dependencies easily.
Am I doing something wrong here:
private static YtsClient client = new YtsClient.Builder().withMovies().log( LogLevel.FULL ).url( "http://yts.re/api/v2" ).build();
Map<String, Object> options = new HashMap<>();
options.put("quality", "1080p");
options.put("limit", 48);
MovieModule moviesModule = client.movies();
System.out.println(moviesModule);
YtsResponse<MoviePage> response = moviesModule.list(options);
System.out.println(response);
Because it returns this:
retrofit.RestAdapter$RestHandler@2ee1104b
---> HTTP GET http://yts.re/api/v2/list_movies.json?limit=48&quality=1080p
---> END HTTP (no body)
<--- HTTP 302 http://yts.re/api/v2/list_movies.json?limit=48&quality=1080p (191ms)
X-Frame-Options: SAMEORIGIN
: HTTP/1.1 302 Found
X-Varnish: 68190085
Server: nginx
X-Content-Type-Options: nosniff
Connection: keep-alive
X-Frontend: SK
Content-Length: 0
Date: Tue, 24 Mar 2015 01:37:31 GMT
Location: https://yts.to/api/v2/list_movies.json?limit=48&quality=1080p
<--- END HTTP (0-byte body)
Exception in thread "AWT-EventQueue-0" retrofit.RetrofitError: 302 Found
at retrofit.RetrofitError.httpError(RetrofitError.java:40)
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:388)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240)
at com.sun.proxy.$Proxy0.list(Unknown Source)
at mediaCollector.GUI.loadMoviesDownloads(GUI.java:363)
at mediaCollector.GUI$4.mouseClicked(GUI.java:197)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
This is an API server domain redirect issue. I've tried it and I got an error the first time, but started working right after that test.
Apparently they changed the main DNS to yts.to
, instead of yts.re
. I would recommend you to initialize the YtsClient
with url https://yts.to/api/v2
to avoid the overhead of the redirects.
Thank you!
I have just merge the api_v2 into master, meaning that all API v2 is currently supported and have integration tests for samples.
v0.2.0 has been released and gives full support for YTS api v2.
It's also available in Maven Central
Hi
I got this message: "NOTICE":"This API is deprecated and will not be in use in a few weeks, please update your applications to use APIv2, see our docs for more info". Are you going to update?