[New Feature] Android installer

Discuss newly added features or request new features.
Nedle
Posts: 49
Joined: 06 Aug 2014, 10:24

Re: [New Feature] Android installer

Post by Nedle » 13 Oct 2015, 09:40

hugbug wrote:Settings page always loads all scripts from disk. But to be able to select scripts for nzbs or launch them NZBGet must be reloaded after a new script was added to scripts folder.

NZBGet android app is just small control program to launch the actual nzbget daemon. The daemon is controlled via a shell script. The script has an unusual filename libdaemon.so (there is a reason for such naming) but that's a normal shell script which you can edit in a text editor. That script would be a perfect place to put python intialization. After that you might be able to use python scripts without wrappers. Can you test this?
Yep, that actually works. Added this to the libdaemon.so:

Code: Select all

#Python intialization                                                           
export PYTHONHOME=/data/data/com.googlecode.pythonforandroid/files/python       
export PYTHONPATH=/storage/sdcard0/com.googlecode.pythonforandroid/extras/python:/data/data/com.googlecode.pythonforandroid/files/python/lib/python2.6
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/data/com.googlecode.pythonforandroid/files/python/lib
And was able to run the simple python PP-script:

Code: Select all

#!/data/data/com.googlecode.pythonforandroid/files/python/bin/python
##############################################################################
### NZBGET POST-PROCESSING SCRIPT                                          ###
### NZBGET POST-PROCESSING SCRIPT                                          ###
##############################################################################

import sys
POSTPROCESS_SUCCESS=93
POSTPROCESS_NONE=95
POSTPROCESS_ERROR=94
print('Hello world')
sys.exit(POSTPROCESS_SUCCESS)
I was testing all of this on my tablet instead of my FireTV since I'm not home atm. However I'm running 5.1 on there instead of kitkat on the FireTV and kept getting the same error initially: "error: only position independent executables (PIE) are supported.". Had to change the /system/bin/linker file to be able to run python. Not anything you can fix but it seems like anyone running android 5.0+ will have this issue when running executables:
http://forum.xda-developers.com/google- ... k-t2797731
Last edited by Nedle on 13 Oct 2015, 10:03, edited 4 times in total.

hugbug
Developer & Admin
Posts: 7429
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [New Feature] Android installer

Post by hugbug » 13 Oct 2015, 09:49

Was the change in linker necessary to run nzbget too or is it for python only?

Nedle
Posts: 49
Joined: 06 Aug 2014, 10:24

Re: [New Feature] Android installer

Post by Nedle » 13 Oct 2015, 09:59

hugbug wrote:Was the change in linker necessary to run nzbget too or is it for python only?
Only for python

hugbug
Developer & Admin
Posts: 7429
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [New Feature] Android installer

Post by hugbug » 13 Oct 2015, 10:09

Does that mean the nzbget binary is compiled in PIE mode and will not work on older androids (prior 4.1)?
Not that a big issue probably, considering the total lack of interest to android build anyway.

Are you planning to do more tests with this version or stick to the port from play store?

Nedle
Posts: 49
Joined: 06 Aug 2014, 10:24

Re: [New Feature] Android installer

Post by Nedle » 13 Oct 2015, 12:33

hugbug wrote:Does that mean the nzbget binary is compiled in PIE mode and will not work on older androids (prior 4.1)?
Not that a big issue probably, considering the total lack of interest to android build anyway.

Are you planning to do more tests with this version or stick to the port from play store?
Not sure to be honest, don't have any older device which runs an older android so can't test either. Just ran VideoSort and that also seems to work properly, renamed the file and moved it to the correct folder. Will probably try to convert the setup I have at home to this version as well since I'll get the latest NZBGet without having to wait for port to update, it's still on 15.0 atm. Also seems to be a lot cleaner, don't need call scripts for each python scripts and can try out new PP-scripts a lot easier.

Nedle
Posts: 49
Joined: 06 Aug 2014, 10:24

Re: [New Feature] Android installer

Post by Nedle » 13 Oct 2015, 20:58

One question, how would I be able to run the daemon from a shell command? Need it so I can start NZBGet on boot. Got it to launch from /data/data/net.nzbget.nzbget/nzbget/nzbget -D but then it doesn't set the paths specified in libdaemon.so. Need to launch is using libdaemon.so but have not been able to figure out how.

hugbug
Developer & Admin
Posts: 7429
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [New Feature] Android installer

Post by hugbug » 13 Oct 2015, 21:09

That should work:

Code: Select all

/path/to/libdaemon.so start

Nedle
Posts: 49
Joined: 06 Aug 2014, 10:24

Re: [New Feature] Android installer

Post by Nedle » 14 Oct 2015, 10:11

That was the first thing I tried after seeing the contents of libdaemon.so, not sure what I messed up but seems to work now, thanks!

BTW, I tried to update to videoSort 6.1, was using videoSort 4.0 before and that always worked well. Now it doesn't seem to recognize the videocodec, format and release group and instead just thinks those tags are the episode title, so instead of getting:
<Series name> - 1x03 - <Episode title> [codec tags] (release group)
I get:
<Series name> - 1x03 - Codec tags [].

Went through the log but didn't see anything that jumped out, you have any clue what could be going on?

hugbug
Developer & Admin
Posts: 7429
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [New Feature] Android installer

Post by hugbug » 14 Oct 2015, 10:17

It's better to discuss VideoSort issues in its own thread, unless it's really android specific.
Can you test that same file on a PC?
Or give me an example file name and I'll test it.

Nedle
Posts: 49
Joined: 06 Aug 2014, 10:24

Re: [New Feature] Android installer

Post by Nedle » 15 Oct 2015, 13:52

Seems to be an android specific issue, since it is not happening when I try the same file on my windows laptop, PMed you the logs of just one of the test files. It happens with every file I tried though..

The scheduler on android doesn't work flawlessly either. I have 2 tasks set:
Task1, 08:00 Pause.
Task2, 15:00 Unpause

As it is 15:46 it should unpause, however NZBGet pauses when I reload. If I shift it task 2 to 13:00 it does unpause. Not sure what the cut-off seems to be. Time reported in NZBGet is also 15:46 so no time correction should be needed.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests