Skip to content

Instantly share code, notes, and snippets.

@binhex
Created December 27, 2025 21:12
Show Gist options
  • Select an option

  • Save binhex/e21771460a21b541a541dd475e80752d to your computer and use it in GitHub Desktop.

Select an option

Save binhex/e21771460a21b541a541dd475e80752d to your computer and use it in GitHub Desktop.
bitmagnet classifier.yml
$schema: "https://bitmagnet.io/schemas/classifier-0.1.json"
extensions:
emulation:
- nsp
- nsz
- chd
- 3ds
- cia
- wbf
- rvz
- z80
video:
- mkv
- mp4
- avi
- mov
- wmv
- webm
- divx
- mpg
software:
- iso
- gz
- xz
- dll
music:
- mp3
- flac
# extend the default workflow with a custom workflow:
workflows:
custom:
# first run the default workflow:
- run_workflow: default
# define custom workflow
- if_else:
condition: "result.contentType in [contentType.movie, contentType.tv_show, contentType.unknown]"
if_action:
find_match:
- if_else:
condition:
or:
# remove any magnet in the specified content type(s) that contains a torrent filename or basename that matches any of the defined 'banned' keywords
- "torrent.baseName.matches(keywords.banned)"
- "([torrent.baseName] + torrent.files.map(f, f.basePath)).join(' ').matches(keywords.banned)"
if_action: delete
- if_else:
condition: "result.contentType in [contentType.movie, contentType.tv_show]"
if_action:
find_match:
- if_else:
condition:
and:
# remove any magnet in the specified content type(s) that matches the extensions 'video' and is 200 MB or larger and has 2 or more concurrent non ascii characters
- "torrent.files.filter(f, f.extension in extensions.video && f.size > 200*mb).map(f, f.basePath).join(' ').matches('.*[^\x00-\x7F]{2,}.*')"
if_action: delete
- if_else:
condition: "result.contentType in [contentType.unknown, contentType.software, contentType.audiobook, contentType.ebook, contentType.music]"
if_action:
find_match:
- if_else:
condition:
or:
# remove any magnet in the specified content type(s) that contains a torrent filename with any non ascii characters
- "([torrent.baseName] + torrent.files.map(f, f.basePath)).join(' ').matches('.*[^\x00-\x7F].*')"
if_action: delete
- if_else:
condition: "result.contentType in [contentType.unknown, contentType.movie]"
if_action:
find_match:
- if_else:
condition:
or:
# set content type to 'tv_show' in the specified content type(s) for any magnet that matches the regex
- "([torrent.baseName] + torrent.files.map(f, f.basePath)).join(' ').matches(r'.*[sS]\\d{1,2}[eE]\\d{1,2}.*|.*s\\d{2}.*|.*series.*|.*season.*')"
if_action:
set_content_type: tv_show
- if_else:
# tag with 'emulation' any magnet that matches the file extensions defined in 'emulation'
condition: "torrent.files.filter(f, f.extension in extensions.emulation).size() > 0"
if_action:
add_tag: emulation
- if_else:
# set content type to 'software' for any magnet that matches the file extensions defined in 'software'
condition: "torrent.files.filter(f, f.extension in extensions.software).size() > 0"
if_action:
set_content_type: software
- if_else:
# set content type to 'music' for any magnet that matches the file extensions defined in 'music'
condition: "torrent.files.filter(f, f.extension in extensions.music).size() > 0"
if_action:
set_content_type: music
- if_else:
# set content type to 'software' (currently no emulation category) for any magnet that matches the file extensions defined in 'emulation'
condition: "torrent.files.filter(f, f.extension in extensions.emulation).size() > 0"
if_action:
set_content_type: software
- if_else:
condition: "result.contentType in [contentType.unknown]"
if_action:
find_match:
- if_else:
condition:
or:
# remove any magnet in the specified content types that contains any torrent basename
# note this is used instead of 'delete_content_types' 'unknown' as we want to 'set_content_type' such as 'emulation' BEFORE we delete unknown, thus this is the last if_else.
- "torrent.baseName.matches(r'.*')"
if_action: delete
flags:
local_search_enabled: true
apis_enabled: true
tmdb_enabled: true
delete_xxx: true
delete_content_types:
# unwanted
- comic
# ensure xxx is definitely deleted
- xxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment