Skip to content

gitter-badger/wako

Repository files navigation

What is it?

wako is a mobile app (for now) build with ionic to sync what you're watching with trakt.tv. It also provides a simple remote control for Kodi and allow you to play any movies or tv shows (using providers) via Elementum addon

Features

  • Trakt.tv movies and shows sync
  • Notification on new aired episodes
  • Kodi remote control
  • Play any media from provider to kodi thanks to Elementum addons

Installation

Android

Go on the release page, download and install the latest apk for your device.

iOS

You have to build by yourself the app and running it on your device using xcode.

How it works?

Launch the app, sign in with trakt.tv and there you go.

Kodi

If you want to use wako as a kodi remote control you need to allow remote control via HTTP in Kodi > Settings > Services > Control. Then configure the host on wako > Settings > Kodi

Provider

When you navigate to a movie or tv show, wako is trying to find some sources for this media by using the providers you set. wako doesn't provide any providers, it has to be added manually in Settings > Providers. You need to add a list of providers in a JSON format:

{
  "my_first_provider": {
    "name": "MyProvider",
    "enabled": true,
    "enabled_in_list": true,
    "languages": ["en"],
    "base_url": "https://www.my-provider.com/search/",
    "response_type": "text",
    "movie": {
      "query": "{query}/Movies/1/",
      "keywords": "{title} {year}"
    },
    "episode": {
      "query": "{query}/TV/1/",
      "keywords": "{title} {episodeCode}"
    },
    "html_parser": {
      "row": "doc.querySelectorAll('tbody > tr')",
      "title": "row.querySelector('a:nth-child(2)').innerHTML",
      "peers": "row.querySelector('.leeches').innerHTML",
      "seeds": "row.querySelector('.seeds').innerHTML",
      "size": "row.querySelector('tbody > tr .size').textContent.split('B')[0] + 'B'",
      "url": "'https://www.my-provider.com/'+ row.querySelector('a:nth-child(2)').getAttribute('href')"
    }
  }
}

Here are all the properties that can be set:

export interface Provider {
 name: string;
 enabled: boolean;
 enabled_in_list: boolean;
 languages: string[];
 base_url: string;
 response_type: 'json' | 'text';
 time_to_wait_between_each_request_ms?: number;
 time_to_wait_on_too_many_request_ms?: number;
 token?: {
   query: string;
   token_validity_time_ms?: number;
   token_format: {
     token: string;
   };
 };
 movie?: {
   query: string;
   keywords: string;
 };
 episode?: {
   query: string;
   keywords: string;
 };
 json_format?: {
   results: string;
   sub_results?: string;
   url: string;
   title: string;
   seeds: string;
   peers: string;
   size: string;
   quality?: string;
 };
 html_parser?: {
   row: string;
   url: string;
   title: string;
   seeds: string;
   peers: string;
   size: string;
 };
}

Test a provider

  1. Clone the project, go into it, install dependencies npm i
  2. Edit the spec: src/app/shared/queries/torrents/torrent-from-provider.query.spec.ts
  3. Run the tests with ng test. This will open your browser and run the tests. Because of CORS issue you might have, you should bypass them see (https://www.thepolyglotdeveloper.com/2014/08/bypass-cors-errors-testing-apis-locally)
  4. To debug your provider see what's going on here: src/app/shared/queries/torrents/torrent-from-provider.query.ts:175 if you set response_type to json or here: src/app/shared/queries/torrents/torrent-from-provider.query.ts:251 in the other case

Screenshots