Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PimpMyStremio on Android guide

PimpMyStremio on android

This guide teaches you how to install PimpMystremio on your android device. Please keep in mind that this is just an expirement. I strongly recommend to use PMS on your computer when possible.

You do not need root access or a high end phone to follow this guide. The only thing you need is +-2.5GB of free storage and a basic understanding of linux.

Installation

Preparation

First of all, go to the playstore and install termux (?). Temux is a terminal emulator that allows you to run basic linux commands on your android device. We will use this to install a Ubuntu chroot/proot container that will run PMS.

Secondly, go get the Hacker's Keyboard. It makes typing and navigation on termux way easier.

Configure SSH access (optional)
Typing long commands on a mobile device is a pain, so I recommend setting up a SSH server on your device so you can access termux through a SSH client on your PC. Run the following commands in termux to install the OpenSSH server:

pkg update
pkg install openssh

Next we need to edit the openssh configuration file so we can enable authentication and set the port number. Make sure you're in your home directory (cd $prefix) and enter the following commands:

pkg install nano
nano ../usr/etc/ssh/sshd_config

Add/edit these lines:

PasswordAuthentication yes
Port 8022

Press CTRL + X, type the letter 'y' and then press ENTER to save the changes.

Now run passwd to setup a password.

Next, get the private ip address of your device by running ifconfig (your device is probably on wifi so it will most likely be the inet addr of wlan0). Note it down.

Then run whoami and note down the username.

Finally, enter the command sshd and you're finally ready to switch over to your PC!

On you PC, install a SSH client like putty. Connect to the ip address you just noted down and use port 8022. When prompted, enter your username and the password you set up earlier.

Installing ubuntu

Termux by itself is pretty limited and without root access we can't access or do as much as we like. This is why we need to install an ubuntu chroot/proot container, which is kinda like a sandbox with it's own 'virtual' permissions.

I figured ubuntu is a good option, but termux supports many distro's so feel free to experiment with this.

Run the following commands to install ubuntu:

pkg update && pkg install wget proot
mkdir ubuntu
cd ubuntu
wget https://raw.githubusercontent.com/Neo-Oli/termux-ubuntu/master/ubuntu.sh
bash ubuntu.sh

This will download & install the distro and it might take a while, depending on your internet connection.

When finished, start ubuntu by running ./start-ubuntu.sh You will need to run this command everytime you want to access your ubuntu environment from termux.

Note: If you get a message saying something in the lines of groups: cannot find name for group ID 3014, just ignore it. It's fine.

Updating the packages list

Run apt update once after accessing your ubuntu environment for the first time. This will make sure we got access to all and the latest packages.

Installing PMS internal modules (otional)

At the time of writing, PMS will skip internal modules when they are not found. You only have to install any of the modules listed below if you're installing an addon that depends on it.

PhantomJS

PhantomJS is a headless browser mostly used for web automation and scraping. It can't be auto-installed by PMS yet so we have to install it ourself.

apt install -y phantomjs
export QT_QPA_PLATFORM=offscreen && echo "export QT_QPA_PLATFORM=offscreen" >> /etc/profile

Installing PMS

Almost there!

apt install -y git nodejs npm
git clone https://github.com/sungshon/PimpMyStremio.git
cd PimpMyStremio/src

Finally, install the remaining dependencies: npm install --production

Start PMS with npm start. Open 127.0.0.1:7777 in your browser to access the web page. From here on you can use it just like you would on PC and install addons for mobile Stremio!

Autostart (optional)

You can create a shell script to start PMS in one go. If you want to start PMS at boot or from your homescreen, check out Termux:Boot and Termux:Widget (both are paid termux extensions but worth the money nonetheless imo).

To start, make sure your current working directory is the Termux home directory (cd ~). If you're still inside the ubuntu container, you can exit it using the exit command.

Create the script by executing the following:

touch start-pms.sh
echo "proot --link2symlink -0 -r ubuntu/ubuntu-fs -b /dev -b /proc -w /root /usr/bin/env -i HOME=/root PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/local/games TERM=xterm LANG=C.UTF-8 /bin/bash -c \"cd /root/PimpMyStremio/src && node index.js\"" > start-pms.sh
chmod +x start-pms.sh
unset LD_PRELOAD

Run it: ./start-pms.sh.

Termux:Boot & Termux:Widget extensions

Follow the Termux docs for your extension of choice. At some point, you'll have to add a shell script to a directory. To create a script that executes the autostart script we created earlier, execute the following commands:

touch start-pms.sh
echo "~/start-pms.sh" > start-pms.sh
chmod +x start-pms.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.