plugin.video.elementum
plugin.video.elementum copied to clipboard
[Request] Allow to run daemon on an external device (pc, nas etc.)
Hello,
I realize it's very early for feature requests before you release a stable version, but I would like to propose factoring in the possibility of running the "Elementum" daemon on a different device than the one that runs Kodi (and plugin.video.elementum).
I have already tried to do this in the past with Pulsar, but here are the issues I run into:
A lot of places have 127.0.0.1 hardcoded for the communication with the torrent binary.
The binary always sends RPC commands to 127.0.0.1. It should probably figure out what device made the request then issue the play command to the RPC-port.
This makes it so, that, for example, even if you manage to run the binary separately (I did this with Kodi running on my PC as a "server" and on an Android tv box as a "client"), even if you manage to initiate a download on the "server' device, from the "client", the playback of the video will still be on the "server".
Hope you can consider this.
This should be implemented with v0.0.50.
There are settings in Maintenance tab of Elementum Settings. Where: remote host+port is the location of the binary, that this Kodi should talk to. So there should be one Kodi with Elementum, which points to the standalone binary.
So, Kodi (let's say ip = 192.168.0.100) with Elementum and Remote Host = 192.168.0.200, and on host with ip = 192.168.0.200, you run Elementum binary (like ~/.kodi/addons/plugin.video.elementum/resources/bin/linux_x64/elementum
) with -remoteHost=192.168.0.100
, so that it knows where to take settings and so on.
That will allow to use use and setup Elementum on any device, while all the hard work and downloading/processing will work on specific device.
Could you please clarify this part a bit?
Let's call it "client" and "server". Where "client" is a low-powered device (like a chinese android tv box), and "server" is a powerful server/NAS/PC.
Does the "server" also need to run Kodi? Or can we actually run the elementum binary all by itself?
I'm reopening for a while.
@Znuff in current implementation you need Kodi on client and server. I will try to make changes to run on server without Kodi. But, server will need a working Kodi somewhere to take settings. Lets' say you have 3 devices running Kodi and 4th running server. So when you start server - you point one of the clients so that server could take the settings. And all 3 devices will point to one server, it should work just fine.
@Znuff Sorry, correcting myself. Server does not need to have installed Kodi or plugin (but installed plugin will allow to auto-update and work without other clients).
That's how it should be.
Last time I checked, Kodi/plugin keeps it's setings in a .XML, I'm sure someone tech-savvy can edit their own settings if they are inclined to do so on a non-plugin-running elementum daemon.
Hi, I want to use "Elementum" on AppleTV, but from what I see is not possible because of the "fork" issue. I found this statement
So, Kodi (let's say ip = 192.168.0.100) with Elementum and Remote Host = 192.168.0.200, and on host with ip = 192.168.0.200, you run Elementum binary (like ~/.kodi/addons/plugin.video.elementum/resources/bin/linux_x64/elementum) with -remoteHost=192.168.0.100, so that it knows where to take settings and so on. So, I have:
- Windows PC with kodi and working elementum
- AppleTV
On 2 -Apple TV - (Elementum->Advanced ), I set the IP to IP of 1 (windows pc) and enabled "Do not start Binary"
Is there any changes I need to do? Every time I try to access Elementum on Apple TV it request to start it againa.
Thank you.
In the mean time, I understand what exactly what I need to do. More exactly to start the server's elementum using command line, not using a Kodi instance.
now I encountering the following error:
Cannot write to location '\var\mobile\Containers\Data\Application\01BFEA72-B332-42DE-8482-8C4C9DB741F5\Library\Caches\home\userdata\addon_data': &os.PathError{Op:"CreateFile", Path:"\var\mobile\Containers\Data\Application\01BFEA72-B332-42DE-8482-8C4C9DB741F5\Library\Caches\home\userdata\addon_data", Err:0x3} WARN config ▶ func1 Addon settings not properly set, opening settings window: "CreateFile \var\mobile\Containers\Data\Application\01BFEA72-B332-42DE-8482-8C4C9DB741F5\Library\Caches\home\userdata\addon_data: The system cannot find the path specified."
Running from Linux Machine: is giving similar error, but this time the path are correctly using "/" as dir separator.
Using kodi I can create directory inside that existing directories.
@CMGeorge So you enable "Do not start binary" and still it tries to start it after you restart Kodi?
You should start Kodi with Elementum on Windows host, and set remote ip on Apple to Windows ip. Can you show the full kodi.log from Apple device?
As the discussion above, I tried to run the binary stand-alone, unfortunately it seems it can't find the settings:
λ "C:\Program Files (x86)\Kodi\portable_data\addons\plugin.video.elementum\resources\bin\windows_x86\elementum.exe"
INFO main ▶ main Starting Elementum daemon
INFO main ▶ main Version: 0.0.52 GoTorrent: a7e338a3 Go: go1.10.3
INFO config ▶ Reload Reloading configuration...
INFO config ▶ Reload Setting remote address to 127.0.0.1:65221
WARN config ▶ func1 Addon settings not properly set, opening settings window: "LOCALIZE[30113]"
So my setup is (1) android box, (2) windows pc
Even more:
I have Kodi running on the Windows PC right now (with Elementum running). It works fine locally.
I've set up the remote IP under the android box under the Advanced settings of Elementum.
The problem is - when I search for a tv-show episode, all the Elementum prompts are displayed on the Windows PC in Kodi. The content plays correctly on the android box, but everything else is on the Windows PC.
Oh, ok, scratch that. I read about the remoteHost
option above. I somehow missed that.
I've run it with the remoteHost
parameter, which I think should fix the issues I reported above, but this still leaves me with the following issue:
C:\Users\znf\AppData\Roaming\Coin2FlyCore
λ "C:\Program Files (x86)\Kodi\portable_data\addons\plugin.video.elementum\resources\bin\windows_x86\elementum.exe" -remoteHost=192.168.0.101
INFO main ▶ main Starting Elementum daemon
INFO main ▶ main Version: 0.0.52 GoTorrent: a7e338a3 Go: go1.10.3
INFO config ▶ Reload Reloading configuration...
INFO config ▶ Reload Setting remote address to 192.168.0.101:65221
ERRO config ▶ Reload Cannot write to location '\mnt\sandisk\elementium': &os.PathError{Op:"CreateFile", Path:"\\mnt\\sandisk\\elementium", Err:0x3}
WARN config ▶ func1 Addon settings not properly set, opening settings window: "CreateFile \\mnt\\sandisk\\elementium: The system cannot find the path specified."
Obviously, I can't go on the Android tvbox and set E:\elementum_download
because it doesn't allow me to set those paths.
It can't create \\\mnt
because that would mean it has to create C:\mnt
and it has no permission to do so.
I manually created C:\mnt
, which made it pass this issue.
Unfortunately next issue is with the Library path:
λ "C:\Program Files (x86)\Kodi\portable_data\addons\plugin.video.elementum\resources\bin\windows_x86\elementum.exe" -remoteHost=192.168.0.101
INFO main ▶ main Starting Elementum daemon
INFO main ▶ main Version: 0.0.52 GoTorrent: a7e338a3 Go: go1.10.3
INFO config ▶ Reload Reloading configuration...
INFO config ▶ Reload Setting remote address to 192.168.0.101:65221
INFO config ▶ Reload Could not create temporary directory: &os.PathError{Op:"mkdir", Path:"\\storage\\emulated\\0\\Android\\data\\org.xbmc.kodi\\files\\.kodi\\temp\\elementum", Err:0x5}
INFO config ▶ Reload Using download path: \mnt\sandisk\elementium
ERRO config ▶ Reload CreateFile \storage\emulated\0\Video: The system cannot find the file specified.
WARN config ▶ func1 Addon settings not properly set, opening settings window: "CreateFile \\storage\\emulated\\0\\Video: The system cannot find the file specified."
Obviously, I don't want the Video Library (strm
files) on the Windows PC, they are useless there. I would have to map the path back to the Android Box via Samba or something similar, which just creates more headache.
But, let's say that I created C:\storage
to match up the path that Elementum wants. Even tough it's completely wrong.
My next issue is with the database path, somehow:
λ "C:\Program Files (x86)\Kodi\portable_data\addons\plugin.video.elementum\resources\bin\windows_x86\elementum.exe" -remoteHost=192.168.0.101
INFO main ▶ main Starting Elementum daemon
INFO main ▶ main Version: 0.0.52 GoTorrent: a7e338a3 Go: go1.10.3
INFO config ▶ Reload Reloading configuration...
INFO config ▶ Reload Setting remote address to 192.168.0.101:65221
INFO config ▶ Reload Could not create temporary directory: &os.PathError{Op:"mkdir", Path:"\\storage\\emulated\\0\\Android\\data\\org.xbmc.kodi\\files\\.kodi\\temp\\elementum", Err:0x5}
INFO config ▶ Reload Using download path: \mnt\sandisk\elementium
INFO config ▶ Reload Using library path: \storage\emulated\0\Video
DEBU config ▶ Reload Total system memory: 26 GB
DEBU config ▶ Reload Automatically selected memory size: 1.3 GB
DEBU config ▶ Reload Selected memory size (1.3 GB) is bigger than maximum for auto-select (210 MB), so we decrease memory size to maximum allowed: 210 MB
DEBU config ▶ Reload Using configuration: &config.Configuration{
DownloadPath: "\\mnt\\sandisk\\elementium",
TorrentsPath: "\\mnt\\sandisk\\elementium\\Torrents",
LibraryPath: "\\storage\\emulated\\0\\Video",
Info: &xbmc.AddonInfo{
Author: "elgatito",
Changelog: "",
Description: "Elementum is a torrent finding and streaming engine. It doesn't go on torrent websites for legal reasons. However, it calls specially crafted add-ons (called providers) that are installed separately.[CR]This project is a fork of the well known, but no longer maintained Pulsar/Quasar projects from steeve and scakemyer.",
Disclaimer: "The author does not own or host any content found within this Addon. The author is not connected to or in any other way affiliated with Kodi, Team Kodi, or the XBMC Foundation.",
Fanart: "",
Home: "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/",
Icon: "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.elementum/icon.png",
ID: "plugin.video.elementum",
Name: "Elementum",
Path: "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.elementum",
Profile: "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/plugin.video.elementum/",
TempPath: "\\storage\\emulated\\0\\Android\\data\\org.xbmc.kodi\\files\\.kodi\\temp\\elementum",
Stars: "-1",
Summary: "Elementum: Media streaming",
Type: "xbmc.python.pluginsource",
Version: "0.0.52",
Xbmc: "/data/user/0/org.xbmc.kodi/cache/apk/assets/",
},
Platform: &xbmc.Platform{
OS: "android",
Arch: "arm",
Version: "3.14.29",
Kodi: 17,
Build: "17.6 Git:20171114-a9a7a20",
},
Language: "en",
TemporaryPath: "\\storage\\emulated\\0\\Android\\data\\org.xbmc.kodi\\files\\.kodi\\temp\\elementum",
ProfilePath: "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/plugin.video.elementum/",
HomePath: "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/",
XbmcPath: "/data/user/0/org.xbmc.kodi/cache/apk/assets/",
SpoofUserAgent: 0,
KeepDownloading: 2,
KeepFilesPlaying: 2,
KeepFilesFinished: 2,
DisableBgProgress: false,
DisableBgProgressPlayback: true,
ForceUseTrakt: false,
UseCacheSelection: true,
UseCacheSearch: true,
CacheSearchDuration: 180,
ResultsPerPage: 9,
EnableOverlayStatus: true,
SilentStreamStart: false,
ChooseStreamAuto: false,
ForceLinkType: false,
UseOriginalTitle: false,
AddSpecials: false,
ShowUnairedSeasons: false,
ShowUnairedEpisodes: false,
SmartEpisodeMatch: true,
DownloadStorage: 1,
AutoMemorySize: true,
AutoMemorySizeStrategy: 1,
MemorySize: 209715200,
BufferSize: 20971520,
UploadRateLimit: 0,
DownloadRateLimit: 0,
LimitAfterBuffering: false,
ConnectionsLimit: 50,
SeedTimeLimit: 2,
DisableUpload: false,
DisableDHT: false,
DisableTCP: false,
DisableUTP: false,
DisableUPNP: false,
EncryptionPolicy: 0,
ListenPortMin: 6881,
ListenPortMax: 6891,
ListenInterfaces: "",
ListenAutoDetectIP: true,
ListenAutoDetectPort: true,
Scrobble: false,
TraktUsername: "",
TraktToken: "",
TraktRefreshToken: "",
TraktTokenExpiry: 0,
TraktSyncFrequency: 2,
TraktSyncCollections: true,
TraktSyncWatchlist: true,
TraktSyncUserlists: true,
TraktSyncWatched: true,
TraktSyncWatchedBack: true,
UpdateFrequency: 6,
UpdateDelay: 300,
UpdateAutoScan: true,
PlayResume: true,
UseCloudHole: false,
CloudHoleKey: "D5DEFD8",
TMDBApiKey: "",
OSDBUser: "",
OSDBPass: "",
OSDBLanguage: "en",
OSDBAutoLanguage: true,
SortingModeMovies: 2,
SortingModeShows: 2,
ResolutionPreferenceMovies: 0,
ResolutionPreferenceShows: 0,
PercentageAdditionalSeeders: 25,
UsePublicDNS: false,
PublicDNSList: "8.8.8.8,8.8.4.4,9.9.9.9",
OpennicDNSList: "193.183.98.66,172.104.136.243,89.18.27.167",
CustomProviderTimeoutEnabled: false,
CustomProviderTimeout: 15,
ProxyURL: "",
ProxyType: 1,
ProxyEnabled: false,
ProxyHost: "",
ProxyPort: 1080,
ProxyLogin: "",
ProxyPassword: "",
CompletedMove: false,
CompletedMoviesPath: "",
CompletedShowsPath: "",
LocalOnlyClient: false,
}
INFO main ▶ main Addon: plugin.video.elementum v0.0.52
DEBU database ▶ InitSqliteDB Error migrating schema: unable to open database file
DEBU database ▶ RestoreBackup Restoring backup
And I don't know how to move pass this.
If you set remoteHost while starting the binary - you are taking all the settings from that IP's Kodi. So any path, like binary location or database location is taken from that host. Of course, if you have different OS - they will differ. You will not be able to run properly.
You can run Kodi on your Windows to control and setup the plugin.
Oh, then it's pretty much a useless feature.
My whole idea behind it was to run the binary on a powerful machine/computer, and have low-powered devices connect to it.
Ideally the binary on the "powerful machine" should just handle the actual torrent download and then the streaming back to the "client" (ie: android box?).
Also, it would have been nice for the binary to be multi-client.
So if you have multiple low-powered android boxes, for example, they could all delegate the torrent downloading/streaming to a computer/server.
Also, it would have been nice for the binary to be multi-client.
It is already multi-client. To start and function, binary needs running Kodi, to get settings and other things. You can use remote Kodi, you can use local Kodi, but you need one to give settings to the binary.
Clients then use settings from "master" Kodi, which controls the binary. So you just set remote IP and that is it.
I don't think you understand what I mean by multi-client
.
It only takes 1 x remoteHost
.
What if I have 2 android tv boxes and 1 Windows PC that is powerful enough for downloads?
How would I run it with 2 x remoteHost=
?
I don't think you understand what I mean by multi-client.
Last time. Each Kodi, with installed plugin.video.elementum should speak to some binary. Each binary should speak to one specific Kodi, does not matter remote or local.
To run binary you need existing, running Kodi somewhere in the network, does not matter local or remote.
To run headless (without binary) clients you need a binary running somewhere.
Just install Kodi with Elementum on windows host and run it in a background. Then install Kodi with Elementum on Android and point them to Windows IP and not run binary locally.
And that's not what I mean by multi-client.
If you want to make it work like you describe - you can fork and make your own plugin. It's open source. Elementum is primarily a Kodi plugin, not a standalone application. Making it work without Kodi will take a lot of time, and I don't want to do all of that. It does not make sense if looking over required efforts.
That's a shame, because it's almost there. What it needs:
- The ability to define local immutable settings (ie: download path)
- The ability to detect the client's IP (ie:
remoteHost
) automatically - so it always replies to the client IP for the Dialogues & Status - Detachment of the Library functionality (creation and maintenance of
.strm
files, which should be done by the plugin).
Ideally, this could actually be achieved by running the Elementum binary on the Kodi client itself, too.
The only functionality that needs to be delegated is the torrent downloading & streaming.
So if you have something like:
<setting id="useRemoteServerForDownloads" type="bool" default="false" />
<setting id="useRemoteServerIP" type="text" />
[...]
In this case, Elementum binary on the Kodi running box does everything it already does, but if useRemoteServerForDownloads == True
, then it just asks the Elementum "server" to do it instead.
I understand it's low priority and you may not want to do it. I have no Go experience, and last time I tried to change something I wasn't able to get the build environment working, so I'm out of luck.
Hi,
Just tried more and more to make it work, but without success.
So, the "server" is on the Windows Machine. The client is on the Apple TV.
I started Kodi on Server (Windows / Linux) and access the Elementum app. No change in the config except the download path. Tested the "status" web page to make sure the API is accessible.
On the AppleTV, i entered in settings, set it to not run binary, and set the Remote Host ip to the IP of the "Server"
Checking the log of the "Server" I found that on saving settings on Client the elementum form Server is restarting (I don't know if this a correct behaviour, because the Client is reading settings from server and not vice-versa)
On the Client side, when I try to access the elements, the HUD requests me to restart kodi. On the same time, this is the log from the AppleTV console:
https://pastebin.com/3kXTi7af (the appletv log) `
@CMGeorge please, post the full log somewhere (f.e. http://paste.ubuntu.com ).
Checking the log of the "Server" I found that on saving settings on Client the elementum form Server is restarting (I don't know if this a correct behaviour, because the Client is reading settings from server and not vice-versa)
This is not critical, as it tries to reload the client (not the whole application) on configuration changes. Not sure we can detect changes coming from non-master device. I will check.
Have you tried the 0.0.53 on IOS with binary execution?
iOS (iPhone) with binary execution keep the same error with "module" https://1drv.ms/u/s!AiK6EQerBMjLtfN4p4tjgx3H7uRdxA (0.0.53)
@elgatito Is there any way to select the torrent file from client, instead of server ?
Same here. Anyway to pick the torrent on the client?
Currently the server only talks to the local Kodi, this is why the torrent selection pops up on the server and also why it plays the video there.
Works great even in docker, @elgatito thank you for the nice software !
Works great even in docker, @elgatito thank you for the nice software !
Hi @undead-osiris , would you mind sharing your docker image? Because as webui does not let you install addons it is troublesome to setup manually.
Also, what port mapping/configuration needs to be done?
Thanks
Works great even in docker, @elgatito thank you for the nice software !
Hi @undead-osiris , would you mind sharing your docker image? Because as webui does not let you install addons it is troublesome to setup manually.
Also, what port mapping/configuration needs to be done?
Thanks Hey you just put elementum inside and use ubuntu image. Use default port
@Znuff , have you figure out how to make that work? @elgatito Some help would be appreciated. I read the thread numerous times, I still don't understand.
I have a low-powered AndroidTV box with IP 192.168.0.100 plugged on a TV and a powerful Linux Server with IP 192.168.0.2 in another room. For now the Linux server is an Ubuntu desktop with a screen but I plan to swith to a headless Kodi in a Docker container once Elementum is setup correctly.
Both machines have Kodi and Elementum.
Android box has binary disabled and points to remote host 192.168.0.2.
Weird thing is that once a movie is selected on the AndroidTV box, the torrent selection has to be made on the Linux server. My first thougth: How will I still be able to select torrents when I remove the screen from the server? Anyhow, even after I select the torrent on the Linux server, nothing is played on the Android TV.
Help, please? Thanks
@jpbaril no, it is not possible, the author has made it clear that it's not the way he intends to make it work.
The current implementation is half-baked, from my point of view and I simply can't find a scenario where someone would want to select the torrent being played on a remote device.
What I had in mind was something much simpler from a logistic point of view:
- Have Kodi+Elementum script/plugin run on a low-power device, so all the UI stuff, even torrent selection/scraping is handled by that device alone.
- Have the Elementum binary run on a more powerful device - this could be a linux pc, a windows pc, a NAS or whatever. This binary should basically just handle the actual downloading of the torrent data. This should simply accept remote commands like: "download this torrent", "delete this torrent", "pause this torrent" etc.
- Once the powerful device has data for the torrent requested, it should simply make it available for streaming to the low-powered device
for me it works like this
sysd service runs elementum
[Unit]
Description=Elementum
After=network.target
[Service]
Type=simple
WorkingDirectory=/share/CACHEDEV1_DATA/.qpkg/Kodi17/opt/.kodi/addons/plugin.video.elementum/resources/bin/linux_x64
Restart=always
RestartSec=90
ExecStart=/usr/local/bin/elementum.sh
[Install]
WantedBy=multi-user.target
here is /usr/local/bin/elementum.sh
#!/bin/bash
/share/CACHEDEV1_DATA/.qpkg/Kodi17/opt/.kodi/addons/plugin.video.elementum/resources/bin/linux_x64/elementum -remoteHost=10.0.0.25 -localHost=10.0.0.8
path like /share/CACHEDEV1_DATA/.qpkg/.... should be the same as on your 'powerful' device, in my case it's just a small qnap ts241
on you RPi or else choose option 'don't start binary' and enter ip of the 'powerful' device )) I hope it helps.