- updated library babelfish used by guessit; this fixes a rare error regarding unicode characters.
Has this ever been simplified? I understand that I can use listgroups to get the FinalDir, but is there any way to get the "FinalName" other than patching VideoSort?minimeh wrote:I encountered a similar need to get the final filenames. My solution was to patch VideoSort.py. In the latest version of VideoSort.py, I replace (starting at line 1052):minamhere wrote:I am trying to create a post processing script that will run after VideoSort. I want to copy the resulting file to a secondary location.
Is there a way to determine the final filename (or final path) after VideoSort renames and moves it? I know I can get FINALDIR, but I can't figure out how to get the final filename.withCode: Select all
# Inform NZBGet about new destination path finaldir = '' uniquedirs = [] for filename in moved_dst_files: dir = os.path.dirname(filename) if dir not in uniquedirs: uniquedirs.append(dir) finaldir += '|' if finaldir != '' else '' finaldir += dir if finaldir != '': print('[NZB] FINALDIR=%s' % finaldir)
Notice that this collects the final filenames minus the extension. That way, I can readily find the media file and its satellites such as subtitles files.Code: Select all
# Inform NZBGet about new destination path finaldir = '' uniquedirs = [] unique_names = set() for filename in moved_dst_files: dir = os.path.dirname(filename) if dir not in uniquedirs: uniquedirs.append(dir) finaldir += '|' if finaldir != '' else '' finaldir += dir # Strip off the extension path = os.path.splitext(filename)[0] # Add the base name to the set. This is a no-op if the base name already exists unique_names.add(os.path.split(path)[1]) finalnames = '' for filename in unique_names: if len(finalnames) == 0: finalnames = filename else: finalnames += "|%s" % filename if finaldir != '': print('[NZB] FINALDIR=%s' % finaldir) if len(finalnames) > 0: print('[NZB] NZBPR_FINALENAMES=%s' % finalnames)
In my pp script that uses the final filenames, I have something like thisWhenever a new VideoSort.py is released, I use a merge tool to patch it. Not ideal, but it works for me.Code: Select all
finaldirectory = os.environ.get('NZBPP_FINALDIR', '') if len(finaldirectory) == 0: print('[INFO] No final directories passed to this post process script.') sys.exit(POSTPROCESS_NONE) finaldirectories = finaldirectory.split('|') finalname = os.environ.get('NZBPR_FINALENAMES', '') if len(finalname) == 0: print('[INFO] No final file names passed to this post process script.') sys.exit(POSTPROCESS_NONE) finalnames = finalname.split('|') for finaldirectory in finaldirectories: if DEBUG: print "finaldirectory = \"%s\"" % finaldirectory if os.path.exists(finaldirectory): for finalname in finalnames: if DEBUG: print "finalname = \"%s\"" % finalname
Please activate option Verbose on VideoSort and post the logging of the script after processing of a such release.davyjones wrote:Just wondering if anyone knows how to set up these rules using the VideoSort script in NZBGet? Currently these words are dropping off the title for some reason. Thanks in advance for the help!
They are usually just numbered for example:hugbug wrote:What is UFC, few examples of how titles look like?
Actually, I realized Plex has a problem if these words are left in the title so I think I will just ignore them. Thanks anyway!hugbug wrote:Please activate option Verbose on VideoSort and post the logging of the script after processing of a such release.davyjones wrote:Just wondering if anyone knows how to set up these rules using the VideoSort script in NZBGet? Currently these words are dropping off the title for some reason. Thanks in advance for the help!
Code: Select all
MoviesFormat=%t (%y)/%t
Users browsing this forum: No registered users and 35 guests