Page 1 of 9

[Python] rescepy - automated ReScene reconstruction.

Posted: May 10th, 2009, 11:43 am
by sweetie
Hi again.


rescepy (formerly SceneSort) is a cross-platform Python script for automated ReScene reconstruction.


https://github.com/dryes/rescepy


* Zero user intervention required - entirely automated.
* Grabs the latest srrs from srrdb.com.
* Option to process samples only.

## dependencies:

* Python3 - http://www.python.org/
* ReScene - http://www.srrdb.com/software.php
* ReSample - http://www.srrdb.com/software.php
* UnRAR - http://www.rarlab.com/
* cfv - http://cfv.sourceforge.net/


## usage:

* Simply download, retaining directory structure, and run resce.py (-h for help).
* By default the srr is saved inside the release directory - this can be changed with the '--srr-dir' option.


## notes:

* If rars exist without passing '-f' (force), the directory structure may be disrupted - run Goober's Awescript with: '--no-srr --no-srs' to remedy this.
* *nix users: it is assumed that you have created scripts in /usr/bin/ to call: mono /path/to/srr.exe
* Windows users: ensure all dependencies are included in your PATH.
* Releases determined to be fixes (eg. DiRFiX, SUBFiX, etc.) or non-video are skipped.



(everything below dated < 4th May 2012 is no longer relevant.)

Re: [Linux - Bash] SceneSort scripts.

Posted: May 11th, 2009, 4:24 am
by knatsch
Nice scripts! I had no clue how to write a working CD1/CD2 skript :)

Re: [Linux - Bash] SceneSort scripts. [v2]

Posted: June 25th, 2009, 5:17 pm
by sweetie
UPDATE: 25/6/09

Sorry for bump, but post is brand new!

[Linux/OSX - Bash] scenesort script. [v3 - AIO post-post-processor.]

Posted: June 26th, 2009, 7:10 am
by sweetie
all posts below regarding MKV2M2TS, dated <21st Nov. 2009, are no longer of relevence.

[Linux - Bash] NoArchive scripts - MKV to M2TS and AVI join.

Posted: July 14th, 2009, 4:46 pm
by sweetie
EDIT: Updated first post instead, sorry for bump.

Re: [Linux - Bash] SceneSort scripts. [v2]

Posted: July 29th, 2009, 4:30 pm
by Jesus
Would love to see the Verify, ReScene, and Subs / extra / Samples scripts converted to batch or perl for people who run sabnzbd on a windows box.

ReScene seems like a great idea!

Re: [Linux - Bash] SceneSort scripts. [v2]

Posted: July 30th, 2009, 2:30 am
by TeraLove
Yes, it would be nicer to have platform-independent scripts, such as maybe in Python, etc.

Windows batch really would be terrible.

Re: [Linux - Bash] SceneSort scripts. [v2]

Posted: July 31st, 2009, 12:02 pm
by sweetie
Well, ideally they'd be in Python (multi-platform), but, what you see above really is the extent of my scripting/coding knowledge. (learned from scratch as I was writing them.)

Anyone and everyone is welcome to post multi-plat. rewrites - (if you beat me to it.) I'll start with the basics (subs/sample/extras) and work from there, don't expect them to be posted too soon though. :)

Re: [Linux - Bash] SceneSort scripts. [v2]

Posted: August 22nd, 2009, 5:15 pm
by Jesus
I created a Subs, Extras, NFO (and sfv) script that will automatically make Subs, Extras, Sample, or NFO directories if needed and move the respective files to them.

Its in python, and although I tested it it may mess up.  This is my first python script so it is probably horribly inefficient and stupid but it seemed to work when I tested it so.

It was created on a windows platform but I believe the os.path calls should work for linux too but I really don't know.

Code: Select all

import os
import string
import re
import shutil
import sys

#source = "C:\python26\"

scriptHome = os.path.abspath(os.path.join(os.path.dirname(sys.argv[1]),sys.argv[2]))
subtitle = os.path.join(scriptHome,"Subtitle")
nfo = os.path.join(scriptHome,"NFO")
extras = os.path.join(scriptHome,"Extras")
sample = os.path.join(scriptHome,"Sample")

for object in os.listdir(scriptHome):
        print object
	extension = object[-4:]
	path = os.path.join(scriptHome,object)
	if re.search(".idx",extension) or re.search(".sub",extension) or re.search(".rar",extension) and re.search("sub",object):
		if os.path.isdir(subtitle):
			shutil.move(path,subtitle)
		else:
			os.mkdir(subtitle)
			shutil.move(path,subtitle)
	if re.search("sample",object) and re.search(".avi",extension) or re.search(".srs",extension) or re.search("sample",object) and re.search(".mkv",extension):
		if os.path.isdir(sample):
			shutil.move(path,sample)
		else:
			os.mkdir(sample)
			shutil.move(path,sample)
	if re.search("extras",object) and re.search(".avi",extension) or re.search("extras",object) and re.search(".mkv",extension):
		if os.path.isdir(extras):
			shutil.move(path,extras)
		else:
			os.mkdir(extras)
			shutil.move(path,extras)
	if re.search(".nfo",extension) or re.search(".sfv",extension):
		if os.path.isdir(nfo):
			shutil.move(path,nfo)
		else:
			os.mkdir(nfo)
			shutil.move(path,nfo)

Re: [Linux - Bash] SceneSort scripts. [v2]

Posted: August 22nd, 2009, 6:21 pm
by sweetie
Oh awesome.

I'll scrunitise it sometime tomorrow and update the first post. :D



Meanwhile, adding another (bash,sorry) ReScene script. This one really is intended as a standalone, though you could have it as post-proc. if you were overly paranoid I suppose. ;p

Entirely automated RAR rebuild. (Even downloads the flippin' SRR - (database is currently x264 only.))

I call it that.

Re: [Linux - Bash] NoArchive scripts - MKV to M2TS and AVI join.

Posted: September 14th, 2009, 11:07 am
by stabu
How do i install this?

Re: [Linux - Bash] NoArchive scripts - MKV to M2TS and AVI join.

Posted: September 14th, 2009, 4:24 pm
by sweetie
HOWTO now in original post.

Re: [Linux - Bash] NoArchive scripts - MKV to M2TS and AVI join.

Posted: September 14th, 2009, 5:07 pm
by stabu
nice, thanks

Correction: Replace tsMuxer variable in the second script with 'tsMuxeR'. (or location if not /usr/bin)

its case sensitive.

Re: [Linux - Bash] NoArchive scripts - MKV to M2TS and AVI join.

Posted: September 15th, 2009, 12:20 pm
by stabu
everything was working last night but now i get
/home/crc/NZB/Scripts/mkv2m2ts: line 38: [: too many arguments thats with a  bluray x264 rip with DTS audio

and i just got this. this was a bluray rip x264 non dts
External processing by /home/crc/NZB/Scripts/noarchive-tv:
removed `rls.nfo'
removed `rls.sfv'
removed `rls.srr'
removed `/tmp/tmp.skXWISzYoo'
removed `/tmp/tmp.CrzexRiqzT'
SmartLabs tsMuxeR.  Version 1.10.6  http://www.smlabs.net
Can't find ttf file for font Arial
removed `xxx.x246.rls.name.here.mkv.meta'
mv: cannot stat `xxx.x246.rls.name.here-1.m2ts': No such file or directory
mv: cannot stat `*.m2ts': No such file or directory



HDTV shows seem to work. I only got one bluray x264 rip to work.

Re: [Linux - Bash] NoArchive scripts - MKV to M2TS and AVI join.

Posted: September 16th, 2009, 11:17 am
by sweetie
stabu wrote: everything was working last night but now i get
/home/crc/NZB/Scripts/mkv2m2ts: line 38: [: too many arguments thats with a  bluray x264 rip with DTS audio

and i just got this. this was a bluray rip x264 non dts
External processing by /home/crc/NZB/Scripts/noarchive-tv:
removed `rls.nfo'
removed `rls.sfv'
removed `rls.srr'
removed `/tmp/tmp.skXWISzYoo'
removed `/tmp/tmp.CrzexRiqzT'
SmartLabs tsMuxeR.  Version 1.10.6  http://www.smlabs.net
Can't find ttf file for font Arial
removed `xxx.x246.rls.name.here.mkv.meta'
mv: cannot stat `xxx.x246.rls.name.here-1.m2ts': No such file or directory
mv: cannot stat `*.m2ts': No such file or directory



HDTV shows seem to work. I only got one bluray x264 rip to work.
I'm not entirely sure on the first problem, try the following in a backup script:

Replace lines 38 to 42 with:

Code: Select all

	#if [ $VIDEO_ID -lt $AUDIO_ID ]; then
	    VIDEO_FPS=`grep "Frame rate" ${MKV_INFO} | sed -n 1p | cut -d'(' -f2 | cut -d' ' -f1`
	#else
	    #VIDEO_FPS=`grep "Frame rate" ${MKV_INFO} | sed -n 2p | cut -d'(' -f2 | cut -d' ' -f1`
	#fi
If the above fails, comment out the first VIDEO_FPS, and uncomment second. (remove # symbol.)


The second error seems to be a missing font, it's unlikely the HDTV rips will have subs, hence why it only seems to work with those. Try another font (variable at start of second script) and report back.