GithubHelp home page GithubHelp logo

grimkriegor / play-on-kodi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ritiek/play-on-kodi

0.0 1.0 0.0 38 KB

Stream your local/network content directly to Kodi by making HTTP requests

License: MIT License

JavaScript 100.00%

play-on-kodi's Introduction

play-on-kodi

Stream your local/network content directly on Kodi without having to setup FTP, SMB or anything else.

Installation

$ npm install -g playonkodi

For superhero devs:

$ git clone https://github.com/ritiek/play-on-kodi
$ cd play-on-kodi
$ npm install -g .

Also make sure you have youtube-dl installed.

Usage

usage: playonkodi.js [-h] [-v] -s SERVER -p PORT [-u USER] [-P PASS] [-i INTERFACE_IP] MEDIA

Stream your local/network content directly on Kodi.

Positional arguments:
  MEDIA                 Path to media file

Optional arguments:
  -h, --help            Show this help message and exit.
  -v, --version         Show program's version number and exit.
  -s SERVER, --server SERVER
                        Kodi's local ip address
  -p PORT, --port PORT  Kodi's web interface port
  -u USER, --username USER
                        [Optional] Kodi's web interface username
  -P PASS, --password PASS
                        [Optional] Kodi's web interface password
  -i INTERFACE_IP, --interface-ip INTERFACE_IP
                        [Optional] Interface IP to send to Kodi server

Examples

Stream a local video to Kodi

$ playonkodi -s 192.168.0.108 -p 6050 /path/to/local/media/file

Stream a video from the internet to Kodi

$ playonkodi -s 192.168.0.108 -p 6050 http://path/to/media

Since this tool now uses the youtube-dl backend to resolve URLs, so you should be able to media content from most websites (including YouTube, HotStar, and many more). Just pass the URL, and you'll know if it plays on Kodi.

Send local IP address to Kodi server manually (useful if script cannot find out the correct network interface IP automatically)

$ playonkodi -s 192.168.0.108 -p 6050 -i 192.168.0.105 /path/to/local/media/file

Loading External Subtitles

There maybe cases where you would want to link your local media content with external subtitles (.srt, etc.). Due to a limitation in Kodi, we cannot do that for you automatically (check out issue #3).

However you can install mkvtoolnix ($ sudo apt install mkvtoolnix) to embed external subtitles in the container itself and pass this new container to Kodi.

For example:

$ mkvmerge -o output.mkv input.mp4 subtitles.srt
$ playonkodi -s 192.168.0.108 -p 6050 output.mkv

How it works?

  • For local media, it makes your media content available locally to the devices on the same network. Otherwise it just uses youtube-dl to resolve the passed URL.

  • It then attempts to figure out your PC's local IP address.

  • And lastly, it makes a network request to Kodi's jsonrpc server to play the hosted media content.

Contributing

  • This tool is supposed is supposed to be very minimal way to play local and network files on Kodi. I made it to quickly be able to your local media content to Kodi server. You don't want to setup FTP/SMB (if not already), add it as a network source on Kodi and locate the media to just make the thing play!

  • If you believe your idea is simple and interesting at the same time, please open an issue or send a PR!

License

`License

play-on-kodi's People

Contributors

grimkriegor avatar ritiek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.