Skip to content

Instantly share code, notes, and snippets.

@x1unix
Last active March 21, 2017 12:45
Show Gist options
  • Save x1unix/498a1d2608b1a0eccb86661d34e748b0 to your computer and use it in GitHub Desktop.
Save x1unix/498a1d2608b1a0eccb86661d34e748b0 to your computer and use it in GitHub Desktop.
Moonwalker example
import com.x1unix.moonwalker;
import okhttp3.OkHttpClient;
class MyClass {
private static final String MOVIE_KINOPOISK_ID = "502838";
public static void main() {
Moonwalker moonwalker = new Moonwalker('http://mysite.com/');
moonwalker.getMovieByKinopoiskId(MOVIE_KINOPOISK_ID,
new Listener() {
@Override
public void onSuccess(final MoonVideo video, final OkHttpClient client) {
System.out.printLn('Video url:' + video.getPlaylist().getM3u8Manifest());
}
@Override
public void onError(Exception exception) {
final Exception ex = exception;
System.out.printLn('Failed to get video: '+ ex.getMessage());
}
}
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment