Skip to content

Instantly share code, notes, and snippets.

@sleeyax
Last active March 25, 2024 19:32
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
@gisggisg
Copy link

The first is npm start
The second log is when i tried again -apt install -y git nodejs npm
git clone https://github.com/sungshon/PimpMyStremio.git
cd PimpMyStremio/src

@sleeyax
Copy link
Author

sleeyax commented Nov 21, 2019

In the first log you posted I see this line 10 verbose stack Error: ENOENT: no such file or directory, open '/data/data/com.termux/files/home/package.json' which could indicate that you're not in a the correct directory. Make sure to run npm install in the PimpMyStremio/src directory.

The second log... I'm not sure. Reinstall shouldn't be necessary as long as git and npm are actually installed.

If you have the PimpMyStremio directory, just execute cd PimpMyStremio/src && npm install --production again and continue from there.
If not, re-clone the repo:

git clone https://github.com/sungshon/PimpMyStremio.git
cd PimpMyStremio/src
npm install --production

On a sidenote: it's pretty hard to debug like this, some screenshots or perhaps a video would be more useful.

@dobucki22
Copy link

Complete noob here... I'm having trouble running pimp my stremio or even ubuntu after the first run. Everything works fine on the initial install, but when i close termux and try to start it back up, its like it forgot everything i just did. I get " no such file or directory" error when i run ./start-ubuntu.sh or npm start

@sleeyax
Copy link
Author

sleeyax commented Dec 24, 2019

Complete noob here... I'm having trouble running pimp my stremio or even ubuntu after the first run. Everything works fine on the initial install, but when i close termux and try to start it back up, its like it forgot everything i just did. I get " no such file or directory" error when i run ./start-ubuntu.sh or npm start

Make sure you're in the right directory first : cd ubuntu.

When you enter ls it should list the start-ubuntu.sh file. If not, that means you're in the wrong directory or haven't installed the ubuntu container correctly (which probably isn't the case because you mention it worked the first time)

@dobucki22
Copy link

Complete noob here... I'm having trouble running pimp my stremio or even ubuntu after the first run. Everything works fine on the initial install, but when i close termux and try to start it back up, its like it forgot everything i just did. I get " no such file or directory" error when i run ./start-ubuntu.sh or npm start

Make sure you're in the right directory first : cd ubuntu.

When you enter ls it should list the start-ubuntu.sh file. If not, that means you're in the wrong directory or haven't installed the ubuntu container correctly (which probably isn't the case because you mention it worked the first time)

Thanks for the quick response. I got it figured out.. Now how do I get Jackett running on here?

@sleeyax
Copy link
Author

sleeyax commented Jan 13, 2020

Hello,
This would be work on a Raspberry Pi with Raspbian ?
Thanks a lot

Haven't tried that yet, but yes it should work.

@sleeyax
Copy link
Author

sleeyax commented Jan 13, 2020

I install PimpmyStremio on my Raspberry Pi, and after that when I go to my Android Firestick, what do I do? I should be able to add a URL Add on? Like desktop?

Please read sungshon/PimpMyStremio#54 (comment)

@sleeyax
Copy link
Author

sleeyax commented Jan 14, 2020

Ok so it will not work...

If you read it properly you can learn that it will only work as long as you enable 'remote access' in settings until Stremio fixes the LAN accessibility issue.

@sleeyax
Copy link
Author

sleeyax commented Jan 14, 2020

@sleeyax, I tried to install PMS on my Raspberry but I have some errors with npm install --production

`pi@raspberrypi:~/PimpMyStremio/src $ npm install --production
(node:3636) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
npm WARN package.json pimpmystremio@1.2.1 No repository field.
npm WARN package.json pimpmystremio@1.2.1 No README data
npm WARN deprecated m3u8-parsed@1.2.0: deprecated
npm ERR! git clone git@github.com:github:sungshon/forked-systray Clonage dans le dépôt nu '/home/pi/.npm/_git-remotes/git-github-com-github-sungshon-forked-systray-09fdcf73'
npm ERR! git clone git@github.com:github:sungshon/forked-systray Warning: Permanently added the RSA host key for IP address '140.82.113.4' to the list of known hosts.
npm ERR! git clone git@github.com:github:sungshon/forked-systray Permission denied (publickey).
npm ERR! git clone git@github.com:github:sungshon/forked-systray fatal: Impossilble de lire le dépôt distant.
npm ERR! git clone git@github.com:github:sungshon/forked-systray
npm ERR! git clone git@github.com:github:sungshon/forked-systray Veuillez vérifier que vous avez les droits d'accès
npm ERR! git clone git@github.com:github:sungshon/forked-systray et que le dépôt existe.
npm ERR! git clone git@github.com:github:sungshon/m3u8-reader Clonage dans le dépôt nu '/home/pi/.npm/_git-remotes/git-github-com-github-sungshon-m3u8-reader-e949026f'
npm ERR! git clone git@github.com:github:sungshon/m3u8-reader Permission denied (publickey).
npm ERR! git clone git@github.com:github:sungshon/m3u8-reader fatal: Impossilble de lire le dépôt distant.
npm ERR! git clone git@github.com:github:sungshon/m3u8-reader
npm ERR! git clone git@github.com:github:sungshon/m3u8-reader Veuillez vérifier que vous avez les droits d'accès
npm ERR! git clone git@github.com:github:sungshon/m3u8-reader et que le dépôt existe.
npm ERR! notarget No compatible version found: forked-systray@'github:sungshon/forked-systray'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["2.0.0","2.0.2","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.6","3.0.7","3.0.8","3.0.9","3.0.10","3.0.11"]
npm ERR! notarget
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! System Linux 4.19.42-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "--production"
npm ERR! cwd /home/pi/PimpMyStremio/src
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code ETARGET
npm ERR! git clone git@github.com:github:sungshon/node-auto-launch Clonage dans le dépôt nu '/home/pi/.npm/_git-remotes/git-github-com-github-sungshon-node-auto-launch-763d75f6'
npm ERR! git clone git@github.com:github:sungshon/node-auto-launch Permission denied (publickey).
npm ERR! git clone git@github.com:github:sungshon/node-auto-launch fatal: Impossilble de lire le dépôt distant.
npm ERR! git clone git@github.com:github:sungshon/node-auto-launch
npm ERR! git clone git@github.com:github:sungshon/node-auto-launch Veuillez vérifier que vous avez les droits d'accès
npm ERR! git clone git@github.com:github:sungshon/node-auto-launch et que le dépôt existe.
npm ERR! git clone git@github.com:github:sungshon/phantomjs-node Clonage dans le dépôt nu '/home/pi/.npm/_git-remotes/git-github-com-github-sungshon-phantomjs-node-2bd3e0bb'
npm ERR! git clone git@github.com:github:sungshon/phantomjs-node Permission denied (publickey).
npm ERR! git clone git@github.com:github:sungshon/phantomjs-node fatal: Impossilble de lire le dépôt distant.
npm ERR! git clone git@github.com:github:sungshon/phantomjs-node
npm ERR! git clone git@github.com:github:sungshon/phantomjs-node Veuillez vérifier que vous avez les droits d'accès
npm ERR! git clone git@github.com:github:sungshon/phantomjs-node et que le dépôt existe.
npm ERR! git clone git@github.com:github:sungshon/node-source-map-support Clonage dans le dépôt nu '/home/pi/.npm/_git-remotes/git-github-com-github-sungshon-node-source-map-support-c65f1629'
npm ERR! git clone git@github.com:github:sungshon/node-source-map-support Permission denied (publickey).
npm ERR! git clone git@github.com:github:sungshon/node-source-map-support fatal: Impossilble de lire le dépôt distant.
npm ERR! git clone git@github.com:github:sungshon/node-source-map-support
npm ERR! git clone git@github.com:github:sungshon/node-source-map-support Veuillez vérifier que vous avez les droits d'accès
npm ERR! git clone git@github.com:github:sungshon/node-source-map-support et que le dépôt existe.
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/PimpMyStremio/src/npm-debug.log
npm ERR! not ok code 0`

Can you please help?

Thanks

Hmm odd error. Please try again using sudo: sudo npm install --production. If that doesn't work, take a look here for a possible solution.

@bilaliz
Copy link

bilaliz commented Mar 10, 2020

I got everything else to work, just cant get emby and plex addons to work, it says
emby client: could not authenticate user UNAME to server server-where-emby-is-located

and
plex client: could not get remote url or local address for server NASname, aborting connection attempt.
help would be much appreciated.

@sleeyax
Copy link
Author

sleeyax commented Mar 10, 2020

I got everything else to work, just cant get emby and plex addons to work, it says
emby client: could not authenticate user UNAME to server server-where-emby-is-located

and
plex client: could not get remote url or local address for server NASname, aborting connection attempt.
help would be much appreciated.

That's not an issue with PMS on android. Please report this issue on the PimpMyStremio github page itself if you think this is an issue with an addon or just double check your plex setup.

@LegendaryXBoii
Copy link

every time i write apt install -y phantomjs it says E: Unable to locate package phantomjs. is there a fix?

@sleeyax
Copy link
Author

sleeyax commented Apr 17, 2020

every time i write apt install -y phantomjs it says E: Unable to locate package phantomjs. is there a fix?

Try to run apt update first. If that doesn't fix it you can also just skip it and continue with the guide because not all addons require phantomjs.

@LegendaryXBoii
Copy link

even installing pms wont work

@LegendaryXBoii
Copy link

it says unable to locate node js, npm,git

@sleeyax
Copy link
Author

sleeyax commented Apr 18, 2020

it says unable to locate node js, npm,git

even installing pms wont work

Uhhh are you sure you're running these commands within your ubuntu container (and not in the termux session itself)? Also, double check that you have an internet connection: ping google.com should answer with REPLY.

@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: 'externalip@1.0.2',
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 urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated left-pad@1.3.0: 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