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:
|
else:
|
||||||
return any(c in wanted_cats for c in cats)
|
return any(c in wanted_cats for c in cats)
|
||||||
|
|
||||||
|
H265_MARKERS = {
|
||||||
|
"h265"
|
||||||
|
"h.265"
|
||||||
|
"x265"
|
||||||
|
"x.265"
|
||||||
|
"hevc"
|
||||||
|
}
|
||||||
|
|
||||||
class Filter:
|
class Filter:
|
||||||
def __init__(self, book: bool=False, h265: bool=False, manga: bool=False, video: bool=False):
|
def __init__(self, book: bool=False, h265: bool=False, manga: bool=False, video: bool=False):
|
||||||
self.book = book
|
self.book = book
|
||||||
@@ -186,10 +194,7 @@ class Filter:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def is_h265(t: 'Torrent') -> bool:
|
def is_h265(t: 'Torrent') -> bool:
|
||||||
meta = t.title.lower()
|
return any(tag.upper() in t.title.upper() for tag in H265_MARKERS)
|
||||||
return "h265" in meta \
|
|
||||||
or "x265" in meta \
|
|
||||||
or "HEVC" in meta
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def is_book(t: 'Torrent', default: bool = False) -> bool:
|
def is_book(t: 'Torrent', default: bool = False) -> bool:
|
||||||
|
Reference in New Issue
Block a user