Newznab Installation Tutorial for Mac OSX

Got a program that plays well with SABnzbd? Share it here!
simonk83
Jr. Member
Jr. Member
Posts: 69
Joined: December 11th, 2010, 3:41 pm

Re: Newznab Installation Tutorial for Mac OSX

Post by simonk83 »

De5perate wrote:Thanks to all those who responded - I am glad to have helped.

As for the automator - I am running it and it seems to work. I haven't had time to spend fiddling with it to get a version that I can visibly track. I hope it runs indefinitely repeating the process every 12 hours but I am not convinced. I am not au fait with this code (or very au fait with any code) but I cannot see a repeating loop in the script so therefore I cannot see it looping. However the description from the original Newznab script file states:
# call this script from within screen to get binaries, processes releases and
# every half day get tv/theatre info and optimise the database
Which sounds to me like it does repeat optimising everything every 12 hours (which coincides withe the 43200 (seconds) in the script)
So I guess we should ask them. Any volunteers?

Thanks again to all the responders.
It should actually update every 600 seconds (10 minutes) by default.

That's this part:

export NEWZNAB_SLEEP_TIME="600" # in seconds
echo "waiting ${NEWZNAB_SLEEP_TIME} seconds..."
sleep ${NEWZNAB_SLEEP_TIME}

The 43200 you see is just the optimizing of the DB and updating some minor scripts, like TV Schedules twice a day.
Tinology
Newbie
Newbie
Posts: 7
Joined: December 16th, 2012, 3:34 am

Re: Newznab Installation Tutorial for Mac OSX

Post by Tinology »

As I'm lazy with the update script I went into System Preferences > System > User & Groups > Login Items

Then simply added the application to begin on startup
blooboy
Newbie
Newbie
Posts: 2
Joined: December 16th, 2012, 5:03 am

Re: Newznab Installation Tutorial for Mac OSX

Post by blooboy »

simonk83 wrote:Does anyone know if the _threaded scripts work on OSX? They're for Linux apparently but, you know, close enough :)
I was looking at the same thing as the two scripts we keep discussing are not spoken about in the documentation as often after the initial injection. I don't think PEAR is part of XAMPP and wondered if it was necessary or for OSX we think it's better just to use the original two scripts. Opinions? Thoughts? Anyone? Anyone? Bueller? :p

Blooboy
simonk83
Jr. Member
Jr. Member
Posts: 69
Joined: December 11th, 2010, 3:41 pm

Re: Newznab Installation Tutorial for Mac OSX

Post by simonk83 »

blooboy wrote:
simonk83 wrote:Does anyone know if the _threaded scripts work on OSX? They're for Linux apparently but, you know, close enough :)
I was looking at the same thing as the two scripts we keep discussing are not spoken about in the documentation as often after the initial injection. I don't think PEAR is part of XAMPP and wondered if it was necessary or for OSX we think it's better just to use the original two scripts. Opinions? Thoughts? Anyone? Anyone? Bueller? :p

Blooboy
Yeah, I gave it a go but it completed far too quickly and I don't think any releases ended up being created.
simonk83
Jr. Member
Jr. Member
Posts: 69
Joined: December 11th, 2010, 3:41 pm

Re: Newznab Installation Tutorial for Mac OSX

Post by simonk83 »

Another question. When i initially set this up in a Linux VM it was necessary to change the timezone in the php.ini and mysql.ini. I didn't do this for the mac installation but have run into a couple of issues getting some groups to work, so I've just added my timezone to the php.ini in the /etc folder (within XAMPP). Just about to test it, but does anyone know if a), this is necessary and b), there's another file somewhere we should be changing, as per the linux install?
zyprexaa
Newbie
Newbie
Posts: 1
Joined: December 18th, 2012, 3:08 pm

Re: Newznab Installation Tutorial for Mac OSX

Post by zyprexaa »

This is a great tutorial, I was trying to get newnab setup all weekend and got some extra tips from your guide. I am running into 1 major road block.

Whenever I "php update_binaries.php" I receive the following error:

PHP Warning: require_once(PEAR.php): failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/nnplus/www/lib/Net_NNTP/NNTP/Protocol/Client.php on line 73
PHP Fatal error: require_once(): Failed opening required 'PEAR.php' (include_path='.:') in /Applications/XAMPP/xamppfiles/htdocs/nnplus/www/lib/Net_NNTP/NNTP/Protocol/Client.php on line 73


Any ideas? I installed PEAR, but that is as far as I've troubleshot. I am running OSX 10.7.x

Thanks
jamesjfa
Jr. Member
Jr. Member
Posts: 50
Joined: June 15th, 2012, 9:37 pm

Re: Newznab Installation Tutorial for Mac OSX

Post by jamesjfa »

Thank you for this. You helped me getting my setup going. I am using MAMP on a Mac Mini that is used for Plex, Sabnzbd & Sickbeard. It appears to be working without any problems. The directories are slightly different but it works.

I run the screen newznab_local.sh from within the terminal (always running in the background) and it runs great. Every 600 seconds it goes out and pulls in new releases etc. One issue I have though is with one of the groups that I use. I am looking for a a working regex(s) that work with a.b.british.drama if anyone can help. If I can't help anyone with the MAMP setup just let me know.

A huge thank you to De5perate though for getting me and others started.
De5perate
Newbie
Newbie
Posts: 12
Joined: December 15th, 2012, 9:05 pm

Re: Newznab Installation Tutorial for Mac OSX

Post by De5perate »

I had a another stab at the automated code and now feel a little foolish - I actually read the read me.txt file in the nix_scripts folder in the update_scripts folder. It states:
Detailed instructions...

cp newznab_screen.sh newznab_local.sh
edit newznab_local.sh to specify paths to your installation
chmod +x newznab_local.sh
screen bash
./newznab_local.sh
ctrl-ad to detach screen
So I tried typing these lines into terminal -

First change the directory to the folder containing the script:

Code: Select all

cd /Applications/XAMPP/xamppfiles/htdocs/nnplus/misc/update_scripts/nix_scripts
the first line creates a new file called newznab_local.sh:

Code: Select all

cp newznab_screen.sh newznab_local.sh
Next open this file in a text editor and then paste in the following code to replace the current contents (assuming your paths match mine.

Code: Select all

#!/bin/sh
# call this script from within screen to get binaries, processes releases and 
# every half day get tv/theatre info and optimise the database

set -e

export NEWZNAB_PATH="/Applications/XAMPP/xamppfiles/htdocs/nnplus/misc/update_scripts"
export NEWZNAB_SLEEP_TIME="600" # in seconds
export PHP_PATH="/Applications/XAMPP/xamppfiles/bin"
LASTOPTIMIZE=`date +%s`

while :

 do
CURRTIME=`date +%s`
cd ${NEWZNAB_PATH}
${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/update_binaries.php
${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/update_releases.php

DIFF=$(($CURRTIME-$LASTOPTIMIZE))
if [ "$DIFF" -gt 43200 ] || [ "$DIFF" -lt 1 ]
then
   LASTOPTIMIZE=`date +%s`
   ${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/optimise_db.php
   ${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/update_tvschedule.php
   ${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/update_theaters.php
fi

echo "waiting ${NEWZNAB_SLEEP_TIME} seconds..."
sleep ${NEWZNAB_SLEEP_TIME}

done
Then type the following lines into terminal:

Code: Select all

chmod +x newznab_local.sh

Code: Select all

screen bash

Code: Select all

./newznab_local.sh
After a brief pause it should proceed to grab all the headers and then hopefully go onto prepare the NZBs etc (although mine is still downloading headers so I am keeping my fingers crossed that it progresses as I hope).

All this happens in Terminal so you can follow the progress beautifully.
simonk83
Jr. Member
Jr. Member
Posts: 69
Joined: December 11th, 2010, 3:41 pm

Re: Newznab Installation Tutorial for Mac OSX

Post by simonk83 »

I assumed you were trying to automate that to run on boot :)
jamesjfa
Jr. Member
Jr. Member
Posts: 50
Joined: June 15th, 2012, 9:37 pm

Re: Newznab Installation Tutorial for Mac OSX

Post by jamesjfa »

Thats the way I run mine. From the terminal.

Cheers,
J
Ouboet
Newbie
Newbie
Posts: 5
Joined: December 18th, 2012, 8:27 pm

Re: Newznab Installation Tutorial for Mac OSX

Post by Ouboet »

De5perate wrote: Next open this file in a text editor and then paste in the following code to replace the current contents (assuming your paths match mine.

Code: Select all

#!/bin/sh
# call this script from within screen to get binaries, processes releases and 
# every half day get tv/theatre info and optimise the database

set -e

export NEWZNAB_PATH="/Applications/XAMPP/xamppfiles/htdocs/nnplus/misc/update_scripts"
export NEWZNAB_SLEEP_TIME="600" # in seconds
export PHP_PATH="/Applications/XAMPP/xamppfiles/bin"
LASTOPTIMIZE=`date +%s`

while :

 do
CURRTIME=`date +%s`
cd ${NEWZNAB_PATH}
${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/update_binaries.php
${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/update_releases.php

DIFF=$(($CURRTIME-$LASTOPTIMIZE))
if [ "$DIFF" -gt 43200 ] || [ "$DIFF" -lt 1 ]
then
   LASTOPTIMIZE=`date +%s`
   ${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/optimise_db.php
   ${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/update_tvschedule.php
   ${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/update_theaters.php
fi

echo "waiting ${NEWZNAB_SLEEP_TIME} seconds..."
sleep ${NEWZNAB_SLEEP_TIME}

done
.
Thanks so much De5perate. You advice has been wonderful. Still working on the automation. Can you elaborate on your last post:
"open this file in a text editor and then paste in the following code to replace the current contents"
Not sure how to do that. Do you mean in Automator?
Cheers Ouboet...
Ouboet
Newbie
Newbie
Posts: 5
Joined: December 18th, 2012, 8:27 pm

Re: Newznab Installation Tutorial for Mac OSX

Post by Ouboet »

Never mind
I feel sheepish. Got it going de5perate. Thanks so much!
O
simonk83
Jr. Member
Jr. Member
Posts: 69
Joined: December 11th, 2010, 3:41 pm

Re: Newznab Installation Tutorial for Mac OSX

Post by simonk83 »

Does anyone know where the sql database is stored?
rk360
Newbie
Newbie
Posts: 6
Joined: December 21st, 2012, 6:40 am

Thank you and SABnzbd Integration Question

Post by rk360 »

Dear De5perate - THANK YOU THANK YOU THANK YOU!

I was trying and trying to set this sucker up, but until your tutorial I was just not able to do so. I really appreciate it, a lot!

---

Now that I got it up and running I would love to use my SABnzbd Install, which runs on my Synology DS213+ in my Network to hand of the downloads.

The problem I am having is figuring out the Complete Path and Vdir URL for SABnzbd running on my DS213+

When I look at my Synolgy/SABnzbd it tells me the path is: /volume1/downloads/complete - this is of course the Path on my NAS drive and not the Mac (where newznab is installed). I am such a newbie that I need help to figure it out.

How would I access my SABnzbd Install on my NAS from my Mac/newznab ?! The local IP for my NAS is 192.168.178.33 but a simple
192.168.178.33/volume1/downloads/complete will not work (I tried ;-)

Any help on this?
De5perate
Newbie
Newbie
Posts: 12
Joined: December 15th, 2012, 9:05 pm

Re: Newznab Installation Tutorial for Mac OSX

Post by De5perate »

Ouboet wrote:
De5perate wrote: Next open this file in a text editor and then paste in the following code to replace the current contents (assuming your paths match mine.

Code: Select all

#!/bin/sh
# call this script from within screen to get binaries, processes releases and 
# every half day get tv/theatre info and optimise the database

set -e

export NEWZNAB_PATH="/Applications/XAMPP/xamppfiles/htdocs/nnplus/misc/update_scripts"
export NEWZNAB_SLEEP_TIME="600" # in seconds
export PHP_PATH="/Applications/XAMPP/xamppfiles/bin"
LASTOPTIMIZE=`date +%s`

while :

 do
CURRTIME=`date +%s`
cd ${NEWZNAB_PATH}
${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/update_binaries.php
${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/update_releases.php

DIFF=$(($CURRTIME-$LASTOPTIMIZE))
if [ "$DIFF" -gt 43200 ] || [ "$DIFF" -lt 1 ]
then
   LASTOPTIMIZE=`date +%s`
   ${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/optimise_db.php
   ${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/update_tvschedule.php
   ${PHP_PATH}/php-5.3.1 ${NEWZNAB_PATH}/update_theaters.php
fi

echo "waiting ${NEWZNAB_SLEEP_TIME} seconds..."
sleep ${NEWZNAB_SLEEP_TIME}

done
.
Thanks so much De5perate. You advice has been wonderful. Still working on the automation. Can you elaborate on your last post:
"open this file in a text editor and then paste in the following code to replace the current contents"
Not sure how to do that. Do you mean in Automator?
Cheers Ouboet...
Sorry for my lack of clarity - you did what I meant - just running it in Terminal - I posted earlier about how to run it through Automator (which seems to work) - but I wanted to be able to see the script running in a terminal window. I think I was just being stupid in the first place not working this out.

So everything seems to be running well - I have only a couple of minor problems.

When I manually updated binaries and releases the script seemed to work flawlessly - when I run the repeating script most (not all) the movie thumbnails do not download (haven't figured out why that would be - maybe a path issue).

I have linked my couch potato setup to my Newznab site and it seems to be selective about what nzbs it can fetch - I have tested it with a number of films that I know my newznab has got and it seems to have no problem with really recent arrivals but some older (3 or 4 days old) it fails to fetch - don't know why.

Tiny issue - the cart in newznab doesn't work - if I add a number of nzbs to my cart and then click download in my cart I just get a blank web page and no files.

Now I have a request - does anyone know how to download the Newznab NZB dump? I understand that there is a large collection of NZBs that you can download which fill the last 1000 days or so and the instructions from het Newznab chat room was simply:
[1] for access to the dump of nzbs, type /query newznab !nzbdump YOURNEWZNABID
So what to do with that - tried typing it into terminal but 'query' is not recognised - any help greatly appreciated.
Post Reply