Code Monkey home page Code Monkey logo

sabnzbd_srrdb's Introduction

sabnzbd_srrdb

A simple Python post-processing script for SABnzbd to interact with pyrescene and the SRRdb API.

Features:

  • Use an srr file to rename the release file to the correct filename. I believe this is better deobfuscation than renaming the file to SAB_FILENAME.ext.

  • Extract the contents of the srr file to provide missing nfo, m3u, sfv and jpg files.

  • Use rescene to verify (srr.py -q) if the scene file(s) matches the correct crc32 according to srr or sfv.

  • Delete video samples e.g. group-movie-1080p-sample.mkv

Installation:

This script depends on pyrescene.

To install with pip:

# pip3 install pyrescene
OR
# pip3 install -r sabnzbd_srrdb/requirements.txt

Alternatively, download pyReScene-0.7.tar.gz and place the pyReScene-0.7/rescene and pyReScene-0.7/resample directories next to this script. e.g.

$ tree -L 1
.
├── README.md
├── SABnzbd_SRRdb.py
├── requirements.txt
├── resample
└── rescene

2 directories, 3 files

Examples

Movie:

Directory name: Big.Buck.Bunny.2008.DTS.1080p.BluRay.x264-DARM
No srr file found from release, attempting to fetch from srrdb...
SRRdb release identified by name, downloading srr...
darm-bigbuckbunny-1080p.nfo: extracted!
darm-bigbuckbunny-1080p.sfv: extracted!
Renaming abcd1234.mkv to darm-bigbuckbunny-1080p.mkv.
File OK: darm-bigbuckbunny-1080p.mkv.

Music (FLAC or MP3):

Directory name: Arist_Name-Album_Name-CD-FLAC-0000-FOOBAR
No srr file found from release, attempting to fetch from srrdb...
SRRdb release identified by name, downloading srr...
Extracting contents of srr file...
00-artist_name-album_name-cd-flac-0000.nfo: extracted!
00-artist_name-album_name-cd-flac-0000-proof.jpg: extracted!
00-artist_name-album_name-cd-flac-0000.m3u: extracted!
00-artist_name-album_name-cd-flac-0000.sfv: extracted!
01-artist_name-track_name.flac OK
02-artist_name-track_name.flac OK
03-artist_name-track_name.flac OK
04-artist_name-track_name.flac OK
05-artist_name-track_name.flac OK
06-artist_name-track_name.flac OK
07-artist_name-track_name.flac OK
08-artist_name-track_name.flac OK
09-artist_name-track_name.flac OK
10-artist_name-track_name.flac OK
11-artist_name-track_name.flac OK
Everything OK

Game/Software (iso):

Directory name: Name_Of_A_Game-Group
No srr file found from release, attempting to fetch from srrdb...
SRRdb release identified by name, downloading srr...
grp-game.nfo: extracted!
grp-game.sfv: extracted!
File OK: grp-game.iso.

How do I know if a release is 'scene' when searching?!

If your indexer supports it you can filter non predb releases on their website, or thanks to this feature in nzbhydra2 you can return only scene releases. Otherwise, use a public predb website or more obviously SRRdb itself.

How can I use this script outside of SABnzbd?

/path/to/location/of/SABnzbd_SRRdb.py "/path/to/a/release"

How can I configure the script's behavior?

For now, and until someone suggests a better way, find the main function and edit the following:

  • remove_valid_srr (False) Deletes the srr file after succesfully verifying the release.

  • remove_samples (True) Attempts to identify and remove video samples.

    • remove_srs (True) The extracted srs file used to identify the sample file is also removed.
  • archive_nzb (True) Store a copy of the NZB file in the release directory. E.g. if disk space is limited, you can delete the media and keep the nzb to re-download it again in the future.

  • move_albums (False) For non archived releases (music), create a directory for the artist and move the album into it as a subdirectory.

This script is unreliable!!!

This program comes with ABSOLUTELY NO WARRANTY.

sabnzbd_srrdb's People

Contributors

neofright avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

sabnzbd_srrdb's Issues

Season packs are unsupported

Make sure that the script does not treat a multi season nzb as a single episode.

Currently the script will incorrectly rename the largest file in the season pack.

The best way to handle this is probably with a regex to abort post-processing if '\.S[0-9]*' is matched but not '\.S[0-9]*E[0-9]*\.' etc.

Allow credentials for SRRdb

Consider using pyenv to supply credentials for SRRdb. AFAIK the unregistered API limit is 100 calls per 24hrs.

remove SRR file after verification

The title says it all - I think it's redundant to keep the SRR file after use. Maybe it could be an option?

And by the way, thanks for making this script!

Indexers with pred=1?

Any chance you could share a name of a indexer that supports the &pred=1 extended attribute, or is that a sensitive subject?

I looked at a few popular ones but unfortunately haven't been able to find a indexer that supports it.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.