sharkone / BitTorrent.bundle

BitTorrent channel for Plex Media Server
144 stars 52 forks source link

Add support for raspberry pi3 (already maded) #90

Open ignaszewski opened 7 years ago

ignaszewski commented 7 years ago

I like this bundle but I wasnt working on my RPI3. It was missing scrapmagnet binary for ARM processor. It took me a while but I was able to compile scrapmagnetjs into ARM executable file. I forced to use 32bit and replaced binary file from linux_386 to ARM one and it started to work.

It would be nice to have native support for that. Compiled file (by npm nexe): https://www.dropbox.com/s/eyyo7jjwhi4cu0s/scrapmagnet?dl=0

I think that a lot of RPI ussers would be happy of that.

JeffreyBytes commented 7 years ago

Looking at the releases this channel used to support ARM, but was removed in v1.0.0. I'm not sure why. I don't have a RPI to test this on.

JeffreyBytes commented 7 years ago

See if this works. https://github.com/spaz926/BitTorrent.bundle/tree/arm-support

And if you could tell me what platform.architecture()[0] returns for you with python? I am using os.uname()[4][:3] because I know it returns arm, but if platform.architecture()[0] returns arm then I will use that.

sietze535 commented 7 years ago

That one doesn't work on my RPI2. Can't play the videos.

JeffreyBytes commented 7 years ago

Sorry. Without an RPI I really can't add support for it. I'm not sure how to auto find that the Plex Server is on ARM other than with what I added in my fork. If the current workaround is working with @ignaszewski's shared binary then keep using it that way until somebody can figure out how to add automatic support.

JeffreyBytes commented 7 years ago

By the way this is a Duplicate of #63

ignaszewski commented 7 years ago

RPI2 (all versions A/B) use ARM Cortex-A7 CPU - that is 32bit processor. RPI3B (mine, where I compilled executable file) use ARMv8 CPU - 64-bit processor. Thats why binary cant work.

I dont have acces to any RPI 32bit ATM :/

JeffreyBytes commented 7 years ago

The binary in the fork I shared earlier in this thread is your binary. Even though the CPU is a 64-bit processor doesn't mean the operating system is using 64-bit. Rasbian is only using 32-bit still with some optimization for RPI3 last I checked.

Like I said earlier in the thread this is something I'm not going to be able to test without having a RPI on hand which I currently do not.

sharkone/scrapmagnet makefile is set up to build for android-arm and linux-arm, but have no clue if it is compatible with RPI2 and RPI3.

ignaszewski commented 7 years ago

I have used https://github.com/sharkone/scrapmagnet.js (node version of scrapmagnet, it require to manually add some outdated dependecies) and I compiled it to executable using https://github.com/nexe/nexe.

I will try to compile it using Scrapmagnet go version.

ignaszewski commented 7 years ago

@spaz926 On my RPI3:

I'm still compiling dependencies to go compiller :P, it will take some time before I will be able to use go compiller.

JeffreyBytes commented 7 years ago

Ok I edited the code using os.uname()[4].startswith('arm')

This should allow the plugin to see any arm processor (be it RPI3's or RPI2's) and assign the correct binary.

https://github.com/spaz926/BitTorrent.bundle/tree/arm-support

ignaszewski commented 7 years ago

I have checked your branch and if I set on 'auto' then video is working (RPI3) but on list I don't have 'arm', just auto, 32 and 64 bit.

Maybe add 'arm' to BitTorrent.bundle/Contents/Services/URL/BitTorrent/ServicePrefs.json ? (but trim that array on windows platform)

JeffreyBytes commented 7 years ago

I will add that as an option, but the way I wrote the if statement it should check if it is arm before looking at the preferences. I'll look at it.

Sent from my iPhone

On Feb 13, 2017, at 09:21, ignaszewski notifications@github.com wrote:

I have checked your branch and if I set on 'auto' then video is working (RPI3) but on list I don't have 'arm', just auto, 32 and 64 bit.

Maybe add 'arm' to BitTorrent.bundle/Contents/Services/URL/BitTorrent/ServicePrefs.json ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

JeffreyBytes commented 7 years ago

Ok. I made a few changes. I added the preference for ARM. I also moved architecture to use Plex's built-in Platform API. Hopefully I didn't break anything in the process because I am going off the only API documentation I could find on the Plex forums.

The reason it worked for you on 'auto' is because I edited the code to add support for the auto check for ARM.

For the record, the plugin only looks at the preferences you set if the OS is Linux. For Mac and Windows this preference doesn't matter since there is only one binary for each.

Tell me if it works. If it doesn't please provide me with com.plexapp.plugins.bittorrent.log

Same link as above. https://github.com/spaz926/BitTorrent.bundle/tree/arm-support