[Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Come up with a useful post-processing script? Share it here!
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by tret »

version 2.50 (Use the download link at the bottom of the 1st post in the thread)

Changes:
- Added the ability to use 2 additional destination paths (Used as rollover for full drives)
- Added a lot of error control code
- Re-designed failed download handling and detection
- Storage use and availability information is written to script output (Now working properly for Windows and Mac OS X)
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by tret »

I found a bug in the junk file processing portion of the code. I'll be working on it and posting an update soon

Rob
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by tret »

version 2.51 (Use the download link at the bottom of the 1st post in the thread)

Changes:
- Fixed a bug in the junk file removal code which was causing an error if the minimum file size option wasn't used
Last edited by tret on April 21st, 2010, 7:38 pm, edited 1 time in total.
ianmen
Newbie
Newbie
Posts: 4
Joined: December 30th, 2009, 4:36 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by ianmen »

I am getting the follow error :

Exit(1) httplib.BadStatusLine

With the following traceback:

Traceback (most recent call last):
  File "/home/ianmen/sabscript/htpc_sort.py", line 340, in
    try: handle = urllib2.urlopen(req)
  File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.6/urllib2.py", line 391, in open
    response = self._open(req, data)
  File "/usr/lib/python2.6/urllib2.py", line 409, in _open
    '_open', req)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 1161, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.6/urllib2.py", line 1134, in do_open
    r = h.getresponse()
  File "/usr/lib/python2.6/httplib.py", line 986, in getresponse
    response.begin()
  File "/usr/lib/python2.6/httplib.py", line 391, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.6/httplib.py", line 355, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine

How can I fix this problem? Is this just a normal error or some specific? Thank you on forhand !
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by tret »

ianmen wrote: I am getting the follow error :

Exit(1) httplib.BadStatusLine

With the following traceback:

Traceback (most recent call last):
  File "/home/ianmen/sabscript/htpc_sort.py", line 340, in
    try: handle = urllib2.urlopen(req)
  File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.6/urllib2.py", line 391, in open
    response = self._open(req, data)
  File "/usr/lib/python2.6/urllib2.py", line 409, in _open
    '_open', req)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 1161, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.6/urllib2.py", line 1134, in do_open
    r = h.getresponse()
  File "/usr/lib/python2.6/httplib.py", line 986, in getresponse
    response.begin()
  File "/usr/lib/python2.6/httplib.py", line 391, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.6/httplib.py", line 355, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine

How can I fix this problem? Is this just a normal error or some specific? Thank you on forhand !
Can you post more information? OS/Version, SABnzbd version, path to script, your settings.ini file, these would be helpful.

Thanks,
Rob
ianmen
Newbie
Newbie
Posts: 4
Joined: December 30th, 2009, 4:36 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by ianmen »

tret wrote:
ianmen wrote: I am getting the follow error :

Exit(1) httplib.BadStatusLine

With the following traceback:

Traceback (most recent call last):
  File "/home/ianmen/sabscript/htpc_sort.py", line 340, in
    try: handle = urllib2.urlopen(req)
  File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.6/urllib2.py", line 391, in open
    response = self._open(req, data)
  File "/usr/lib/python2.6/urllib2.py", line 409, in _open
    '_open', req)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 1161, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.6/urllib2.py", line 1134, in do_open
    r = h.getresponse()
  File "/usr/lib/python2.6/httplib.py", line 986, in getresponse
    response.begin()
  File "/usr/lib/python2.6/httplib.py", line 391, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.6/httplib.py", line 355, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine

How can I fix this problem? Is this just a normal error or some specific? Thank you on forhand !
Can you post more information? OS/Version, SABnzbd version, path to script, your settings.ini file, these would be helpful.

Thanks,
Rob
I'm sorry:
I'm running Ubuntu:Linux mars 2.6.32-22-generic #33-Ubuntu SMP Wed Apr 28 13:27:30 UTC 2010 i686 GNU/Linux
With sabnzbd version : 0.5.2RC1
Patch to script: /home/ianmen/sabscript/
My settings.ini:

Code: Select all

[misc]
failed_destination = /home/ianmen/video/
set_permissions = 0777
[XBMC]
address = 192.168.1.104
port = 4040
[TV]
source = /home/ianmen/video/TV/
destination = /media/DISK_2/TV_series/
min_download_size = 100MB
min_file_size = 50MB
xbmc_library = video

My sorting line in sabnzdb: %sn/Season %0s/%sn - S%0sE%0e.%ext

The error doesn't occur all the time for example while processing 24 or Two and a Half men works just fine. But processing House gives this error's.

Thank you for looking
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by tret »

ianmen wrote:
tret wrote:
ianmen wrote: I am getting the follow error :

Exit(1) httplib.BadStatusLine

With the following traceback:

Traceback (most recent call last):
  File "/home/ianmen/sabscript/htpc_sort.py", line 340, in
    try: handle = urllib2.urlopen(req)
  File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.6/urllib2.py", line 391, in open
    response = self._open(req, data)
  File "/usr/lib/python2.6/urllib2.py", line 409, in _open
    '_open', req)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 1161, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.6/urllib2.py", line 1134, in do_open
    r = h.getresponse()
  File "/usr/lib/python2.6/httplib.py", line 986, in getresponse
    response.begin()
  File "/usr/lib/python2.6/httplib.py", line 391, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.6/httplib.py", line 355, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine

How can I fix this problem? Is this just a normal error or some specific? Thank you on forhand !
Can you post more information? OS/Version, SABnzbd version, path to script, your settings.ini file, these would be helpful.

Thanks,
Rob
I'm sorry:
I'm running Ubuntu:Linux mars 2.6.32-22-generic #33-Ubuntu SMP Wed Apr 28 13:27:30 UTC 2010 i686 GNU/Linux
With sabnzbd version : 0.5.2RC1
Patch to script: /home/ianmen/sabscript/
My settings.ini:

Code: Select all

[misc]
failed_destination = /home/ianmen/video/
set_permissions = 0777
[XBMC]
address = 192.168.1.104
port = 4040
[TV]
source = /home/ianmen/video/TV/
destination = /media/DISK_2/TV_series/
min_download_size = 100MB
min_file_size = 50MB
xbmc_library = video

My sorting line in sabnzdb: %sn/Season %0s/%sn - S%0sE%0e.%ext

The error doesn't occur all the time for example while processing 24 or Two and a Half men works just fine. But processing House gives this error's.

Thank you for looking
Well from your settings.ini file it looks like you are using an older version of the script. I made quite a few changes with the newest version (2.51) and it is not compatible with the older settings.ini format. If you did upgrade the script version, take a look at the sample settings.ini file that came with it and go from there. If not, please update to the latest version as some of the older versions had bugs that will be resolved once you do upgrade.

Thanks,
Rob
ianmen
Newbie
Newbie
Posts: 4
Joined: December 30th, 2009, 4:36 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by ianmen »

It seems that I indeed was using an old version of the script. I upgraded, it works now. Many thanks for the help !
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by tret »

ianmen wrote: It seems that I indeed was using an old version of the script. I upgraded, it works now. Many thanks for the help !
Very cool, glad to hear it! You're Welcome :)

Rob
tsqrd
Newbie
Newbie
Posts: 1
Joined: March 4th, 2009, 4:20 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by tsqrd »

Quick Permissions question for you...

I have sabnzbd configured to apply 755 on finished downloads.  Top Level destination folders (e.g. /movies) are set to 755. 

I really love using this script, however all completed downloads processed with your script end up being set to 700 instead of 755 Are you setting permissions within the script or are they coming from somewhere else?

(For information, my umask is set to 022 so it doesn't appear to be following the umask either.)
revelation_22
Newbie
Newbie
Posts: 21
Joined: October 19th, 2008, 12:21 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by revelation_22 »

feature request

I use this script mostly for movies. It would be great if it could sort HD and SD content to different folders.

Thanks
xtinct101
Release Testers
Release Testers
Posts: 25
Joined: May 24th, 2010, 5:01 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by xtinct101 »

After updating to 0.5.3 Final, it seems the script just keeps giving errors,

"HTPC Sort v2.51 by tret
Error: The 'settings.ini' file does not contain a 'alt.binaries.x264' section" (different group depending where its downlaoding from)

I get this error for anything that it tries to sort. But before the upgrade it was working fine. I'm using nzbmatrix for nzb's just incase that might be the problem. Any ideas?

Update** its not a nzbmatrix issue as i tried it on nzbs.org and it still gives the same error.
Last edited by xtinct101 on June 27th, 2010, 2:40 pm, edited 1 time in total.
starpc
Newbie
Newbie
Posts: 9
Joined: September 28th, 2008, 8:58 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by starpc »

xtinct101 wrote: After updating to 0.5.3 Final, it seems the script just keeps giving errors,

"HTPC Sort v2.51 by tret
Error: The 'settings.ini' file does not contain a 'alt.binaries.x264' section" (different group depending where its downlaoding from)

I get this error for anything that it tries to sort. But before the upgrade it was working fine. I'm using nzbmatrix for nzb's just incase that might be the problem. Any ideas?

Update** its not a nzbmatrix issue as i tried it on nzbs.org and it still gives the same error.
I've been getting the same error.
tret
Full Member
Full Member
Posts: 148
Joined: August 2nd, 2008, 2:07 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by tret »

xtinct101 wrote: After updating to 0.5.3 Final, it seems the script just keeps giving errors,

"HTPC Sort v2.51 by tret
Error: The 'settings.ini' file does not contain a 'alt.binaries.x264' section" (different group depending where its downlaoding from)

I get this error for anything that it tries to sort. But before the upgrade it was working fine. I'm using nzbmatrix for nzb's just incase that might be the problem. Any ideas?

Update** its not a nzbmatrix issue as i tried it on nzbs.org and it still gives the same error.
Hi Guys,

I am using 0.5.3 as well as nzbmatrix and I have never seen this error. Can you please post some more details for me. I'd like to take a look at the following:

- OS
- Python Version
- Post your settings.ini file as well as give me a brief explanation of how your sabnzbd cateogries section is set up

Thanks,
Rob
xtinct101
Release Testers
Release Testers
Posts: 25
Joined: May 24th, 2010, 5:01 pm

Re: [Linux, MacOSX, Windows] Media Sorting + XBMC Updater

Post by xtinct101 »

Hi Tret,

OS = Win7
Python = 2.6
Setting.ini
[SABnzbd]
address = 192.168.1.191:8081
login = *
password = *
apikey = *
[Movies]
destPath = E:\MediaVault\Movies
destPath2 = E:\MediaVault\Movies
failPath = E:\Download
minDownloadSize = 50MB
minFileSize = 200MB
libraryType = video
[Music]
destPath = E:\MediaVault\Music
minFileSize = 750KB
libraryType = music

My Categories is set up pretty normally, nothing really special everything set to default except using htpc_sort.py as the post script. I do add the * to the groups name, ie Music* for it to work with nzbmatrix but I removed it and tried with nzbs.org but still the exact same error.

Are you using 0.5.3 Final as it doesnt happen on the RC versions.
Post Reply