Blauwbek / pySabRename

pySabRename, the solution for all your renaming requests
8 stars 4 forks source link

extension found but cannot be extracted somehow #1

Closed bakmanhans closed 8 years ago

bakmanhans commented 9 years ago

When I manually kickof the pySabRename script on a succesfully downloaded file, I get the next error message:

pySabRename

Searching dir: 
/var/flexshare/shares/downloads/incoming/9e6c2deef0f7b8cc364246b394201814.rar
Searching dir:  /var/flexshare/shares/downloads/incoming/9e6c2deef0f7b8cc364246b394201814.rar/76d6896d3283687edee42de65ff20503
Searching dir:  /var/flexshare/shares/downloads/incoming/9e6c2deef0f7b8cc364246b394201814.rar/76d6896d3283687edee42de65ff20503/Usenet

+Renaming process+
Found: QoQ-sbuSLN.462.H.1.5DD.LD-BEW.p0801.20E50S.yrotS.rorroH.naciremA.mkv
Old name: /var/flexshare/shares/downloads/incoming/9e6c2deef0f7b8cc364246b394201814.rar/76d6896d3283687edee42de65ff20503/QoQ-sbuSLN.462.H.1.5DD.LD-BEW.p0801.20E50S.yrotS.rorroH.naciremA.mkv
Traceback (most recent call last):
  File "./pySabRename_unix.py", line 77, in <module>
    print 'Found extension! ({})'.format(ext)
ValueError: zero length field name in format

I call the script on my CentOS 6 system like this:

./pySabRename_unix.py /downloads/incoming/9e6c2deef0f7b8cc364246b394201814.rar 9e6c2deef0f7b8cc364246b394201814.rar.nzb 9e6c2deef0f7b8cc364246b394201814.rar 123 series alt.binaries.boneless 0
Blauwbek commented 9 years ago

Can I ask you what python version you are using? This problem appears to be a python 2.6 thing... As far as I can find, a tempfix would be to replace line 77 with the following: print 'Found extension! ({0})'.format(ext)

bakmanhans commented 9 years ago

# python -V Python 2.6.6

I will try your suggestion

bakmanhans commented 9 years ago

Bingo! Your suggestion worked on my environment: +Renaming process+ Found: QoQ-sbuSLN.462.H.1.5DD.LD-BEW.p0801.20E50S.yrotS.rorroH.naciremA.mkv Old name: /var/flexshare/shares/downloads/incoming/9e6c2deef0f7b8cc364246b394201814.rar/76d6896d3283687edee42de65ff20503/QoQ-sbuSLN.462.H.1.5DD.LD-BEW.p0801.20E50S.yrotS.rorroH.naciremA.mkv Found extension! (.mkv) Extention supported! .mkv

bakmanhans commented 9 years ago

hold on. this doesn't look good: New name: /var/flexshare/shares/downloads/incoming/9e6c2deef0f7b8cc364246b394201814.rar/9e6c2deef0f7b8cc364246b394201814.rar.mkv

Blauwbek commented 9 years ago

It does, though. You specified the job name as being 9e6c2deef0f7b8cc364246b394201814.rar and pySR will simply append the extension, because it expects the job name in sabnzbd to be set to the correct title.

bakmanhans commented 9 years ago

OK, makes sense. But those jobs with backup links etc. do have these random names. How does pySR cope with it?

Blauwbek commented 9 years ago

It doesnt, it expects the downloader (either a person or a piece of software) to handle that.

bakmanhans commented 8 years ago

Any specific recommendation to handle this software-matically? I hate doing it manually...

Blauwbek commented 8 years ago

You can set the third argument of the script to the argument if you run the script manually. It would be the best to automatically give the right title to sab (e.g. rss)