[Request] Scene Script for Samples, Subs, Proof

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.
Post Reply
PSA9
Posts: 3
Joined: 12 May 2015, 16:07

[Request] Scene Script for Samples, Subs, Proof

Post by PSA9 » 12 May 2015, 16:41

not sure if this is possible in VideoSort and PoisonProcess but if so can someone please tell me how or if there is another script possible of doing such.
When I download a Scene.1080p.x264-MOVIE everything works fine as it puts all the files inside that directory however when its complete and par2 has repaired everything I want the script to sort Proof, Samples, and Subs if they exist to sub directory and end result would be same as if got off an FTP and wouldn't have to manually do each one to look as such

Code: Select all

Complete/Scene.1080p.x264-MOVIE/Proof/proof.file.jpg
Complete/Scene.1080p.x264-MOVIE/Sample/sample.file.mkv
Complete/Scene.1080p.x264-MOVIE/Subs/Subs.file.rar
Complete/Scene.1080p.x264-MOVIE/Subs/Subs.file.sfv
Complete/Scene.1080p.x264-MOVIE/file.nfo
Complete/Scene.1080p.x264-MOVIE/file.rar
Complete/Scene.1080p.x264-MOVIE/file.r00
Complete/Scene.1080p.x264-MOVIE/file.r01
Complete/Scene.1080p.x264-MOVIE/file.sfv
For the ones that will say proof and samples are not needed just keep your noob comments to yourself.

kloaknet
Posts: 335
Joined: 23 Jul 2014, 08:52

Re: Scene Script for Samples, Subs, Proof

Post by kloaknet » 14 May 2015, 09:28

PSA9 wrote:...For the ones that will say proof and samples are not needed just keep your noob comments to yourself.
It aint reddit overhere ;), and I guess hugbug may will even add the feature to videosort, because I think something like your idea would be a great addition.

In video sort that option isnt there but after a quick look it doesn't look that difficult for a quick fix. Not sure if you got a bit of knowledge of python, but what you could do is go to line 501 in the latest VideoSort.py script:

Code: Select all

def cleanup_download_dir():
    """ Remove the download directory if it (or any subfodler) does not contain "important" files
        (important = size >= min_size)
    """
    if verbose:
        print('Cleanup')

    # Check if there are any big files remaining
    for root, dirs, files in os.walk(download_dir):
        for filename in files:
            path = os.path.join(root, filename)
            # Check minimum file size             
            if os.path.getsize(path) >= min_size and (not preview or path not in moved_src_files):
                print('[WARNING] Skipping clean up due to large files remaining in the directory')
                return

    # Now delete all files with nice logging                
    for root, dirs, files in os.walk(download_dir):
        for filename in files:
            path = os.path.join(root, filename)
            if not preview or path not in moved_src_files:
                if not preview:
                    os.remove(path)                                    <--- insert some code overhere instead of deleting, go for 
                print('[INFO] Deleted: %s' % path)
    if not preview:
        shutil.rmtree(download_dir)
    print('[INFO] Deleted: %s' % download_dir)
and create sub folders for sample, subs, proof, and simply move the files there. But for the subs part, I think it will be hard to move them towards the sub folder, because they often don't have a tag like 'sub' in the .rar archive with the sub file. :(

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests