-
Notifications
You must be signed in to change notification settings - Fork 451
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
Kodi/xbmc addon #2609
Comments
Great news, love to have more dev people onboard. Yes, jenkins has an almost functional Android version. https://jenkins.tribler.org/job/Build-Tribler_Android-Python/69/ Kodi and vlc inclusion has been on my Xmas list for years... |
So 1) is already done. 2) no clue about cbindings. @devos50 any ideas? Example of how to talk to the new core: https://github.com/boogiekodi/tribler/blob/devel/Tribler/Test/test_as_server.py#L356 All of the 22 students and their projects in the lab are here: https://github.com/Tribler/tribler/wiki#current-items-under-active-development (but I guess you've seen our attempts at documentation if you followed us for 5 years..) Apologies in advance, that we're not always easy to reach and stuff is quite poorly documented. |
Hi @boogiekodi good to have you on board!
Take a look at TriblerService here #2476 because you can run Tribler as a standalone Android service. It has 1) the JSON API and 2) CPython interpreter and all libraries inside. |
Thanks, for your comments and clearification, json api seems like exactly what i need. Let me consume the solutions you propose. Also thanks for the nice attidude and open source motivation you have, considering the size of the project you are managing i think this also must be mentioned. |
@boogiekodi sounds good! I'm currently in the process of completely separating the Tribler core from the GUI and a release of Tribler 7 is near (currently running into some Windows-specific issues unfortunately). I also refactored huge parts of the Tribler core the past nine months to make Tribler more friendly for developers. We provide a REST API over HTTP so you can easily fetch information from the Tribler core or control it. Note that this API is currently pre-alpha and subject to change. We also provide our own video server (streamed over HTTP) so you can just connect VLC or any other HTTP-stream compatible video player to that. I'm really looking forward to it and if you have any questions, please let us know! |
i have managed to run tribler core with lots of effort on winx86 & win64 interpreters inside kodi. especially plyvel and leveldb caused massive pain. My current plan is to cross compile all bindings on py26 + py27. And before implementing tribler core to kodi first i need to implement a binary module installer addon, because you can not install binary modules (so,dll,pyd etc) to kodi in normal circumstances. As you can imagine this will take lots of time but i like to do it for fun. This way i can also have tribler code running actually in Kodi interpreter. For plan B: |
solid progress. congrats. module installer sounds interesting, saw the Kodi plugin and external repo mechanism is quite mature. Is a .ini file not sufficient, versus additional cmdline switches? Guess that with no .ini on filesystem the cmdline args can determine the behavior. |
@boogiekodi good work! 👍
Yes, these are quite challenging to compile under Windows. Have you followed the guide I've written a while ago (http://tribler.readthedocs.io/en/latest/development/development.html#leveldb)?
Out of curiosity, why do you need to compile for Python 2.6? Are there devices that are only supporting an older version of Python?
You can run Tribler headless already using Please let me know if you have any more question and we are more than willing to help :) |
@devos50 i just saw the docs, it would be much easier for me i had seen that earlier especially for leveldb.
Because xbmc,13, Kodi 14,15,16(jarvis) uses py26, Kodi 17 (krypton) py27.And krypton is not even released offically yet. So py26 is mandotary.
when i have the dependecy modules, running the tribler from pythonically with imports is no problem. i asked for commandline arguments because of my plan B. if this cross compiling modules goes out of my hand, i am planning to run the released binary directly with process.Popen(*args). This is an option for:
@synctext |
@boogiekodi
This is what I managed to do for Python 2.7 on Android with P4A: |
@brussee If my assumption is correct my approach is to cross compile all Cbindings as static as possible, (except openssl, python also has openssl binding so i need to dynamic link against this one, or compliant one that wont throw seg faults). So i need to create a build system for all above and pack them as wheels, and distrubite and dynamically install those wheels to corresponding platform using the binary installer kodi addon.
It will be though but i think it is achievable. |
this is why plan A is scary challanging but interesting for me :) |
@boogiekodi How many people roughly us your repo? For planning ahead coming year it's good think out some scenarios. I'm especially afraid of spam and pollution. Nobody got that ever working without central servers. After 11 years of hard work with Tribler, success should not come too soon...:) |
@synctext |
Perhaps a misunderstanding on the misunderstanding :-) |
Even though it is up for a year , collected stats only for 2 months, about 600.000 unique device has installed in 2 months, (there is a variation of %10 of those users are VPN ghosts though). And after 1 year it started to crash any (free or non profit) http server that i used so i decided to use P2P for distro. Finally after 1 month stat service also wanted me to pay, and i had disagreements with the server guys that i used for distro so i stopped distrubuting. And ump is just a sidewalk in KODI highyway, and also what UMP userbase is quite faitless they are exploding masses, they are flashing, KODI though is stable "nerd" heaven and those flashing crowds are actually the products of actualy kodi users. Also another use case, nowadays, TVDB, TMDB, Fanart TV all of those free metadata providers for media is threatining KODI devs cos they are pulling TBs of data of json, even though they use local caching and etc. So dispersy can be an overlay for those as well. |
600k, nice! |
@boogiepy A new master student since this month until the summer working full-time on Android/ARM compatibility of Tribler and Dispersy engine and related matters: @MaChengxin. See his nice first task on documentation: #2060 (comment) |
@synctext currently buildsys is building: i have only approx. 6 hours a week to invest in this project so dev. is quite complex and timeconsuming but i am managing it to work but slow. Currently trying make buildsys more universal. later i will implement arm5,6,7,8 toolchains with manylinux variatons. and finally will also implement android and bionic clib with ndk for android (hopefully). I have a modified distutils pretty flexible for cross compiling so i can see the light at the other end of the tunnel. I am telling all those stuff because, this way there will be no need for CI tools (jenkins) and testing because all packages will be built once and tested once. Then they wont be updated again. However at the end of the day there will be a need for a server to distribute the binaries (like pypa) so i would definetely appreciate for the bandwidth. Sorry i dont have any docs or code in repo yet. I keep changing the structure of buildsys. |
Hello, |
@thoradia that's nice to hear! You should definitely get in touch with our new student who also works on Tribler as a Kodi plugin. You can start Tribler headless using the |
@thoradia wow, you have been busy! (https://github.com/thoradia/LibreELEC.tv/branches) @boogiepy Browsed through the PEP-513 and CentOS 5 build environment, quite a complex route to understand; but very impressive. At Delft university students @EinNarr @MaChengxin are now working full-time in our lab on getting Android and Kodi support operational. @devos50 is our chief-of-code, he knows the broader stuff. |
@boogiepy @thoradia started playing with Kodi for few weeks. Having problem importing the dependencies and modules.
|
@EinNarr i haven't been looking at this project for a while and my code is totally pseudo right now, (as discussed above i was trying to make cross platform support). But looking at the traces, it seems like import sys will fix your problem. I dont exactly remember how triblerGui initializes the paths, and you can also add this dir to path with < extension library="path to dir" > tag in addon.xml. Sorry for my cloudy statements :) (i am boogie btw) |
Thanks for help. I was trying to make tribler a script module of Kodi, but your way is definitely more efficient. |
@EinNarr Best practice is to run tribler core as a service addon service.triblercore, http://kodi.wiki/view/Service_add-ons service addons are run whenever kodi is launched or Kodi user is logged in. This way you can talk with rpc from another client addon like plugin.video.triblerclient. |
@hbiyik Thx for your advice. I am trying service add-on, it should be what I need. |
Good job to post on their forum: http://forum.kodi.tv/showthread.php?tid=306246 |
Cool! Tribler downloading is working. |
@synctext @brussee @devos50 @EinNarr @thoradia Hi I have tested for windows and android 5.1.1 myself and verify that it works, also works on 32bit linuxes if i havent broken some stuff in latest commits, but can be fixed easily so consider it done too. I have also done some small modifiactions on Tribler.Core* and used a modified twisted & zope & pywintypes also. See: All repos: |
@hbiyik It is sooo awesome. Sounds like you brought a brand new possibility for all kinds of Kodi add-ons! How shall I install that? Cloning all the your repos of tribler/ triblerCore/ and all the script add-ons? |
i have just tested under linux, yes linuxes also work like a charm, just make sure your kodi is 32bit. 64 bits not yet compiled. @EinNarr |
Here is the overall dependency map |
@hbiyik can you help us out compiling everything from scratch? |
@synctext let me update the latest in a few weeks, long story short, running tribler pythonically under kodi |
@hbiyik |
hi, long time no see, so my final approach was to import tribler pythonically to embedded python interpreter, i have developed some good addon to achieve that, but some problems arrised. Not gonna go much in detail about it, because it will take pages of execuses :), the biggest ones are, kodi runtime dependencies are varrying too many after a while, and the 2nd biggest one, tribler seriously does not stop sometimes, generally when dispersy is busy. This causes kodi to raise SytemExit Exception by force, and this causes twisted (also minitwisted) to crash. I found my self patching twisted against SystemExit and realized something was wrong. To move on with this approach, tribler and dispersy need to be heavily modified imho, and this causes time/ resource and wasted energy and too much effort for less gain. The new (actually old) approach is create a standalone binary: triblerd. https://github.com/hbiyik/tribler/commit/f2ff221ffce335ba3e5a760d8fd4e373c225b0f8 See commit above, it is ready pythonically, and builadable on windows, also comforst the @brussee environment variables for his android addon. But it is not specific for for headless tribler only it actually is a commandline wrapper for twisted plugins. So with this binary now you run tribler headless, market plugin, trustchain crawler, and tunnel helper plugin. This also comforst for future twisted plugins as well, following a very basic structure. For android there is already a build setup for it, all needs to be done create 2 apks, 1 android client, 1 android triblerd app, client will require triblderd app to be installed and communicate with rest. For kodi, everything will be done as android apk, kodi will require triblerd app to be installed and connect to it with rest through loopback local adapter. There are some other situations to consider here like, what is going to happen if 2 clients want to connect same triblerd etc but first i would like hear your feedback before moving on https://github.com/hbiyik/distro/tree/master/dataserver/tribler you can download the windows binary to play from the above link (hope it works and some dlls are not missing) |
for android triblerd, here is a very nice gui for reference. |
impressive work as always! |
@hbiyik appologies for not seeing your post earlier. We are getting ready to erase Dispersy from Tribler.. IPv8 by @qstokkink will replace a large part of existing code for upcoming V7.1 release. It will take a few release to completely die obviously. We need to move channels to our Trustchain fabric (our core blockchain research). We have some very fancy crypto now operational: #2778 (comment) Trying to get my head around your "commandline wrapper for twisted plugins" based triblerd work. About psutil, this is a new tool for debugging stats only. Is optional in my opinion, certainly for headless mode. |
@synctext @EinNarr
https://github.com/hbiyik/tribler/tree/standalone_server @xoriole Hi i am using a very old version (0.6.1-found it on previous ports of p4a) of psutil on android, but Process related modules seems to be working. Problem is android ndk does not have all linux headers (ndk<21), to support psutil fully there must be kernel level porting, which is too much pain for little gain. Do you have a suggestion about this? |
After nearly a year I finally found a way to easily build Python packages for LibreELEC (aarch64/arm/x86_64). I could now wrap Tribler in a native add-on for LibreELEC. Where do I find the source of Tribler for Kodi? |
continued in #2694 |
Hi, i have been following Tribler since 5 years or so from distant. I am planning to do a kodi addon that will call tribler as a process and communicate it with localhost network queries. Even though kodi has a bundled python interpreter, it is not a very succedable approach directly run tribler with the embeded interpreter because cbinding of lots of underlying modules need to be compiled for each various py version and os platform.
Basically addon part of it will only provide ui and player, tribler will run p2p backend.
The point of this app is to link millions of kodi user with dispersy. i am not overrating the numbers, literaly millions of people.
But the hard part is most of the users (℅90) are running kodi in android os (not java with emdded py interpreter) with their stb boxes, or their smart tvs.
What do you suggest me about
Thanks
The text was updated successfully, but these errors were encountered: