# Jen

## 1 Introduction to Jen

### 1.1 What is Jen?

Jen is an addon written by a long time Kodi Developer. It is free to use and has universalscrapers integrated into it. This addon does not host any of the content which is found and has no affiliation with any of the content providers. This addon simply searches websites for content. Use at your own risk!

## 2 How to Install Jen

### 2.1 Follow the Instructions to Make a Jen Addon

#### 2.1.1 Add an Icon

- Add an icon to the main jen folder.
- It should be 512 x 512 and it must be called icon.png

#### 2.1.2 Add Fanart

- Add fanart to the main jen folder
- It should be 1920 x 1080 and must be called fanart.jpg

#### 2.1.3 Changing the addon.xml

- Change the addon id and name and anything else you need to suit your addon.

#### 2.1.4 Change the name of the folder

- Change the name of the folder from plugin.video.jen to the addon id in your addon.xml

#### 2.1.5 Changing the settings.xml

- Open resources/settings.xml
- Change plugin.video.jen to the addon id in your addon.xml
- Add your apis to each default=""
- Add your path to your main menu xml file to the default="". If it is a website url, enter the full url.
- Configure the Service settings using the default="" entries. The service is used to update the root xml path and api keys if you ever need to change them. Defaults will work fine.

#### 2.1.6 Change entries in the strings.po files

- Change the first 3 lines of your strings.po files in /resources/language to your Addon ID, provider, and addon name

## 3 How to Get API Keys for Jen

### 3.1 TMDB

- You can get a TMDB Api by going to website.
- Use google.com for url

### 3.2 TRAKT

- You can get a Trakt Api by clicking here
- Use google.com for url

### 3.3 TVDB

- You can get a TVDB Api by clicking here
- May need to be signed in to your account to access this page

### 3.4 Last.fm

- You can get a Last.fm Api by clicking here
- Go to the Getting Started section on this page

## 4 Upgrading Jen

- Slide over your icon, fanart, strings.po, settings from your copy of settings.xml and copy over the stuff from your addon.xml to the new version
- Copy over the configuration variables in your default.py to the new location in resources/settings.xml (Jen Template v1.5 and higher) - DO NOT OVERWRITE THE DEFAULT.PY WITH YOURS
- Update your addon.xml version number (if required)
- Zip up the new folder and add the correct version number to the end eg. plugin.video.jen-1.1.zip
- Push out new version

## 5 Jen Plugins

### 5.1 How to Add a Plugin

- Plugins are found in resources/lib/plugins.
- The plugin.py can be found in resources/lib/util
- You can see where you can overwrite default behavior. If there are any other useful ones, open an issue.

### 5.2 Using Trakt Plugin

#### 5.2.1 How to Add a Trakt List

    <dir>
        <title></title>
        <trakt></trakt>
    </dir>

- See the trakt.py for examples

#### 5.2.2 How to Find Lists in Trakt that Belong to Others

1. Go to search and type what you're looking for eg. War
2. Click on Lists on the left
3. Open a list
4. Copy the list's url and add the "api." to the beginning of it and "/items" to the end of it (see "How to Add an Individual Trakt List to your XML above)

- Example of a user's URL
- Example of a same URL put in your xml file with "api." and "/items" added to it

#### 5.2.3 How to Fix Trakt Lists that Aren't Showing

1. Make sure the trakt url is correct.
2. If your list is private (or account is private), then you need to make both public.
3. Make sure you have trakt apis in settings.xml
4. Make sure the plugins folder has the unidecode folder.
5. Make sure you have the TMDB Api in settings.xml as well. If you don't want to get a TMDB Api you will need to go to resources/lib/plugins/trakt.py and change line 113 from
6. Make sure you have the trakt/tmdb api key. Sometimes they get cancelled or expired.

    SKIP_TMDB_INFO = False to SKIP_TMDB_INFO = True
    **Note this will let you open lists but you will not have artwork**

### 5.3 Using TMDB Plugin

#### 5.3.1 How to Add a TMDB List

    <dir>
        <title></title>
        <tmdb></tmdb>
    </dir>

- See the TMDB.py for examples.

#### 5.3.2 How to Fix TMDB Lists that Aren't Showing

1. Make sure the tmdb url is correct.
2. Make sure you have tmdb apis in settings.xml
3. Make sure the plugins folder has the unidecode folder.
4. Make sure you have the trakt/tmdb api key. Sometimes they get cancelled or expired.

### 5.4 Using IMDB Plugin

#### 5.4.1 How to Add an IMDB List

    <dir>
        <title></title>
        <imdburl></imdburl>
    </dir>

### 5.5 Using Last.fm Plugin

#### 5.5.1 How to Add an Artist Track List

    <dir>
        <title>Muse Tracks</title>
        <lastfm>artist/muse/tracks</lastfm>
    </dir>

#### 5.5.2 How to Add an Artist Album List

    <dir>
        <title>Muse Albums</title>
        <lastfm>artist/muse/albums</lastfm>
    </dir>

### 5.6 Using TVMaze Plugin

#### 5.6.1 How to Add an Artist Track List

    <dir>
        <title>All Networks</title>
        <tvmaze>country/all</tvmaze>
    </dir>

## 6 Hosting

### 6.1 Hosting for XML and Thumbnails (Overview and Tips)

#### 6.1.1 XML and Image Hosting Online

- Root XML setting and even links to other menu files are always the full URL to the file

    <dir>
        <title>Cartoons</title>
        <link>http://www.example.com/menus/cartoons.xml</link>
    </dir>

- Images, such as Fanart and Thumbnails, are always the full URL to the file

    <dir>
        <title>Cartoons</title>
        <link>http://www.example.com/menus/cartoons.xml</link>
        <thumbnail>http://www.example.com/artwork/toonicon.png</thumbnail>
        <fanart>http://www.example.com/artwork/toon_fanart.jpg</fanart>
    </dir>

#### 6.1.2 XML and Image Hosting Local

- Root XML setting and even links to other menu files are always pre-pended with file://
- Local xml files root path starts in the xml folder under your Addon.

    Example for an xml file in the root of your xml folder

    <dir>
        <title>Main Menu</title>
        <link>file://main.xml</link>
    </dir>

- You can put xml files locally in subfolders to help organize them better. Just include the subfolder name as part of the path

    Example for an xml file in the subfolder calls toons under the xml folder

    <dir>
        <title>Cartoons</title>
        <link>file://toons/cartoons.xml</link>
    </dir>

- You can link to thumbnails and fanart from folders in Kodi using the "special://" links like below

    To access artwork from your addon, or any other addon, use special://home/addons as the first part of the path

    <dir>
        <title>Cartoons</title>
        <link>file://toons/cartoons.xml</link>
        <thumbnail>special://home/addons/plugin.video.jen/resources/media/toonicon.png</thumbnail>
        <fanart>special://home/addons/plugin.video.jen/resources/media/toon_fanart.jpg</fanart>
    </dir>

### 6.2 Using Github for Hosting

#### 6.2.1 How to get Raw URL

- Click on the file you want the url for.
- Click on the raw icon.
- Copy the url in the address bar.

### 6.3 Using Pastebin for Hosting

#### 6.3.1 How to get Raw URL

- Click on the file you want the url for.
- Click on the raw icon.
- Copy the url in the address bar.

## 7 How to Add Search to Jen

### 7.1 Trakt

    <dir>
        <title>Search Trakt</title>
        <trakt>search</trakt>
    </dir>

### 7.2 TMDB

    <dir>
        <title>Search TMDB</title>
        <tmdb>search</tmdb>
    </dir>

### 7.3 IMDB

    <dir>
        <title>Search IMDB</title>
        <imdburl>search</imdburl>
    </dir>

### 7.4 Last.fm

    <dir>
        <title>Search Last.fm for Artists</title>
        <lastfm>search/artist</lastfm>
    </dir>

    <dir>
        <title>Search Last.fm for Albums</title>
        <lastfm>search/album</lastfm>
    </dir>

## 8 XML Formats for Jen

- You can find all formats in xml/other/jenformats.xml

## 9 Adding Customized Icons

- Add these to your main.xml in order to add these icons to your startup screen.
- Just change plugin.video.jen to your addon id

### 9.1 Settings

    <plugin>
        <name>30701</name>
        <link>plugin://plugin.video.jen/?action=openSettings</link>
        <thumbnail></thumbnail>
    </plugin>

### 9.2 Search

    <plugin>
        <name>30702</name>
        <link>plugin://plugin.video.jen/?action=search</link>
        <thumbnail></thumbnail>
    </plugin>

## 10 Changing List Colours

- You can change a list colour for trakt and tmdb lists by opening the py files and changing the <title> colour.
- Only the title above the meta tag needs changing. See below. Change blue to whatever colour you want.

    Movies

        xml = "<item>" \
              "<title>[COLOR blue]%s[/COLOR]</title>" \
              "<meta>" \
              "<content>movie</content>" \
              "<imdb>%s</imdb>" \
              "<title>%s</title>" \
              "<year>%s</year>" \
              "</meta>" \
              "<link>" \
              "<sublink>search</sublink>" \
              "<sublink>searchsd</sublink>" \
              "</link>" \
              "<thumbnail>%s</thumbnail>" \
              "<fanart>%s</fanart>" \
              "</item>" % (title, imdb, title, year, thumbnail, fanart)
        return xml

    TV Show

        xml = "<dir>"\
              "<title>[COLOR blue]%s[/COLOR]</title>"\
              "<meta>"\
              "<content>tvshow</content>"\
              "<imdb>%s</imdb>"\
              "<tvshowtitle>%s</tvshowtitle>"\
              "<year>%s</year>"\
              "</meta>"\
              "<link>trakt_tv_show(%s, %s, %s, %s, %s)</link>"\
              "<thumbnail>%s</thumbnail>" \
              "<fanart>%s</fanart>" \
              "</dir>" % (title, imdb, title, year, trakt_id, year, title, tmdb,
                          imdb, thumbnail, fanart)
        return xml

    TV Seasons

        xml = "<dir>"\
              "<title>[COLOR blue]Season %s[/COLOR]</title>"\
              "<meta>"\
              "<imdb>%s</imdb>"\
              "<content>season</content>"\
              "<season>%s</season>"\
              "</meta>"\
              "<link>trakt_season(%s,%s, %s, %s, %s, %s)</link>"\
              "<thumbnail>%s</thumbnail>" \
              "<fanart>%s</fanart>" \
              "</dir>" % (season, imdb, season, trakt_id, season, year,
                          tvtitle, tmdb,
                          imdb, thumbnail, fanart)
        return xml

    TV Episodes

        xml = "<item>"\
              "<title>[COLOR blue]%s[/COLOR]</title>"\
              "<meta>"\
              "<content>episode</content>"\
              "<imdb>%s</imdb>"\
              "<tvshowtitle>%s</tvshowtitle>"\
              "<year>%s</year>"\
              "<title>%s</title>"\
              "<premiered>%s</premiered>"\
              "<season>%s</season>"\
              "<episode>%s</episode>"\
              "</meta>"\
              "<link>"\
              "<sublink>search</sublink>"\
              "<sublink>searchsd</sublink>"\
              "</link>"\
              "<thumbnail>%s</thumbnail>" \
              "<fanart>%s</fanart>" % (
                  title, imdb, tvtitle, year, title,
                  premiered, season, episode,
                  thumbnail, fanart)
        xml += "</item>"
        return xml

## 11 First Time Install And Dependencies

- Make sure you either have all the dependencies installed from your addon.xml or simply install a repo that already has Jen addons in it.

## 12 Setting Up Your First Repository

- Click on the image below to go to a video series on setting up your first repo the easiest way possible.

## 13 Making Your Jen Private

- This is an overview of making your Jen require a username and password to access the main menu.
- Requires Jen Template v1.8 or higher.

### 13.1 Settings.XML Entries

        <setting id="use-account" type="bool" label="30200" default="false" visible="false"/>
        <setting id="username" type="text" label="30201" default="" enable="!eq(-1,false)"/>
        <setting id="password" type="text" label="30202" default="" option="hidden" enable="!eq(-2,false)"/>
        <setting id="login_message_style" type="select" label="30209" values="notification|popup|none" default="notification" visible="true" enable="!eq(-3,false)" />
        <setting id="login_url" type="text" label="30204" default="PUT FULL URL USED TO VERIFY LOGIN" visible="false"/>
        <setting id="user_var" type="text" label="30206" default="username" visible="false"/>
        <setting id="pwd_var" type="text" label="30207" default="password" visible="false"/>
        <setting id="session_length" type="text" label="30208" default="24" visible="false"/>
        <setting id="login_verified" type="text" label="30205" default="Welcome to" visible="false"/>
        <setting id="login_welcome_msg" type="text" label="30210" default="Welcome to Jen %s" visible="false"/>
        <setting id="login_failed_msg" type="text" label="30211" default="Username or Password was incorrect %s" visible="false"/>
        <setting id="login_required_msg" type="text" label="30212" default="Please enter a valid username and password in Settings" visible="false"/>

- id 'use-account' : Change "default" to "true" to require a login for your Jen
- id 'username' : This is set by the end user for a valid username
- id 'password' : This is set by the end user for a valid password
- id 'login_message_style' : This is set by the end user, to choose how they wish to see the login success message
- id 'login_url' : Full url to your login page. Example: "http://www.example.com/login.php"
- id 'user_var' : Variable name the login form uses for usernames, not visible to the user
- id 'pwd_var' : Variable name the login form uses for passwords, not visible to the user
- id 'session_length' : Set to the length, in hours, you want their session to be in Kodi
- id 'login_verified' : Set default to text string unique to the page displayed after a successful login. Such as "Howdy, " for Wordpress or if using the supplied login template, "Welcome to"
- id 'login_welcome_msg' : Set the message you want to be given on a successful login (can use one %s in string to insert username)
- id 'login_failed_msg' : Set the message you want to be given on a failed login (can use one %s in string to insert username)
- id 'login_required_msg' : Set the message you want given if username/password is blank

### 13.2 Login Form On Website

- A basic understanding of html, forms, and form values may be needed for customization. If you need help, it is available in the Jen Chat on Telegram.
- You must ensure the weblogin.py is sending the right "username" and "password" variables to your website for login verification.
- The supplied template/example in the login folder with the Jen Template uses "username" and "password", which is what is already in the settings.xml
- For example, if you are using Wordpress for your website and want to verify the accounts through your website, change the user_var to "log" for username, and pwd_var to "pwd" for password