DupeCheck ignore case?

Get help, report and discuss bugs.
Post Reply
judhat
Posts: 13
Joined: 28 Sep 2015, 05:38

DupeCheck ignore case?

Post by judhat » 31 Oct 2017, 18:35

Is there an option to allow DupeCheck to ignore the case of an nzb? I often use nzbhydra to search all indexers at once. Because of DMCA, I'll sometimes search for an nzb, add all of the nzbs with the same title to nzbget, and just let nzbget try each one until one is successful. However, it seems that nzbget only thinks an nzb can be a dupe if the case is the same.

For example, these titles weren't recognized as duplicates:
name.s01e07.720p.web.x264-strife
Name.S01E07.720p.WEB.x264-STRiFE
Name.S01E07.720p.web.x264-strife

Is this intended behavior?

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

Re: DupeCheck ignore case?

Post by hugbug » 31 Oct 2017, 18:45

That indeed make sense. I'll make it case insensitive.

If you can't wait, in the current version it's possible to use a scan-script to set dupekey from lowercase of nzb-name. If you want give it a try I could give you more hints.

judhat
Posts: 13
Joined: 28 Sep 2015, 05:38

Re: DupeCheck ignore case?

Post by judhat » 31 Oct 2017, 19:15

Great! I'll look forward to the update.

The scan script sounds interesting. Can you point me in the right direction?

Thanks!

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

Re: DupeCheck ignore case?

Post by hugbug » 31 Oct 2017, 21:09

What you need in your script:
  • read nzb-name from os.environ['NZBNP_NZBNAME'];
  • make it lower-case and print it with command like:

    Code: Select all

    print('[NZB] DUPEKEY=Show.Name.S01E22')
  • do that however only if os.environ['NZBNP_DUPEKEY'] is empty (to not overwrite dupekey if it's already set).

Here is an example scan-script which doesn't do all that but demonstrates how the things work:

Code: Select all

#!/usr/bin/env python

##############################################################################
### NZBGET SCAN SCRIPT                                                     ###

# Disable unpack for certain categories.
#
# NOTE: This script requires Python to be installed on your system.

##############################################################################
### OPTIONS                                                       ###

# Comma separated list of categories to disable unpack for.
#NonUnpackCategories=Games,Books

### NZBGET SCAN SCRIPT                                                     ###
##############################################################################


import os
import sys

# Check if the script is called from nzbget as scan-script
if not 'NZBNP_CATEGORY' in os.environ:
	print('*** NZBGet scan script ***')
	print('This script is supposed to be called from nzbget (13.0 or later).')
	sys.exit(1)

NonUnpackCategories=os.environ.get('NZBPO_NONUNPACKCATEGORIES');
print('[DEBUG] Category: <%s>' % os.environ['NZBNP_CATEGORY'])
print('[DEBUG] NonUnpackCategories: %s' % NonUnpackCategories)

NonUnpackCategories=NonUnpackCategories.lower().split(',')
print('[DEBUG] NonUnpackCategories: %s' % NonUnpackCategories)

if (os.environ['NZBNP_CATEGORY'].lower() in NonUnpackCategories):
	print('[INFO] Disabling Unpack for %s' % os.environ['NZBNP_NZBNAME'])
	print('[NZB] NZBPR_*Unpack:=no')

print('[INFO] DupeKey: <%s>' % os.environ['NZBNP_DUPEKEY'])
print('[INFO] DupeMode: <%s>' % os.environ['NZBNP_DUPEMODE'])
print('[INFO] DupeScore: <%s>' % os.environ['NZBNP_DUPESCORE'])

#print('[INFO] Setting dupe properties')
#print('[NZB] DUPEKEY=Show.Name.S01E22')
#print('[NZB] DUPEMODE=FORCE')
#print('[NZB] DUPESCORE=102')

print('[DETAIL] Exiting')

# All OK
sys.exit(0)
If you need more help please post what you got so far and we'll make it work together.

judhat
Posts: 13
Joined: 28 Sep 2015, 05:38

Re: DupeCheck ignore case?

Post by judhat » 01 Nov 2017, 16:55

My script isn't working. It looks like it isn't being called, as I don't see any info about it in the nzbs' log. I can see it in nzbget's settings, and I enabled it in the category extensions. Do you see anything wrong?

Code: Select all

#!/bin/bash

##############################################################################
### NZBGET SCAN SCRIPT                                                     ###

# Set the dupekey to the lowercase nzb-name.
#
#

### NZBGET SCAN SCRIPT                                                     ###
##############################################################################

[ $NZBNP_DUPEKEY ] && exit 93

echo "[NZB] DUPEKEY=${NZBNP_NZBNAME,,}" && exit 93 || exit 94

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

Re: DupeCheck ignore case?

Post by hugbug » 01 Nov 2017, 17:08

You should see message "Executing scan-script xx" on messages tab.
If it's set to category it is executed only if the nzb-file has category the moment it's added. Is this the case?
At best for a test try setting this script into global option "Extensions".

judhat
Posts: 13
Joined: 28 Sep 2015, 05:38

Re: DupeCheck ignore case?

Post by judhat » 01 Nov 2017, 17:32

It's working now. I had a typo in the script. I corrected it in my previous message, posted it, then corrected my script on my server. I should have checked again before I posted. Anyways, those previous nzbs are now being detected as duplicates. Thanks for the tip about the scan script!

Post Reply

Who is online

Users browsing this forum: No registered users and 49 guests