[PP-Script] VideoSort - better video sorting

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.
hugbug
Developer & Admin
Posts: 6710
Joined: 09 Sep 2008, 11:58
Location: Germany (NRW)

Re: [PP-Script] VideoSort - better video sorting

Post by hugbug » 15 Jun 2017, 12:44

Something wrong with python installation. Try asking on QNAP forum.

ObB
Posts: 13
Joined: 17 Jun 2015, 20:13

Re: [PP-Script] VideoSort - better video sorting

Post by ObB » 20 Jun 2017, 22:52

(continuation of my earlier posts in this thread)

I want to keep downloaded files in their download folder, but rename when the filename is obfuscated.

I had been using %dn/%dn (%dn - original directory name (nzb-name)) which works well enough most of the time, except for multi-file NZBs, such as an entire TV show season. In this case, the files - which usually contain episode numbers/titles - get renamed to (2), (3), (4) etc etc.

I have made a fix to my copy of VideoSort to add a new format -

%dfn - de-obfuscated filename - original filename if not obfuscated, otherwise original directory name (nzb-name)

Initial testing looks good.

If there are no objections or better suggestions, I'll submit to github in a few days.

Code: Select all

560,569d559
< def get_dfname(org_dirname, org_fname):
<     '''
< 	get a de-obfuscated filename by using dirname ... if necessary
<     '''
<     if org_fname.find('.')==-1 and org_fname.find('_')==-1 and org_fname.find(' ')==-1:
< 		#obfuscated filename ... use dirname
< 		return org_dirname
<     else:
< 		return org_fname
< 
731d720
<     dfname_name = get_dfname(original_dirname, original_fname)
739d727
<     mapping.append(('%dfn', dfname_name))

ObB
Posts: 13
Joined: 17 Jun 2015, 20:13

Re: [PP-Script] VideoSort - better video sorting

Post by ObB » 20 Jun 2017, 23:00

Bug in processing 'PreferNZBName" option.

The following is a test for True/False, but prefer_nzb_name is 'yes' or 'no'

This ...

Code: Select all

use_nzb_name = prefer_nzb_name and len(video_files) == 1
should be ...

Code: Select all

use_nzb_name = prefer_nzb_name == 'yes' and len(video_files) == 1

hugbug
Developer & Admin
Posts: 6710
Joined: 09 Sep 2008, 11:58
Location: Germany (NRW)

Re: [PP-Script] VideoSort - better video sorting

Post by hugbug » 22 Jun 2017, 10:32

ObB wrote:
20 Jun 2017, 22:52
If there are no objections or better suggestions, I'll submit to github in a few days.
Yes, please.
ObB wrote:
20 Jun 2017, 23:00
Bug in processing 'PreferNZBName" option.
Indeed. I would rather change the other line from:

Code: Select all

prefer_nzb_name=os.environ.get('NZBPO_PREFERNZBNAME', '')
to

Code: Select all

prefer_nzb_name=os.environ.get('NZBPO_PREFERNZBNAME', '') == 'yes'
Thank you for contributing.

jamesklyne
Posts: 2
Joined: 08 Jul 2017, 20:18

Re: [PP-Script] VideoSort - better video sorting

Post by jamesklyne » 08 Jul 2017, 20:48

I am attempting to have VideoSort move and rename files.
Perhaps someone can help with this error:

Running Python 2.7.12 on an Ubuntu 16.04 machine, I pulled VideoSort from github today. Everything was installed/updated just in the past couple days.

I have setup categories and paths, I even tried manually assigning a category to this nzb (Movies).

Code: Select all

INFO	2017-07-08 16:42:49	Post-processing again [removed nzb name]
INFO	2017-07-08 16:42:49	[removed nzb name] returned from history back to download queue
INFO	2017-07-08 16:42:49	Queueing [removed nzb name] for post-processing
INFO	2017-07-08 16:42:49	Cleaning up [removed nzb name]
INFO	2017-07-08 16:42:49	Nothing to cleanup for [removed nzb name]
INFO	2017-07-08 16:42:49	Executing post-process-script VideoSort/VideoSort.py for [removed nzb name]
INFO	2017-07-08 16:42:50	VideoSort: Traceback (most recent call last):
INFO	2017-07-08 16:42:50	VideoSort:   File "/opt/nzbget/scripts/VideoSort/VideoSort.py", line 271, in <module>
INFO	2017-07-08 16:42:50	VideoSort:     import guessit
INFO	2017-07-08 16:42:50	VideoSort:   File "/opt/nzbget/scripts/VideoSort/lib/guessit/__init__.py", line 6, in <module>
INFO	2017-07-08 16:42:50	VideoSort:     from .api import guessit, GuessItApi
INFO	2017-07-08 16:42:50	VideoSort:   File "/opt/nzbget/scripts/VideoSort/lib/guessit/api.py", line 13, in <module>
INFO	2017-07-08 16:42:50	VideoSort:     import six
INFO	2017-07-08 16:42:50	VideoSort: ImportError: No module named six
ERROR	2017-07-08 16:42:50	Post-process-script VideoSort/VideoSort.py for [removed nzb name] failed (terminated with unknown status)
INFO	2017-07-08 16:42:50	Executing post-process-script Logger.py for [removed nzb name]

hugbug
Developer & Admin
Posts: 6710
Joined: 09 Sep 2008, 11:58
Location: Germany (NRW)

Re: [PP-Script] VideoSort - better video sorting

Post by hugbug » 08 Jul 2017, 21:16

I guess you've missed the installation instructions as you should have used an archive from releases page instead of git repository which is a development version.

However it's good too as we've found the devel version misses one library. Just added it to repository, please update and report back.

jamesklyne
Posts: 2
Joined: 08 Jul 2017, 20:18

Re: [PP-Script] VideoSort - better video sorting

Post by jamesklyne » 13 Jul 2017, 06:18

hugbug wrote:
08 Jul 2017, 21:16
I guess you've missed the installation instructions as you should have used an archive from releases page instead of git repository which is a development version.

However it's good too as we've found the devel version misses one library. Just added it to repository, please update and report back.
I guess I did. I'm an idiot :)

Sorry about that, I'm not quite sure how I missed that. I did give it a quick shot and noticed that while files were being renamed properly, they were not being moved. I probably just need to understand how Paths, Categories and VideoSort all work together. I grabbed a copy of the release version so I can try that. Thanks.

EDIT:

As I figured, the dev version is working fine (renaming and moving) after I configured everything else correctly. I suppose if you are already familiar with this it is likely much easier to setup :)

Kocane
Posts: 1
Joined: 02 Aug 2017, 18:01

Re: [PP-Script] VideoSort - better video sorting

Post by Kocane » 03 Aug 2017, 19:39

This script is pretty cool but I also use nzbToMedia which it has some trouble working with. I pretty much just need the functionality to rename obfuscated filenames without changing foldernames and what not - can this be done? %dn/%dn.%ext would work well for the most part but sometimes I experience that the nzb has a subfolder within a folder, that contains the videofile. I.e. it'd had to be %dn/%dn/%dn.%ext.

Any possibility for just keeping original folder structure and sticking to renaming the videofile itself?

ObB
Posts: 13
Joined: 17 Jun 2015, 20:13

Re: [PP-Script] VideoSort - better video sorting

Post by ObB » 10 Aug 2017, 22:46

ObB wrote:
20 Jun 2017, 22:52
I'll submit to github in a few days.
I freeeeeekin hate GitHub ...

I forgot to submit the code I had, and now there are 9 commits that have been done since and now I have no clue how to update my fork. What I really want is a button on the website github.com that just updates my fork to whatever the latest commits in nzbget/VideoSort are, but after too long banging my head against that brick wall I have come to the conclusion that what I thought would be a most basic function of an online source control web site just does not exist. then I thought that the "GitHub Desktop" program might be simple enough to do what, I think, would be a fairly simple task, but apparently not ... or I'm thinking about it in completely the wrong way ... /end rant

hugbug
Developer & Admin
Posts: 6710
Joined: 09 Sep 2008, 11:58
Location: Germany (NRW)

Re: [PP-Script] VideoSort - better video sorting

Post by hugbug » 11 Aug 2017, 04:41


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest