sane-bt-search: better --h265 filtering
This commit is contained in:
@@ -166,6 +166,14 @@ def is_cat(cats: list[str], wanted_cats: list[str], default: bool = False) -> bo
|
||||
else:
|
||||
return any(c in wanted_cats for c in cats)
|
||||
|
||||
H265_MARKERS = {
|
||||
"h265"
|
||||
"h.265"
|
||||
"x265"
|
||||
"x.265"
|
||||
"hevc"
|
||||
}
|
||||
|
||||
class Filter:
|
||||
def __init__(self, book: bool=False, h265: bool=False, manga: bool=False, video: bool=False):
|
||||
self.book = book
|
||||
@@ -186,10 +194,7 @@ class Filter:
|
||||
|
||||
@staticmethod
|
||||
def is_h265(t: 'Torrent') -> bool:
|
||||
meta = t.title.lower()
|
||||
return "h265" in meta \
|
||||
or "x265" in meta \
|
||||
or "HEVC" in meta
|
||||
return any(tag.upper() in t.title.upper() for tag in H265_MARKERS)
|
||||
|
||||
@staticmethod
|
||||
def is_book(t: 'Torrent', default: bool = False) -> bool:
|
||||
|
Reference in New Issue
Block a user