Skip to content

Instantly share code, notes, and snippets.

@sleeyax
Last active November 7, 2024 22:22
Show Gist options
  • Save sleeyax/e9635eb352a4fcdf94194f763d743689 to your computer and use it in GitHub Desktop.
Save sleeyax/e9635eb352a4fcdf94194f763d743689 to your computer and use it in GitHub Desktop.
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.

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
@LegendaryXBoii
Copy link

yeah I'm in the ubuntu container it says root@localhost:~#

@manueltorrez
Copy link

apt don't find phantomjs, is there any workaround for this? Everything else is fine but Awesome Everything does not work without it.

@zany130
Copy link

zany130 commented Mar 9, 2021

tried this on my asus ax86u router (instead of termux I did a Debian chroot with merlinwrt firmware) and got stuck when installing the npm deps.

npm ERR! Error: Cannot find module './pseudomap'
npm ERR!     at Function.Module._resolveFilename (module.js:338:15)
npm ERR!     at Function.Module._load (module.js:280:25)
npm ERR!     at Module.require (module.js:364:17)
npm ERR!     at require (module.js:380:17)
npm ERR!     at Object.<anonymous> (/usr/lib/nodejs/pseudomap/map.js:8:20)
npm ERR!     at Module._compile (module.js:456:26)
npm ERR!     at Object.Module._extensions..js (module.js:474:10)
npm ERR!     at Module.load (module.js:356:32)
npm ERR!     at Function.Module._load (module.js:312:12)
npm ERR!     at Module.require (module.js:364:17)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 4.1.52
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "--production"
npm ERR! cwd /PimpMyStremio/src
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code MODULE_NOT_FOUND
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /PimpMyStremio/src/npm-debug.log
npm ERR! not ok code 0

got it sorta working by using this guide to get the latest node and npm versions https://github.com/nodesource/distributions/blob/master/README.md#debinstall
but then it gets stuck here

npm install --production
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '0.10.x' },
npm WARN EBADENGINE   current: { node: 'v15.11.0', npm: '7.6.0' }
npm WARN EBADENGINE }
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: use String.prototype.padStart()
[          ........] \ reify:text-hex: http fetch GET 200 https://registry.npmjs.org/text-hex/-/text-hex-1.0

@thealidev
Copy link

Hey
Is it still maintained

@sleeyax
Copy link
Author

sleeyax commented Jan 11, 2024

Hey Is it still maintained

PimpMyStremio is no longer maintained so neither is this project.

@thealidev
Copy link

@sleeyax
So is their is any altanitive to PimpMyStremio
I really like to watch my fav kdramas and pk dramas here

@sleeyax
Copy link
Author

sleeyax commented Jan 11, 2024

@sleeyax So is their is any altanitive to PimpMyStremio I really like to watch my fav kdramas and pk dramas here

Not at the moment. There is a community successor to PMS in development but it will probably take a while before it's released to the public.

@jeemitsha
Copy link

Dawn I followed all the steps, but finally understood it's too old, the versions and source code either has error / has depressed versions. 😔

@thealidev
Copy link

Sad you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment