Jumpy - Jump into Python (and onto Kodi)
Jumpy (Java Underlay for Modules in PYthon) is a framework for scripts or other external processes to plug into PS3 Media Server (or its cousin UMS) and mainly- add folders and media items to the xmb.
- act as user-defined external players.
Jumpy began with my having grown tired of occasionally poaching stuff 'by hand' from xbmc (Kodi) addons for use in PMS, and deciding to see if I could mock the xbmc plugin API itself so as to run these addons under PMS as-is. The result is Jumpy plus jumpy-xbmc, an included set of python modules to 'jump' the xbmc addons.
Jumpy-xbmc works with most Kodi video addons: Hulu, Free Cable, Al Jazeera, PBS, Academic Earth, YouTube, and many more. Addons are 'mostly' functional in the sense that all content is shown but interactive features that require user input are inactive.
Jumpy itself is general-purpose, of course, and you can use it to plug your own scripts, python or other, into PMS as well.
Quick Setup
- Shut down PMS.
- Put the installer ) in your PMS plugins folder. (
-
Launch it and follow through as usual with external package installers if prompted
(yes, you can install to alternate locations or skip packages if you want).
Windows note: if the installer fails try launching it as administrator (right-click > Run as administrator).
Quickest: install automatically from the UMS Plugin Management tab.
Or else use the installer directly:
Future updates can be installed directly from the jumpy gui panel.
You should end up with
jumpy
, python
, py4j
, beautifulsoup4
, lxml
, polib
, Kodi
, rtmpdump
,
phantomjs
, youtube-dl
, and an updated PMS.conf all ready to go and can skip
the grey section below ('mostly', i.e. maybe install
some kodi addons or
PMSEncoder).
Requirements / Manual Installation
Kodi Installation ("optional")
PhantomJS Installation (optional)
Plugin Installation
- Python 2.7. To make life simpler add python to your system path and then set up easy_install.
- Python modules:
- py4j
- beautifulsoup4
- lxml
(in Windows must be version 2.3, use
easy_install "lxml==2.3"
)
- polib
- Not required but useful if you're using PMS: rtmpdump and PMSEncoder, .
Kodi Installation ("optional")
- Install Kodi using the default configuration for your platform.
- Install and configure some addons inside Kodi (and of course test them too, some are broken). You may need to configure username/password depending on the addon, and so on.
PhantomJS Installation (optional)
-
To use the included webreader browser install phantomjs
in one of these places:
- inside your PMS installation's binaries folder (i.e. in win32, linux or osx).
- or inside the plugins/jumpy/webreader folder.
- or anywhere, adding its binary folder path to the
bin.path
setting in PMS.conf (create it if it doesn't exist):bin.path = c:\\path\\to\\phantomjsFolder
Plugin Installation
- Unzip jumpy-0.3.10.zip to your PMS plugins folder.
- Open up PMS.conf and set
python.path
, e.g.python.path = c:\\Python27\\python
If you're using rtmpdump, or want to enable a script language, let's say perl, create a.path
for each if it doesn't already exist:rtmpdump.path = c:\\rtmpdump\\rtmpdump.exe perl.path = c:\\perl\\bin\\perl.exe
- Restart PMS. You should see a 'Jumpy' folder on the xmb containing the examples and any media addons found in your Kodi user directory.
-
When updating by hand you may want to merge any new sections or changes in
plugins/jumpy/examples/sample-jumpy-scripts.ini
into your own jumpy-scripts.ini.
Windows Short Paths
-
In Windows jumpy uses several 'short' paths (e.g. in the
pms
and imconvert
variables)
to circumvent space-containing path errors when invoking cmd.exe, which requires that
8dot3 filenames
be available on your file system.
You can check whether 8dot3 filenames are currently enabled using fsutil, by opening a command window and typing
fsutil 8dot3name query c:If you see warnings about 8dot3 short paths in jumpy.log or the jumpy installer, it means that short filenames are (or were) disabled on your system, possibly as a result of running a system optimizer utility at some point, and you will need to create the required short paths using the following (unfortunately somewhat painful) method:
- Ensure the target directories are not in use by the system:
- If the warnings show paths with "
Program Files
" reboot Windows in Safe Mode with command prompt. The reason for this is that in normal mode the Program Files folders are always in use by running programs, so the system won't allow any changes (e.g. setting short names). - Otherwise make sure PMS/UMS is not running and open a command window.
- If the warnings show paths with "
- Enable 8dot3 (with prompt at drive c:):
fsutil behavior set disable8dot3 0
- Set short names for your Program Files and/or PMS/UMS directories as appropriate, i.e. run one or more of the
following commands:
fsutil file setshortname "Program Files" PROGRA~1 fsutil file setshortname "Program Files (x86)" PROGRA~2 fsutil file setshortname "Program Files (x86)\Universal Media Server" UNIVER~1 fsutil file setshortname "Program Files (x86)\PS3 Media Server" PS3MED~1
- (Optional) set the 8dot3name behavior back to the original setting (returned by the initial query cmd, e.g. 1).
Please note that doing this may cause other similar errors in the future.
fsutil behavior set disable8dot3 1
Bookmarks
-
Press the Add bookmark button in any folder to create a bookmark inside Jumpy > Bookmarks. These are saved to jumpy-bookmarks.ini in your PMS profile folder (wherever PMS.conf is). You can edit this file, for instance to change the labels or reorder the items.
Log and Conf
-
Locations are according to your PMS installation (for quick access use the buttons on gui panel, otherwise see jumpy's init messages inside your debug.log for the specific paths):
- jumpy.log: located wherever debug.log is.
- jumpy.conf: located wherever PMS.conf is.
The available settings are:
# whether to activate bookmarks (true|false) bookmarks=true # whether to qualify the bookmark name (true|false) # e.g. 'Live :ESPN' instead of just 'Live' verbose_bookmarks=true # how often to refresh folder content in minutes # (-1=never|0=always|1=one minute) refresh=60 # whether to check for updates (true|false) check_update=true # whether to copy log output to the console (true|false) debug=false # whether to act as a url resolver (true|false) url_resolver=true
- PMS.conf:
If you need to override the locations where jumpy looks for Kodi set:
# kodi/xbmc user folder xbmc.home.path = c:\\path\\to\\my\\XBMC # kodi/xbmc program folder xbmc.main.path = c:\\path\\to\\program\\Kodi
You can set paths where external binaries needed by your scripts can be found, separating them with ';
' in Windows or ':
' in linux/mac:bin.path = c:\somewhere\bin;c:\somewhere else
You can also specify your preferred text editor for opening files from the gui:text.editor = c:\\path\\to\\my\\textEditor
See also Resolver and Interpreters for more PMS.conf settings.
-
When reporting bugs please set logging to TRACE and attach these together as one zip file (or use the DbgPack plugin):
-
•PMS.conf •debug.log •jumpy.log •jumpy-scripts.ini •pmsencoder.log
jumpy-scripts.ini
-
Scripts are registered with jumpy via entries inside the user file jumpy-scripts.ini, which is located wherever
PMS.conf is in your setup. For quick access use the button on the gui.
Each script has its own section, where the section name
[...]
is also the label, interpreted as a
unix-style path branching from jumpy's top folder:
[My Scripts/foo] cmd = c:\path\to\foo.bat arg1 arg2unless it begins with a '
+
' or '-
',
in which case it will be executed automatically at startup or shutdown respectively (and the rest of
the label is irrelevant):
[+hi] cmd = c:\path\to\hello.bat [-bye] cmd = c:\path\to\goodbye.batTo disable a script put a '
#
' at the beginning of
the section name:
[#+hi]
cmd = c:\path\to\hello.bat
If cmd
begins with the keyword pms
it will be
interpreted as an API call using command-line syntax. The entry
below is equivalent to the first example above:
[+foo] cmd = pms addFolder "My Scripts/foo" "c:\path\to\foo.bat arg1 arg2"
Webreader
-
Webreader is a "poor man's" browser for PMS, which takes a snapshot of a given
web page and streams it as video. The view pans left to right (or optionally
right to left) and top to bottom in 4 second shots across the page. It requires PhantomJS
to be installed.
- Press pause to stop panning and read, press again to continue.
- Pressing back takes you to the top of the page (on my Sony Bluray anyway, your renderer may behave differently).
Try one of the web pages in the Web Reader folder on the xmb to see how it works, but basically:
To add web pages edit the
[+webreader]
section of
jumpy-scripts.ini, adding one page per line in this form:
data = name, url, [style, thumb]where
name
is the item's label (or unix-style path).url
is the address of the web page.style
is an optional field to control presentation and playback using this syntax:format:delay_seconds:buffer_mb+pan:rdb_style:rdb_size:rdb_margin
format
is the only required part and is either:webpage
which is the default. Herepan
can bertl
for right to left panning.graphics
which maximizes the vertical overlap and is better suited to viewing images as opposed to reading text.- or both, e.g.
webpage+rtl:graphics
.
readability
(orrdb
) which uses the arc90labs readability script to clean up web pages into stripped-down article-like versions for easy reading.rdb_style
is eithernewspaper
(default),novel
,ebook
,terminal
,apertura
, orathelas
.rdb_size
(font) is eitherx-small
,small
,medium
(default),large
, orx-large
.rdb_margin
is eitherx-narrow
,narrow
,medium
(default),wide
, orx-wide
.
delay_seconds:buffer_mb
are playback settings.
thumb
is an image file or a pre-defined icon.
Some examples:
; a typical page (webpage format by default) data = My Pages/p1, http://www.foo.org/index.html ; a page in readabilty format data = My Pages/p2, http://www.foo.org/article.html, rdb ; an rtl page in webpage format with a 10s delay data = My Pages/p3, http://www.foo.org/index.html, webpage:10+rtl ; a page in readabilty novel format with a 10s delay and large font data = My Pages/p4, http://www.foo.org/article.html, rdb:10+novel:largeyou can also include a csv file
data = name, filename.csv, [style, thumb]where the csv file looks like this:
# csv columns are: label, url, [style, thumb] # default style is webpage # comments and blank lines are allowed My Pages/p1, http://www.foo.org/index.html My Pages/p2, http://www.foo.org/article.html, rdb My Pages/p3, http://www.foo.org/index.html, webpage:10+rtl My Pages/p4, http://www.foo.org/article.html, rdb:10+novel:large
Feedreader
-
Feedreader loads rss feeds for browsing with webreader. Usage is similar to webreader
except that the default style is
readability
.
To add feeds edit the
[+feedreader]
section of
jumpy-scripts.ini, adding one feed per line in this form:
data = name, feedurl, [style, thumb]or a csv file containing feed urls
data = name, filename.csv, [style, thumb]where the csv file looks like this:
# csv columns are: label, url, [style, thumb] # default style is readability # comments and blank lines are allowed World news/World news, http://www.guardian.co.uk/world/, webpage:10 World news/World news, http://www.guardian.co.uk/world/rss World news/UK, http://www.guardian.co.uk/uk/rss World news/Europe, http://www.guardian.co.uk/world/europe/roundup/rss
Resolver
-
Jumpy acts as a url resolver for unresolved WEB.conf items (youtube, vimeo, many more)
in UMS if it can find either the
Kodi urlresolver addon
or the youtube-dl python library.
- Kodi: two new addons are auto-installed:
- script.module.jumpy (Programs>jumpy)
- repository.jumpy.addons (System>Add-ons>Get Add-ons>jumpy repo)
- youtube-dl: There's no general reason to change anything in Linux/OS-X, but If you're on Windows and have the Channels Plugin (which already resolves using youtube-dl in Windows) you may want to disable it in the jumpy config gui.
- Install from zip in Kodi: script.module.urlresolver
- Download youtube-dl's
latest Full source tarball, untar and point
to its youtube_dl subfolder in UMS.conf:
youtube-dl.lib.path = c:\\path\\to\\youtube-dl\\youtube_dl
Both are automatically added by the jumpy installer and require no special setup, but you may wish to note the following details:
Alternatively, you can of course install these resolvers by hand:
Earmarker
-
Earmarker is a service to bookmark your browser's current page for media scanning
in UMS/PMS, allowing you to instantly add its linked/embedded media to the xmb.
It requires beautifulsoup4 (automatically added by the installer).
- If this browser is on the same device as PMS/UMS, go to 127.0.0.1:8989.
- If this browser is on a different device, type
IP_ADDRESS:8989
in the address bar, whereIP_ADDRESS
is the LAN IP of the device running PMS/UMS (for example 192.168.1.3:8989). - Press 'earmark' on any web page with media content (you should then see an 'Earmarked' notice).
- Look inside its earmark folder on the xmb to see any discovered items, at
- /Jumpy/Earmarks (default)
- or wherever else you specify by setting
'
earmarks=/some/where
' in PMS.conf
- This feature works to the extent that content is plainly evident and/or recognized by the available resolvers.
- For https pages be aware that some recent browsers (e.g. firefox 23+) will block mixed content, which means that the earmark button can't connect to its http server. In this case (e.g. youtube) the workaround is to go to the http version of the page if one exists and retry.
The Earmark server is enabled by default. For browser setup instructions open the server home page:
Once your browser is set up:
Caveats:
Capture
-
Capture is a script to discover and stream system media sources (e.g. computer screen, video cam, audio card) to your renderer.
It's basically a wrapper around ffmpeg devices support. Some notes:
- Discovered devices (in various A/V combinations) are listed inside the Devices folder in the xmb root.
- Windows:
- Directshow devices are supported, VFW is not.
- For screencasting install any/all of these directshow filters:
- x86 edition of UScreenCapture from Unreal Media.
- screen-capture-recorder.
- virtual-audio-capture-grabber.
- Linux: Only screencasting is implemented and X11 display screens are automatically detected assuming your ffmpeg has been compiled with x11grab enabled (which is not true for the linux ffmpeg binaries shipped with UMS).
- OS-X: Sorry, no device capture support in ffmpeg.
- There's a transcoding delay of 10 seconds or more, so this isn't really practical for real-time uses such as interacting with your desktop. See here for some more hands-on user notes.