elgatito / plugin.video.elementum

Elementum add-on for Kodi. Development of this addon has been stopped!
http://elementum.surge.sh
MIT License
486 stars 159 forks source link

[Request] Allow to run daemon on an external device (pc, nas etc.) #2

Open Znuff opened 7 years ago

Znuff commented 7 years ago

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.

elgatito commented 6 years ago

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.

Znuff commented 6 years ago

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?

elgatito commented 6 years ago

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.

elgatito commented 6 years ago

@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).

Znuff commented 6 years ago

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.

CMGeorge commented 6 years ago

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:

  1. Windows PC with kodi and working elementum
  2. 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.

CMGeorge commented 6 years ago

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.

elgatito commented 6 years ago

@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?

Znuff commented 6 years ago

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.

Znuff commented 6 years ago

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.

elgatito commented 6 years ago

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.

Znuff commented 6 years ago

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.

elgatito commented 6 years ago

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.

Znuff commented 6 years ago

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= ?

elgatito commented 6 years ago

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.

Znuff commented 6 years ago

And that's not what I mean by multi-client.

image

elgatito commented 6 years ago

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.

Znuff commented 6 years ago

That's a shame, because it's almost there. What it needs:

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.

CMGeorge commented 6 years ago

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) `

elgatito commented 6 years ago

@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?

CMGeorge commented 6 years ago

iOS (iPhone) with binary execution keep the same error with "module" https://1drv.ms/u/s!AiK6EQerBMjLtfN4p4tjgx3H7uRdxA (0.0.53)

joaopauloss commented 6 years ago

@elgatito Is there any way to select the torrent file from client, instead of server ?

stuCONNERS1983 commented 6 years ago

Same here. Anyway to pick the torrent on the client?

sfjuocekr commented 5 years ago

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.

mike-sirs commented 5 years ago

Works great even in docker, @elgatito thank you for the nice software !

jpbaril commented 5 years ago

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

ghost commented 5 years ago

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

jpbaril commented 5 years ago

@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

Znuff commented 5 years ago

@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:

ghost commented 5 years ago

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.

BTopbas commented 4 years ago

I have Apple TV and I know elementum binary can't run on Apple TV. I have coreelec Linux kodi box with kodi stable.

Now, I installed elementum client plugin to Apple TV and elementum with binary to coreelec device.

I select don't start binary to true and remote host ip to my coreelec kodi device ip on the Apple TV.

Still not work. When I open elementum on Apple TV gives me timed out. What I am missing?

BTopbas commented 4 years ago

And that's not what I mean by multi-client.

image

This schema is very good! Also elementum server will be docker so run a multiple platforms. I have apple tv and also Linux kodi boxes and raspi's. Everyone has raspi's. This method apple tv users can use elementum with raspi as server.

antonsoroko commented 4 years ago

@BTopbas logs? also paths in all configs should be the same if i remember correctly.

BTopbas commented 4 years ago

Okey. Problem semi solved. First, @elgatito said:

"Version 0.1.46 should work in both Kodi <= 18 and Kodi 19. Burst will not work."

Originally posted by @elgatito in https://github.com/elgatito/plugin.video.elementum/issues/495#issuecomment-573404755

But addon not compatible with matrix(kodi19). So I try with Kodi 17 on apple tv. It is worked but the problem is I cant select torrent. Elementum client sends play info to the server and burst opening on the server machine not on the client machine.

I change settings to not ask any question before stream and auto select torrent on server machine. Now works but again I cant select manually torrent. Must be auto for a headless server. This is huge problem.

elgatito commented 4 years ago

@BTopbas

But addon not compatible with matrix(kodi19). So I try with Kodi 17 on apple tv. It is worked but the problem is I cant select torrent. Elementum client sends play info to the server and burst opening on the server machine not on the client machine.

It will not work properly with multiple Kodi instances.

BTopbas commented 4 years ago

@elgatito Problem is not multiple Kodi instances. Addon not support kodi matrix.

In addon.xml

<import addon="xbmc.python" version="2.24.0" />

You can't install this on matrix because matrix needs 3.0.0 version. Try on install matrix and gives python version error. You said kodi 19 compatible after version 0.1.46 but not. I changed this line and installed elementum on matrix. I can open and change setting but when i launch addon gives error. So i think elementum not compatible kodi 19 and python3. This is not related to this issue topic.

elgatito commented 4 years ago

@BTopbas You are talking about totally different things in the same context.

I had no problems with running on Kodi19. If you have problems - fix them and post a PR, if you like to. This addon is not maintaned.

HobloBoblo commented 3 years ago

I'd just like to confirm that this is working well from Linux server running elementum binary, and client is Android TV (Sony Bravia).

On the Linux server I had to create /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi soft link that points to the actual .kodi directory. Then I can configure Elementum from client side and server doesn't complain about missing directories.

Even "file mode" works, but needs similar trickery because you need paths that exist in both Android and Linux. But after that it works very well, you can start download from the TV and it will continue on the Linux box even if TV is turned off.

HobloBoblo commented 3 years ago

Hmm, just noticed some minor problem in the file mode. When downloading is finished, the files are not moved to destination directory if client is not active at that time. Normally it puts up a requester asking if you want to continue seeding etc, obviously that fails if client is not there.

Still not a big deal to log into Linux box and move file manually.

wtafe commented 2 years ago

Been working at this for a bit. Would like to dockerize it on a headless kodi machine for low memory but running into errors when using burst from remote machines. Works fine on a machine with a display output. I'm assuming it's being thrown since it's trying to create a window where X11 doesn't exist.

This is actually a burst issue so I'm not sure if I should post it in the Burst repo.

Commenting out the p.dialog commands in burst.py fixed the issue! Still having an issue when trying to pull trakt collections on a client. It appears to work fine after the client times out requesting authorization and using the server to pull collections.

~/.kodi/userdata/addon_data/plugin.video.elementum/bin/linux_x64/elementum -remotePort=65221 -localHost=127.0.0.1 -localPort=65220
2022-04-30 01:50:39.399 T:22525826295552  NOTICE: [script.elementum.burst] Using timeout from Elementum: 30 seconds
2022-04-30 01:50:39.401 T:22525826295552  NOTICE: [script.elementum.burst] Burstin' with Sky torrents, RARBG, 1337x, YTS
2022-04-30 01:50:39.401 T:22525826295552   ERROR: EXCEPTION: Error: Window is NULL, this is not possible :-)
2022-04-30 01:50:39.404 T:22525826295552   ERROR: [script.elementum.burst] Traceback (most recent call last):
2022-04-30 01:50:39.404 T:22525826295552   ERROR: [script.elementum.burst]   File "/config/.kodi/addons/plugin.video.elementum/resources/site-packages/elementum/provider.py", line 168, in register
2022-04-30 01:50:39.404 T:22525826295552   ERROR: [script.elementum.burst]     objects = method(payload["search_object"])
2022-04-30 01:50:39.404 T:22525826295552   ERROR: [script.elementum.burst]   File "/config/.kodi/addons/script.elementum.burst/burst/burst.py", line 153, in search
2022-04-30 01:50:39.404 T:22525826295552   ERROR: [script.elementum.burst]     p_dialog.create('Elementum [COLOR FFFF6B00]Burst[/COLOR]', translation(32061))
2022-04-30 01:50:39.404 T:22525826295552   ERROR: [script.elementum.burst]   File "/config/.kodi/addons/script.module.kodi-six/libs/kodi_six/utils.py", line 62, in wrapper
2022-04-30 01:50:39.405 T:22525826295552   ERROR: [script.elementum.burst]     return py2_decode(func(*mod_args, **mod_kwargs),
2022-04-30 01:50:39.405 T:22525826295552   ERROR: [script.elementum.burst] RuntimeError: Error: Window is NULL, this is not possible :-)
2022-04-30 01:50:39.405 T:22525826295552   ERROR: [script.elementum.burst]
2022-04-30 01:50:39.706 T:22526619744000 WARNING: CActiveAE::StateMachine - signal: 22 from port: timer not handled for state: 1
mike-sirs commented 2 years ago

Been working at this for a bit. Would like to dockerize it on a headless kodi machine for low memory but running into errors when using burst from remote machines. Works fine on a machine with a display output. I'm assuming it's being thrown since it's trying to create a window where X11 doesn't exist.

This is actually a burst issue so I'm not sure if I should post it in the Burst repo.

Commenting out the p.dialog commands in burst.py fixed the issue! Still having an issue when trying to pull trakt collections on a client. It appears to work fine after the client times out requesting authorization and using the server to pull collections.

~/.kodi/userdata/addon_data/plugin.video.elementum/bin/linux_x64/elementum -remotePort=65221 -localHost=127.0.0.1 -localPort=65220
2022-04-30 01:50:39.399 T:22525826295552  NOTICE: [script.elementum.burst] Using timeout from Elementum: 30 seconds
2022-04-30 01:50:39.401 T:22525826295552  NOTICE: [script.elementum.burst] Burstin' with Sky torrents, RARBG, 1337x, YTS
2022-04-30 01:50:39.401 T:22525826295552   ERROR: EXCEPTION: Error: Window is NULL, this is not possible :-)
2022-04-30 01:50:39.404 T:22525826295552   ERROR: [script.elementum.burst] Traceback (most recent call last):
2022-04-30 01:50:39.404 T:22525826295552   ERROR: [script.elementum.burst]   File "/config/.kodi/addons/plugin.video.elementum/resources/site-packages/elementum/provider.py", line 168, in register
2022-04-30 01:50:39.404 T:22525826295552   ERROR: [script.elementum.burst]     objects = method(payload["search_object"])
2022-04-30 01:50:39.404 T:22525826295552   ERROR: [script.elementum.burst]   File "/config/.kodi/addons/script.elementum.burst/burst/burst.py", line 153, in search
2022-04-30 01:50:39.404 T:22525826295552   ERROR: [script.elementum.burst]     p_dialog.create('Elementum [COLOR FFFF6B00]Burst[/COLOR]', translation(32061))
2022-04-30 01:50:39.404 T:22525826295552   ERROR: [script.elementum.burst]   File "/config/.kodi/addons/script.module.kodi-six/libs/kodi_six/utils.py", line 62, in wrapper
2022-04-30 01:50:39.405 T:22525826295552   ERROR: [script.elementum.burst]     return py2_decode(func(*mod_args, **mod_kwargs),
2022-04-30 01:50:39.405 T:22525826295552   ERROR: [script.elementum.burst] RuntimeError: Error: Window is NULL, this is not possible :-)
2022-04-30 01:50:39.405 T:22525826295552   ERROR: [script.elementum.burst]
2022-04-30 01:50:39.706 T:22526619744000 WARNING: CActiveAE::StateMachine - signal: 22 from port: timer not handled for state: 1

I run it like this

FROM alpine:3.15.4 as build

ENV ELEMENTUM_VER="0.1.83"
ENV ELEMENTUM_URL="https://github.com/elgatito/plugin.video.elementum/releases/download/v$ELEMENTUM_VER/plugin.video.elementum-$ELEMENTUM_VER.linux_x64.zip"

RUN wget "$ELEMENTUM_URL" -O /tmp/elementum.zip \
    && unzip "/tmp/elementum.zip"

FROM ubuntu:jammy
# Standard path on firestick, It should be equal to one you run on RPI, Fstick or else
ENV ELEMENTUM_PATH="/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.elementum"
RUN apt update \
    && apt install ca-certificates -y \
    && apt clean
COPY --from=build /plugin.video.elementum "$ELEMENTUM_PATH"

RUN ln -s "$ELEMENTUM_PATH/resources/bin/linux_x64/elementum" /usr/local/bin

CMD ["elementum"]
  elementum:
    image: undead/elementum:0.1.86
    container_name: elementum
    environment:
      - "TZ=America/Chicago"
    network_mode: "host"
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    volumes:
      - /tmp:/storage/emulated/0/Download/tmp
    command:
      - elementum
      - -localHost=192.168.1.8
      - -remoteHost=192.168.1.235
    restart: unless-stopped
Znuff commented 2 years ago

Does this actually allow you to choose a specific source, or does it still work only with auto-select? I remember there being an issue specifically with the dialog to select the source.

mike-serchenia commented 2 years ago

Does this actually allow you to choose a specific source, or does it still work only with auto-select? I remember there being an issue specifically with the dialog to select the source.

Yup, I always use 'choose a specific source'

jpbaril commented 2 years ago

@mike-sirs Sorry for dumb question -- last time I looked at this matter and replied to this thread was 3 years ago -- but in your docker-compose file what each IP represents?

I may try again this client+server thing if now it's as easy as launching a Docker container and configuring Elementum accordingly on the Firestick. (BTW, any quick configs for the latter?)

Thanks

mike-sirs commented 2 years ago

@mike-sirs Sorry for dumb question -- last time I looked at this matter and replied to this thread was 3 years ago -- but in your docker-compose file what each IP represents?

  • localHost (192.168.1.8) = Docker server ?
  • remoteHost (192.168.1.235) = Firestick ?

I may try again this client+server thing if now it's as easy as launching a Docker container and configuring Elementum accordingly on the Firestick. (BTW, any quick configs for the latter?)

Thanks

correct localHost is the docker host remoteHost is you kodi

in docker use host network since elementum ports vary every time also, make sure the plugin path is identical to the one you have on your kodi device

jpbaril commented 2 years ago

@mike-sirs Sorry for dumb question -- last time I looked at this matter and replied to this thread was 3 years ago -- but in your docker-compose file what each IP represents?

  • localHost (192.168.1.8) = Docker server ?
  • remoteHost (192.168.1.235) = Firestick ?

I may try again this client+server thing if now it's as easy as launching a Docker container and configuring Elementum accordingly on the Firestick. (BTW, any quick configs for the latter?) Thanks

correct localHost is the docker host remoteHost is you kodi

in docker use host network since elementum ports vary every time also, make sure the plugin path is identical to the one you have on your kodi device

Thanks. Yet, by "quick configs for the latter" I meant to say configs of the plugin "connectivity" section on the firestick.

Also, I do understand the dockerfile will create a "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.elementum" directory in the container, which should be the same path as where the plugin is installed on the firestick. Right ? And so I suppose that if I want to use "file mode" I would also need to recreate in the container the path where plugin on firestick says to download files?

Thanks again! Maybe after 4 years I will succeed in this. (AKA We definitely need a complete tutorial on this)

mike-sirs commented 2 years ago

@mike-sirs Sorry for dumb question -- last time I looked at this matter and replied to this thread was 3 years ago -- but in your docker-compose file what each IP represents?

  • localHost (192.168.1.8) = Docker server ?
  • remoteHost (192.168.1.235) = Firestick ?

"/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.elementum" directory in the container, which should be the same path as where the plugin is installed on the firestick. Right ?: Affirmative.

for the file mode yes,

    volumes:
      - /tmp:/storage/emulated/0/Download/tmp <<<<<<<<<<< this is it for my config

kodi side

mike-sirs commented 2 years ago

so if you use firestick with kodi you can use the same image I do, just change IPs and adjust filePath on kodi side

ShlomiD83 commented 2 years ago

undead/elementum

can you make a image for Raspberry pi 4 aswell?

ShlomiD83 commented 2 years ago

undead/elementum

can you make a image for Raspberry pi 4 aswell?

I would, but I don't have RPi to check

I can check for you.