nzbToMedia for NZBGet V11+

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
deaerator
Posts: 12
Joined: 30 Jun 2014, 00:30

Re: nzbToMedia for NZBGet V11+

Post by deaerator » 02 Jul 2014, 00:17

Appreciate the help, finally got it solved. I had to change tv catagory destination directory to the non drone factory folder.

moddigi1
Posts: 39
Joined: 14 Apr 2013, 11:44

Re: nzbToMedia for NZBGet V11+

Post by moddigi1 » 14 Jul 2014, 23:35

My popcorn box doesn't understand python2, so

Code: Select all

#!/usr/bin/env python2
doesn't work. If I change it to python it works,any idea why the change or how it can be permanently fixed?

Thanks!

clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

Re: nzbToMedia for NZBGet V11+

Post by clintonhall » 15 Jul 2014, 03:10

https://github.com/clinton-hall/nzbToMe ... stallation

Basically you need to create a symlink (called python2) that points to python2.7 (or just python if you can't find python2.7).

depending on where these files are at, and what paths are in your PATH variable...

Code: Select all

ln -sf /usr/bin/python2.7 /usr/bin/python2

moddigi1
Posts: 39
Joined: 14 Apr 2013, 11:44

Re: nzbToMedia for NZBGet V11+

Post by moddigi1 » 15 Jul 2014, 23:54

Thank you clintonhall, it's working correctly now :D

TTT
Posts: 9
Joined: 08 Aug 2014, 18:16

Re: nzbToMedia for NZBGet V11+

Post by TTT » 08 Aug 2014, 18:49

Clinton, I've been finding a few downloads failing to be renamed when the filenames are obfuscated. It seems to be due to the download name being space delimited, rather than . delimited. I've included an example below.

Download Name - Show Name S01E01 720p WEB-DL DD5 1 H 264-GROUP
Filename - E:\Downloads\Show Name S01E01 720p WEB-DL DD5 1 H 264-GROUP\shshh3hdhjdj37d3hhdhdh\shshh3hdhjdj37d3hhdhdh.mkv
Reason - Basename is no good (unless you go 2 levels back, but then you still have the ./space issue) and download name fails to be used as when it checks the regex patterns, it expects them to be .720p. etc, but the release name is space delimited rather than . delimited.

I've made a change locally to replace all spaces with .'s in the download name in the replace_filename function before doing the checks, which seems to resolve this. Any chance you can make the change in git?

Also is there any reason why you do the .lower() at line 139 in autoProcessTV.py "process_all_exceptions(inputName.lower(), dirName)". I've also taken that out so the renamed files contain the same case as the release name.

Thanks
TTT

clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

Re: nzbToMedia for NZBGet V11+

Post by clintonhall » 08 Aug 2014, 22:57

Hi TTT,

Thanks for the detailed info.

Regarding the .lower. I believe this was done so that everything could be compared against simple (not case sensitive) regex. I'm not sure if it is still required, it may be there from previous checks etc... Are you saying this works for you without the .lower being passed?

Can you confirm what lines were changed to replace spaces with "."? I can certainly add this (or a variant) into the code.

clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

Re: nzbToMedia for NZBGet V11+

Post by clintonhall » 09 Aug 2014, 00:27

made some changes in nightly branch
https://github.com/clinton-hall/nzbToMe ... 10b4a98b19
please test and let me know if this does what you need.

TTT
Posts: 9
Joined: 08 Aug 2014, 18:16

Re: nzbToMedia for NZBGet V11+

Post by TTT » 09 Aug 2014, 12:58

Thanks Clinton.

Yes I found the .lower() wasn't needed anymore as the regex checks were ignoring case anyway.

Had a look at the changes you made and while it will catch the invalid names, it will rename the files with the name prior to the replace. I.e. containing spaces instead of .s. Making the files not sort correctly.

Any chance you can add the replace on to the lines storing the selected name in to the newname as well?

i.e.

Code: Select all

newname = os.path.basename(dirname).replace(' ','.')
newname = name.replace(' ','.')
Cheers
TTT

clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

Re: nzbToMedia for NZBGet V11+

Post by clintonhall » 09 Aug 2014, 21:31

Yeah, I had thought the issue was the spaces preventing the regex matches, so I just did the replace for those regex checks but assumed the spaces in the actual file name wouldn't be an issue.

What I might do is put in an option to replace spaces with '.'. This way people can set it if they want...

Is this just in the file name, or should we try to replace spaces in the directories? (Could be a big issue if the parent directories contain spaces.... Thinking specifically windows)

clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

Re: nzbToMedia for NZBGet V11+

Post by clintonhall » 09 Aug 2014, 21:48

https://github.com/clinton-hall/nzbToMe ... 0ed1c207bf

Added this in. Only renames the files, not the directories.
If anyone complains about it, I'll make it an option, but for now it just does it.

Post Reply

Who is online

Users browsing this forum: No registered users and 42 guests