nzbmatrix.com/nzbs.org/newznab automated movie downloader

Come up with a useful post-processing script? Share it here!
agentgreen
Newbie
Newbie
Posts: 48
Joined: February 16th, 2009, 8:56 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by agentgreen »

Can you explain the queuing process included in this script?
binhex
Sr. Member
Sr. Member
Posts: 470
Joined: December 5th, 2008, 11:54 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by binhex »

agentgreen wrote: Can you explain the queuing process included in this script?
sure!, the queuing section allows you to define movies you may or may not want by downloading the nzb to a folder (not watched), this then allows you to copy and paste the nzb from the queued folder to your watched folder to kick off the download.

the reason i implemented this is because i was finding i was getting too many movies coming down that i didnt really want, either because the release date was very early or because the genre wasnt what i wanted, however i didnt want to exclude all early movies, or all movies with a particular genre so i created a way of still downloading the nzb and then allowing me to pick out the movies i do want out of the stuff i dont want.

i tend to now use the queued feature exclusively and just manually move the wanted nzb's to my watched folder, with email notification it works quite well as i get notified whenever anything is queued so there isnt much of a delay.

if you want to force everything to queue just set the QueueDate to a date in the future, snipet of my config.ini:-

#----------------- IMDB Queue Definitions -------------------

#define whether queuing is enabled or not
#valid values:- yes, no
EnableQueuing="yes"

#define the queue folder to store downloaded nzb files
queue_dir="H:\\Downloads\\Usenet\\SABnzbd\\Queued\"

#define the queued genres (use | to seperate items) - will queue movie if either QueueGenre OR QueueDate match
#valid values:- Action, Adventure, Animation, Biography, Comedy, Crime, Documentary, Drama, Family, Fantasy, Film-Noir, Game-Show, History, Horror, Music, Musical, Mystery, News, Reality-TV, Romance, Sci-Fi, Short, Sport, Talk-Show, Thriller, War, Western
QueueGenre="Biography|Documentary|Family|Horror"

#define the maximum year to queue (must be greater than GoodDate) - will queue movie if QueueGenre OR QueueDate match
#valid values:- 1900 to 2999
QueueDate=2050

if you have a smartphone, for instance a android phone then you can even have a ftp client app which can then connect to your pc and copy and paste the nzb from the queued folder to the watched folder remotely  ;D
agentgreen
Newbie
Newbie
Posts: 48
Joined: February 16th, 2009, 8:56 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by agentgreen »

That is a really cool feature.

You've really thought this program out!
agentgreen
Newbie
Newbie
Posts: 48
Joined: February 16th, 2009, 8:56 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by agentgreen »

Ok, one last thing and I swear I'll leave you alone for at least a day :)

I've enabled the SMTP notifications, and I can see that the script is trying to hit the SMTP server, but I keep getting this error in the logs:

Script Run On 29/12/2010 11:14:02

Title: Insomnia 2002 720p BluRay x264 EbP
Debug: Warning SMTP Server Down

I have attempted to send an email using telnet from the same system and the email goes through OK. In the logs there is a long delay between the "Downloading Movie" and when it moves to the next one. I assumed it was having a hard time resolving the host name, so I changed it to an IP address. Same result. I run the SMTP server and I can see TCP traffic back and forth between the SMTP server and my workstation, so I know it's at least TRYING to send the mail.

I then thought it was an issue with my personal SMTP server, so I changed it to use Gmail's settings, with authentication. Same issue. Long pause and then it 'times out' and moves on to the next movie.

Is there any debugging I can do for this?
binhex
Sr. Member
Sr. Member
Posts: 470
Joined: December 5th, 2008, 11:54 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by binhex »

agentgreen wrote: Ok, one last thing and I swear I'll leave you alone for at least a day :)

I've enabled the SMTP notifications, and I can see that the script is trying to hit the SMTP server, but I keep getting this error in the logs:

Script Run On 29/12/2010 11:14:02

Title: Insomnia 2002 720p BluRay x264 EbP
Debug: Warning SMTP Server Down

I have attempted to send an email using telnet from the same system and the email goes through OK. In the logs there is a long delay between the "Downloading Movie" and when it moves to the next one. I assumed it was having a hard time resolving the host name, so I changed it to an IP address. Same result. I run the SMTP server and I can see TCP traffic back and forth between the SMTP server and my workstation, so I know it's at least TRYING to send the mail.

I then thought it was an issue with my personal SMTP server, so I changed it to use Gmail's settings, with authentication. Same issue. Long pause and then it 'times out' and moves on to the next movie.

Is there any debugging I can do for this?
can you copy and paste your email notification details from your config.ini, minus any sensitive details of course :-)
agentgreen
Newbie
Newbie
Posts: 48
Joined: February 16th, 2009, 8:56 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by agentgreen »

#define sending email notification of jobs queued/downloading
#valid values:- yes, no
EnableEmailNotify="yes"

#define your isp's mail server details below
emailserver="smtp.gmail.com"
emailusername="[email protected]"
emailpassword="password"
emailfrom="[email protected]"
emailto="[email protected]"
binhex
Sr. Member
Sr. Member
Posts: 470
Joined: December 5th, 2008, 11:54 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by binhex »

agentgreen wrote: #define sending email notification of jobs queued/downloading
#valid values:- yes, no
EnableEmailNotify="yes"

#define your isp's mail server details below
emailserver="smtp.gmail.com"
emailusername="[email protected]"
emailpassword="password"
emailfrom="[email protected]"
emailto="[email protected]"
hi agentgreen, i have been working on this and have now succesfully got gmail to send emails, the issue was around TLS, basically gmail uses a secure connection to their mail server which i hadn't included in the script, this functionality has now been included and ive uploaded the modified version and reposted the links in the first post of this thread, here is a example of the settings required to get this to work with gmail, note the sample config.ini file has changed as well as the executable so please use the new one included in the zip

#------------------ E-mail Definitions ------------------------

#define sending email notification of jobs queued/downloading
#valid values:- yes, no
EnableEmailNotify="yes"

#define your isp's mail server details below
emailserver="smtp.gmail.com"

#define whether smtp mail server requires TLS (SSL)
#valid values:- yes, no
emailserverssl="yes"

#define your username
emailusername="[email protected]"

#define your password
emailpassword="yourgmailpassword"

#define your from email address
emailfrom="[email protected]"

#define your to email address
emailto="[email protected]"

let me know if this now works for you.

binhex.
agentgreen
Newbie
Newbie
Posts: 48
Joined: February 16th, 2009, 8:56 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by agentgreen »

Hrmm, not looking like it's working. I completely deleted all files in my directory except my config.ini just to make sure I was getting the latest files.

Still the huge lag between videos and no emails. I don't know what's going on. It could be Comcast being a**holes as usual. I just don't why I can send email out using telnet no problems. It should be the same thing!

Any chance you could debug the SMTP connection to a log somewhere so I can see exactly what it's doing?
binhex
Sr. Member
Sr. Member
Posts: 470
Joined: December 5th, 2008, 11:54 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by binhex »

agentgreen wrote: Hrmm, not looking like it's working. I completely deleted all files in my directory except my config.ini just to make sure I was getting the latest files.

Still the huge lag between videos and no emails. I don't know what's going on. It could be Comcast being a**holes as usual. I just don't why I can send email out using telnet no problems. It should be the same thing!

Any chance you could debug the SMTP connection to a log somewhere so I can see exactly what it's doing?
ok you will need to either re-enter your settings in the sample config.ini and save it as config.ini or at the very least add in the following line to the email definitions section otherwise it wont be enabling an ssl connection

#define whether smtp mail server requires TLS (SSL)
#valid values:- yes, no
emailserverssl="yes"
agentgreen
Newbie
Newbie
Posts: 48
Joined: February 16th, 2009, 8:56 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by agentgreen »

Sorry I should have said I updated my config.ini with the new settings:

#------------------ E-mail Definitions ------------------------

#define sending email notification of jobs queued/downloading
#valid values:- yes, no
EnableEmailNotify="yes"

#define your isp's mail server details below
emailserver="smtp.gmail.com"
#define whether smtp mail server requires TLS (SSL)
#valid values:- yes, no
emailserverssl="yes"
emailusername="[email protected]"
emailpassword="password"
emailfrom="[email protected]"
emailto="[email protected]"
binhex
Sr. Member
Sr. Member
Posts: 470
Joined: December 5th, 2008, 11:54 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by binhex »

agentgreen wrote: Sorry I should have said I updated my config.ini with the new settings:

#------------------ E-mail Definitions ------------------------

#define sending email notification of jobs queued/downloading
#valid values:- yes, no
EnableEmailNotify="yes"

#define your isp's mail server details below
emailserver="smtp.gmail.com"
#define whether smtp mail server requires TLS (SSL)
#valid values:- yes, no
emailserverssl="yes"
emailusername="[email protected]"
emailpassword="password"
emailfrom="[email protected]"
emailto="[email protected]"
doing a quick google search on comcast brings up lots of posts about port 25 being blocked, so your right it def looks like your isp is blocking the connection. i have added in the ability to specify the port used which should get around this block. yet again this is another download from the first post, ived added in an additional line in the config.ini so you will need to add the line into your existing config.ini and of course replace the executable, please use port 587.

#define smtp mail server port number
emailserverport=587
agentgreen
Newbie
Newbie
Posts: 48
Joined: February 16th, 2009, 8:56 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by agentgreen »

It's making the connection to Gmail's servers, something is just happening during the connection that times out or something:

C:\Users\htpc>netstat -na |findstr 587
  TCP    192.168.1.237:55385    74.125.157.109:587    ESTABLISHED
  TCP    192.168.1.237:55403    74.125.157.109:587    ESTABLISHED

C:\Users\htpc>netstat -na |findstr 587
  TCP    192.168.1.237:55385    74.125.157.109:587    TIME_WAIT
  TCP    192.168.1.237:55403    74.125.157.109:587    TIME_WAIT
  TCP    192.168.1.237:55424    74.125.157.109:587    TIME_WAIT
  TCP    192.168.1.237:55446    74.125.157.109:587    TIME_WAIT
  TCP    192.168.1.237:55465    74.125.157.109:587    TIME_WAIT

I'm gonna fire up wireshark and see if I can see what's going on here.
agentgreen
Newbie
Newbie
Posts: 48
Joined: February 16th, 2009, 8:56 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by agentgreen »

Are you pushing logon information regardless if the username and password entries are blank?

On my mail server, if you send email to a locally accepted domain, no authentication is required. Since I am emailing myself basically, I don't need to login to the SMTP server. When I leave the username and password entries blank, it seems the script is still trying to login, which is causing authentication errors.

Any chance you can see if the script is sending auth regardless of what's in the emailusername and emailpassword fields? If left blank, it should attempt to send the mail normally with no authentication.
agentgreen
Newbie
Newbie
Posts: 48
Joined: February 16th, 2009, 8:56 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by agentgreen »

Ok so I was getting annoyed at myself for bothering you all the time about this issue, and I was also having troubles getting the script to run as a scheduled task, so I went the over-the-top route :)

I also really really liked your queued movies thing, so I wrote up this batch script to assist me in a couple things.

Firstly it allows me to run the "auto movie download.exe" from a scheduled task. I really don't know what I was doing wrong before.

Secondly, it ties into your queued movies, by creating a folder in my Queued folder for todays date, and moves all queued .nzb files into it. I like the organization of this method as well, because I could script something up that auto-deletes queued movies that are a week or month old.

Thirdly, it lists all the queued movies for todays date, puts them in a file and then emails that file to me. I only plan on running your script once a day, so this works out.


Here it is:


rem ----- Set Paths and variables

set MailTo1=user@email
set QueuePath=C:\Users\htpc\Appdata\Local\Sabnzbd\Queued\
set AMDPath="C:\Users\htpc\Desktop\Auto Movie Download\"

rem ----- Set date stuff

FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE /T') DO SET CDATE=%%B
FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%B
FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B
SET DATE=%yyyy%%mm%%dd%

rem ----- Run Auto Movie Download
cd "C:\Users\htpc\Desktop\Auto Movie Download\"

"auto movie downloader.exe"

rem ----- Move any queued items into a date folder
mkdir %QueuePath%\%DATE%

move %QueuePath%\*.nzb %QueuePath%\%DATE%\

rem ----- Get list of queued items

dir %QueuePath%\%DATE%\*.nzb > %QueuePath%\%DATE%\%DATE%-queue.txt

rem ----- Mail queue listing

c:\blat\full\blat %QueuePath%\%DATE%\%DATE%-queue.txt -to %MailTo1% -s "%DATE% Auto Movie Download"



The blat program is something I found online that seems to work ok.

Again, sorry to bother/harass you the last couple of days :)
Last edited by agentgreen on December 30th, 2010, 3:53 pm, edited 1 time in total.
binhex
Sr. Member
Sr. Member
Posts: 470
Joined: December 5th, 2008, 11:54 am

Re: nzbmatrix.com/nzbs.org automated movie downloader

Post by binhex »

hi agentgreen, hey listen no probs with the postings, i dont mind, i really want to get to the bottom of the issue, if not for me then for anybody else out there running my script and having email issues. im glad you've got a working solution at the moment, but would like to have another swing at identifying the issue tomorrow if you get the time  ;D

i def think its isp related cos its working a treat for me via gmail or via my isp's mail server.

just one last thought, your not running a software firewall are you by any chance?, or have your router set to only allow certain ports outbound?.
Post Reply