[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: 7426
Joined: 09 Sep 2008, 11:58
Location: Germany

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

Post by hugbug » 28 Aug 2013, 19:37

What I meant is at the time when VideoSort is started files are already in category destination dir:
Z:\Media\dailycolbert\The.Daily.Show.2013.08.15.Simon.Pegg.720p.HDTV.x264-LMAO

VideoSort moves all fiels to Tv-folder, that's right. That's why you wrote "set_dest_dir" function. To find out the category destination dir the function can just take the parent path of NZBPP_DIRECTORY ("Z:\Media\dailycolbert"). A complex search over Category definitions isn't needed. The modification itself is of course needed to override "always move"-behavior of VideoSort.

hugbug
Developer & Admin
Posts: 7426
Joined: 09 Sep 2008, 11:58
Location: Germany

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

Post by hugbug » 28 Aug 2013, 22:28

r804:
pp-scripts can now set post-processing parameters by printing command "[NZB] NZBPR_varname=value"; this allows scripts which are executed sooner to pass data for scripts executed later

minimeh
Posts: 33
Joined: 16 Aug 2013, 09:54

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

Post by minimeh » 29 Aug 2013, 01:04

hugbug wrote: 2. the set_dest_dir can be much simpler. The files are already in category destination directory. You just need to take the parent path of NZBPP_DIRECTORY.
What I meant is at the time when VideoSort is started files are already in category destination dir:
Z:\Media\dailycolbert\The.Daily.Show.2013.08.15.Simon.Pegg.720p.HDTV.x264-LMAO
Gotcha! You are right, of course. In discovering that after VideoSort finishes the directory specified by NZBPP_DIRECTORY doesn't exist in my case, I looked for any way to get the category directory other than with the NZBPP_DIRECTORY. Of course it would still be correct when VideoSort runs.

But, hey, what fun is it doing things the easy way?! :)
hugbug wrote: Well, your code works slightly different - it use current destination only if category has a dest dir set. This can be achieved by comparing parent of NZBPP_DIRECTORY with NZBOP_DESTDIR.
I'm not clear on what your thinking is here, but comparing NZBPP_DIRECTORY with NZBOP_DESTDIR isn't necessarily going to yield useful results. There is nothing that says there has to be any relative path relationship between the two. NZBOP_DESTDIR could be "c:\any\old\path" while NZBOP_DESTDIR could be "z:\whatever", right?
hugbug wrote: But I don't think it's necessary. I'll do it simple:
If MoviesDir/SeriesDir,etc. is empty the current destination will be used - which is CategoryX.DestDir if category was used or gloabl DestDir if no category was used.
In my opinion, category destination should take precedence over MoviesDir/SeriesDir/DatedDir which should take precedence over global DestDir. My reasoning is that I clearly want files of a category put into a specific location. I want VideoSort to do its thing to the files, but ultimately if I specify a category destination, that's where they should end up.

In other words, if Category Destination is empty or the category is unknown, then put them in MoviesDir/SeriesDir/DatedDir as the "guessed" video type dictates. If the appropriate MoviesDir/SeriesDir/DatedDir is empty, then put them in the global DestDir.
hugbug wrote: BTW, I have made other improvements to the script and will post a new version soon.
So would this be good time to bring up another issue I have run into?

There are sometimes tv series that have a name of an earlier series. Examples would be Parenthood, The Newsroom, and The Killing. These are listed in tv databases such as thetvdb.com and tvrage.com as Parenthood 2009, The Newsroom 2012, and The Killing 2011, respectively. Including the year in the folder and file name is important for video jukebox applications to locate the data and artwork for the correct series and episode. VideoSort does not currently include the year. Could it be possible to get that included?

I'm looking forward to the new version and, thanks for all you've done to date!

hugbug
Developer & Admin
Posts: 7426
Joined: 09 Sep 2008, 11:58
Location: Germany

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

Post by hugbug » 29 Aug 2013, 19:20

Version 2.0:
  • new options "TvCategories", "OtherTvDir" and "OtherTvFormat" for TV shows, whose file names look like movies (neither series nor dated shows);
  • new format specifiers "%y", "%decade", "%0decade" for seasoned TV shows;
  • added support for multi episode file names (example: My.Show.S01E02-03.mkv);
  • new option "EpisodeSeparator" to adjust formatting of multi episode file names;
  • added support for DNZB-Header "X-DNZB-UseNZBName";
  • added printing info-message when skipping small files;
  • added using of command "[NZB] FINALDIR" to inform NZBGet about new files location; this path is then shown in the history dialog as "Destination";
  • destination directories (options "MoviesDir", etc.) can be left empty to use global "DestDir" or "CategoryX.DestDir" as destination;
  • updated guessit-library to the newest release - this fixes several issues.
Download link

frolleboy
Posts: 7
Joined: 12 Jun 2013, 06:39

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

Post by frolleboy » 04 Sep 2013, 16:15

Hey there

First, thanks for all the work you are putting into this.

I get the following error when using the script:

INFO Wed Sep 04 2013 16:58:25 VideoSort: SyntaxError: invalid syntax
INFO Wed Sep 04 2013 16:58:25 VideoSort: ^
INFO Wed Sep 04 2013 16:58:25 VideoSort: except Exception as e:
INFO Wed Sep 04 2013 16:58:25 VideoSort: File "/opt/share/nzbget/ppscripts/videosort/VideoSort.py", line 903
INFO Wed Sep 04 2013 16:58:25 VideoSort: /opt/share/nzbget/ppscripts/videosort/VideoSort.py:903: Warning: 'as' will become a reserved keyword in Python 2.6

Cheers

hugbug
Developer & Admin
Posts: 7426
Joined: 09 Sep 2008, 11:58
Location: Germany

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

Post by hugbug » 04 Sep 2013, 16:34

What python version? Probably too old. Try to updating to newer python 2.x. But not Python 3.x.

frolleboy
Posts: 7
Joined: 12 Jun 2013, 06:39

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

Post by frolleboy » 04 Sep 2013, 20:14

I have nzbget installed via ipkg on a Linkstation. I do not thinkg I am able to control which version of python it uses, am I?

hugbug
Developer & Admin
Posts: 7426
Joined: 09 Sep 2008, 11:58
Location: Germany

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

Post by hugbug » 04 Sep 2013, 20:22

I see 6 versions of python in optware repository:

Code: Select all

python24_2.4.6-2_arm.ipk                           13-Feb-2012 04:04             9249433
python25_2.5.6-2_arm.ipk                           14-Feb-2012 06:16            11112324
python26_2.6.8-1_arm.ipk                           12-Apr-2012 12:40            13994112
python27_2.7.3-1_arm.ipk                           12-Apr-2012 12:46            15502415
python3_3.2.3-3_arm.ipk                            30-Oct-2012 10:06            15972319
python_2.5-1_arm.ipk  
Try version 2.7. You may need to uninstall your existing version.

frolleboy
Posts: 7
Joined: 12 Jun 2013, 06:39

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

Post by frolleboy » 05 Sep 2013, 05:54

Thanks! I got it working. Created a symlink:

ln -sf /opt/bin/python2.7 /opt/bin/python

Cheers

frolleboy
Posts: 7
Joined: 12 Jun 2013, 06:39

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

Post by frolleboy » 06 Sep 2013, 05:28

Hello again :)

I have a suggestion. Let's say you have a serie you fellow. That serie has multiple version of the serie such as CSI, CSI: Miami and CSI: New York. It seems that VideoSort is not able to distinguish between such differences. Would it be possible to add?

Cheers!

EDIT: Okay I was maybe too quick. Its only a problem when New York is written as NY eg.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests