ThePornDatabase / namer

Renames adult video files so that the plex/jellyfin plugins and stash script will match without user input. Runs server or command mode.
https://theporndb.net
182 stars 29 forks source link

Manual Matching #202

Closed RickSan77 closed 1 year ago

RickSan77 commented 1 year ago

Good afternoon,

I am having issues with automatic matching. I am having a 100% fail in matching, and having to manually match each file, so it is likely something on my end not configured correctly. Here are some of the details for my setup and config file:

Setup:

Here is the config file variables as they currently stand:

[namer]

token to access porndb.

sign up here: https://metadataapi.net/register

porndb_token = [the key I generated with my account I have used here]

You should likely never edit this, unless you know regex really well and wont ask for help when you mess up.

Seriously don't edit it.

name_parser = {_site}{_sep}{_optional_date}{_ts}{_name}{_dot}{_ext}

How to write output file name. When namer.py is run this is applied in place

(next to the file to be processed).

If you are running watchdog see new_relative_path_name in the watchdog section.

#

Supports stand python 3 formatting, as well as:

* a prefix:

{site: 1p} - in this case put one space in front of the 'site', so ' Vixen'

* a suffix:

{date:1s} - in this case put one underscore after the 'date', so '2020-01-01'

* an infix:

{date:_2i} - in this case put two underscore before and after the 'date', so '2020-01-01'

#

Examples:

* {site} - {date} - {scene}.{ext}

* {site}/{date}.{scene}.{ext}

#

Missing values will be ignored.

#

Allowed replacements:

#

* 'date' - in the format of YYYY-MM-DD.

* 'year' - just the year of the scene/movie.

* 'description' - too long, don't use in a name.

* 'name' - the scene/movie name

* 'site' - the site or studio name, BrazzersExxtra, AllHerLuv, Deeper, etc with spaces removed.

* 'full_site' - the full site/studio name from porndb, unmodified, i.e: Brazzers Exxtra, All Her Luv, etc.

* 'performers' - space seperated list of female performers

* 'all_performers' - space seperated list of all performers

* 'act' - an act, parsed from original file name, don't use.

* 'ext' - original file's extension, you should keep this.

* 'trans' - 'TS', or 'ts' if detected in original file name.

* 'type' - "movie" or "scene" depending on tpdb api used to find the metadata (/scenes or /movies)

* 'resolution' - 480p, 720p, 1080p, 4k, or any other integer

* 'vr', is the studio is a known vr studio, 'vr', else '', can be used for folder names, like ../adult{vr}/..

#

This should not contain paths, as files will be processed in place when called on the command line from namer.

#

Also note that jinja2 filters are support:

https://jinja.palletsprojects.com/en/3.1.x/templates/#list-of-builtin-filters

Like {site:|lower} or {name:|title|replace(' ', '.'))}

inplace_name={site} - {date} - {name}.{ext}

If a directory name is to be preferred over a file name.

Directories are calculated by taking the first part of a relative path

to the watch_dir location, or as input to namer via -d parameter.

prefer_dir_name_if_available = True

minimum file size to process in MB, ignored if a file is to be processed

min_file_size = 300

Should namer's comparison log be written next to successfully moved videos.

write_namer_log = False

Should namer's comparison log be written next to failed videos.

write_namer_failed_log = True

Comma separated list of extensions for namer to process (in order of preference in case multiple types exist in a target directory)

Case insensitive, Only mp4 supports tagging.

target_extensions = mp4,mkv,avi,mov,flv

Should new and moved files have permissions and ownership set.

update_permissions_ownership = True

Settings for new/moved files/dirs.

set_dir_permissions = 775 set_file_permissions = 664

Setting uid and groupid for new and moved files.

Use the id numbers, not names. Defaults to process uid/gid in non windows systems.

set_uid = set_gid =

If you want the trailers downloaded set the value relative to the final location of the movie file here.

Currently assumes directory per video, and doesn't work in vast majority of cases (cdns with caches busted,

expired view tokens, etc.)

Plex: Trailers/trailer.{ext}, or extras/Trailer-trailer.{ext}

Jellyfin: trailer/trailer.{ext}

Extensions are handled by the download's mime type.

Leave empty to not download trailers.

trailer_location =

Comma seperated list of sites whose date information in tpdb is known to be sketchy at best as the

values are set to the scrape time, not the video release date.

sites_with_no_date_info =

Comma seperated list of sites/studios whose Sites/Studios where namer will prefer matching movies

instead of scenes as default behavior

will also switch the type flag from 'movie' to 'scene'.

movie_data_preferred = missax

Comma seperated list of vr studios, this will be used to set the vr name flag.

vr_studios = 18 VR,Babe VR,Badoink VR,Dorm Room,Kink VR,Real VR,RealJamVR,Sex Like Real,SexBabesVR,SinsVR,SLR Originals,Swallowbay,Virtual Taboo,VirtualRealPorn,VR Bangers,VR Cosplay X,VR Hush,VRConk,VRedging,Wankz VR

a set of tags that indicates an individual video is vr.

vr_tags = virtual reality, vr porn

Site abbreviations are short strings converted to longer strings in the site section of a parse file name.

Useful to match files whose names include the abbreviations rather than full site names.

A one line json string that should be a map.

site_abbreviations = {"bex" : "BrazzersExxtra", "ps": "PropertySex"}

When guessing at matches namer can use performer names to attempt to match. This can be costly in terms of cpu time.

Plus who lists all the performers if over 6 on a scene's name? You can increase this, but the cpu/runtime cost increases

rapidly (combinatorial)

max_performer_names = 6

Cache http requests

use_requests_cache = True

Amount of minutes that http request would be in cache

requests_cache_expire_minutes = 10

Leave this unset unless you are testing a new tpdb endpoint.

override_tpdb_address =

[Phash]

Calculate and use phashes in search for matches

search_phash = True

If there is a phash match, require any name match be in the top N results

require_match_phash_top = 3

If true will push phash match metadata back upstream.

send_phash_of_matches_to_tpdb = False

[metadata]

Currently metadata pulled from the porndb can be added to mp4 files or .nfo files.

MP4 metadata will be read in fully by Plex, and Apple TV app, partially by Jellyfin (no artist support).

Metadata includes, Title, Release Date, Scene Name, Artist, Source URL, XXX Movie rating.

If a file is not an mp4 adding metadata at this time isn't supported.

.nfo files are supported by a number of players, though some require plugins.

Write an nfo file next to the directory in an emby/jellyfin readable format

write_nfo = False

Should metadata fetched from the porn db be written in to the metadata of the mp4.

enabled_tagging = True

Should the poster fetched from the porn db be written in to the metadata of the mp4.

This poster will be displayed in Plex, Jellyfin and Apple TV app.

Controls downloading of images for .nfo and mp4 tagging.

enabled_poster = True

These genres are noisey and not recommend for use. If this is false a single default

genre will be used. These are called Tags on the porndb json response objects, genre's

in plex/jellyfin - and could be added as Tags to jellyfin. Unfortunately jellyfin doesn't

support searching tags, so tpdb jellyfin plugin writes tags to genres, this flag will

mirror that behavior for mp4s and .nfo files. It does appear jellyfin will get tag filtering

in the 10.8 release due to a few prs out there.

enable_metadataapi_genres = False

If genre's are not copied this is the default genre added to files.

Default value is adult.

default_genre = Adult

if language is set it will be used to select the default audio stream in an mp4 that has too many default stream

to play correct in quicktime/apple tv. If the language isn't found or is already the only default no action is

taken, no streams (audio/video) are re-encoded. See: https://iso639-3.sil.org/code_tables/639/data/

language = eng

[duplicates]

If this is set to false duplicates will be discarded, and a rough selection criteria can be configured below

to select the retained video

preserve_duplicates = True

If set to -1, no max resolution is set. Others selecting 720, 1080, 2160, 4380, etc will limit retained videos

to the desired resolution. If a too large video is the only one available it will be retained. Defautls to 4380

max_desired_resolutions = -1

The codecs in order that you want to retain.

by default hevc is preferred to h264, which is preferred vs everything else.

desired_codec = hevc, h264

[watchdog]

If the file path found by watcher matches this regex, it will not trigger processing.

ignored_dir_regex = .UNPACK.

when processing a directory should other files be removed.

to keep other files this must be false and new_relative_path_name must contain a directory split, "/"

del_other_files = False

After a video has appeared in the watch dir, an extra number of seconds to wait to allow the

copying or unzipping of other files in to that directory. Prevents leaving orphaned files in dirs with

with no movies of you have del_other_files set to True.

extra_sleep_time = 30

Configured like inplace_name above, but with paths, and is relative to

dest_dir, which is where completed files will be moved to.

new_relative_path_name={site} - {date} - {name}/{site} - {date} - {name}.{ext}

director where new downloads go.

watch_dir = H:\Namer Folders\New Files

temporary directory where work is done.

a log file shows attempted matches and match closeness.

work_dir = H:\Namer Folders\Processing

Should processing fail the file or directory is moved here.

retries occur every 12 hours. Files can be manually moved to watch-dir

to force reprocessing.

failed_dir = H:\Namer Folders\Failed

dir where finalized files get written.

dest_dir = H:\Namer Folders\Completed

When to retry failed items, default is a random minute during the 3 am hour in your timezone.

retry_time =

Run webserver while running watchdog.

web = True

port to run on

port = 6980

target host

host = 0.0.0.0

webroot (root url to place pages), useful for reverse proxies

web_root =

Allow to delete files in web interface

allow_delete_files = False

Add maximal percent from failed log to table in web interface

add_max_percent_column = True

Set logger level to debug

debug = True

Errors may be raised by the program, and when they are loguru may be used to help explain them, showing

values in the stack trace, potentially including the porndb token, this setting should only be turned on

if you are going to check an logs you share for your token.

diagnose_errors = True


Thanks in advance for your insights on getting this up and running without doing a manual match for each file!

4c0d3r commented 1 year ago

The problem you're seeing occurs because of data in tpdb, if two possible matches exist - either via name, phash, or both, you have to select a match yourself. There is no way around this currently and that is by design. Take a look at the matching section in the readme for more info on this.