Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the mobile browser as a resolver #279

Closed
doko-desuka opened this issue Dec 18, 2022 · 4 comments
Closed

Using the mobile browser as a resolver #279

doko-desuka opened this issue Dec 18, 2022 · 4 comments

Comments

@doko-desuka
Copy link

doko-desuka commented Dec 18, 2022

Hi Gujal00. It's because of little changes like these:

...that I was thinking if there wasn't a definitive solution.

Using the WebExtension API we can create a browser extension that can listen to the headers and destination URLs of all requests that your browser makes.
So I tested making an extension that did that: https://github.com/doko-desuka/StreamCatcher

On Kodi, in an add-on, you have some Python code listening until it receives the URL + headers that the extension on the phone has prepared and sent it:

StreamCatcher_Demo.mp4

It's working on an Android phone (using the Kiwi browser) + Android TV box setup.
There's a few sources it can't detect It detected all hosters I tried. This includes some reCaptcha-protected videos, because the browser passes the test of course. Anything you can watch on the Kiwi browser is potentially playable on Kodi.
I think this can finally make so many updates unnecessary. The process becomes:

  1. On Kodi you activate your plugin for it to start "listening" on some address & port.
  2. On your phone you go to a website as if you're going to watch something.
  3. Wait for the extension to detect a video being played (it's automatic).
  4. Send details to Kodi through that address & port.
  5. Kodi plays it, instead of your mobile browser.

And this isn't cheating, as we aren't scraping anything: we're visiting these sites on our phones, so we're shown ads, promotions etc. The website owners aren't being explored. This is simply "instead of playing it on my phone screen, play it on my Kodi device".

Cheers

@Gujal00
Copy link
Owner

Gujal00 commented Dec 18, 2022

Welcome @doko-desuka Yes it is a neat idea, but should be used as a last resort probably for sites locked behind click captcha/recaptcha such as netu or heavy js obfuscation such as mycloud/streamrapid.
Sites that can be silently resolved such as the sites already in SMR should be left alone as they work already without user intervention.
However I am not fond of browsing these sites on a mobile phone due to nature of ads on Android and data exfiltration, but will see if it can be added as an option and leave it to the user to decide

@doko-desuka
Copy link
Author

doko-desuka commented Dec 19, 2022

Thanks for reading all of that @Gujal00. I wanted to let you know about the reference code in there, so since you saw it I'll close this now.

I've thought of a way to improve the process so I don't have to go around the web searching for sources.
Since we can create a simple Python server in a running Kodi plugin (even on an Android TV box, which is supposedly more locked-in, less permissions), if on your phone you access the static local IP address* of your Kodi device, the server can offer an HTML page with links to sources that it found. This way less clicking is involved:

  1. On your mobile browser, visit the address of your Kodi device.
  2. Kodi has a plugin running a simple Python socket server (that will receive a GET request from the browser).
  3. Server responds with an HTML page with a list of links to embedded players that the Python plugin found, and the list appears on the browser.
  4. Click a link to go to the embedded player, let the extension detect the media.
  5. Send it for Kodi to play.

* For others like me who are new to IT, a static local IP address is usually something like 192.168.1.### (with ### being for a number between 1 and 255), which you set up in the Wi-Fi or Ethernet system settings of your device where Kodi will be used. It's not a Kodi setting, but an Android system setting: you need to use a static local IP instead of 'dynamic IP with DHCP' for the Kodi device, because the browser extension needs to know exactly what static local IP to send the POST request with details.

@doko-desuka
Copy link
Author

(Oh, and I had to install uBlock Origin on Kiwi browser because, as you said, there were so many ads that some hosters were literally unplayable because each click redirected the video player page... Thankfully uBlock solved that for now.)

@Gujal00
Copy link
Owner

Gujal00 commented Dec 19, 2022

Yeah that is the reason why I dont like to ask average users to browse to ad laden sites on a mobile browser. It is okay for tech savvy people but the average user would use it without a proper setup and then complain that kodi infected their mobile phone with malware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants