Ignored tags #18
5
ignored_tags copy.json.example
Normal file
5
ignored_tags copy.json.example
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"first":"first",
|
||||||
|
"second":"second",
|
||||||
|
"third":"third"
|
||||||
|
}
|
@ -20,6 +20,8 @@ class Qbt:
|
|||||||
self.config = load(c)
|
self.config = load(c)
|
||||||
w = open('./category-whitelist.json')
|
w = open('./category-whitelist.json')
|
||||||
self.cat_whitelist = load(w)
|
self.cat_whitelist = load(w)
|
||||||
|
tg = open('./ignored_tags.json')
|
||||||
|
self.ignored_tags = load(tg)
|
||||||
# Create the api object
|
# Create the api object
|
||||||
self.qbt_client = qbittorrentapi.Client(
|
self.qbt_client = qbittorrentapi.Client(
|
||||||
host=self.config["host"],
|
host=self.config["host"],
|
||||||
|
7
qlist.py
7
qlist.py
@ -9,6 +9,9 @@ def buildtorlist(self):
|
|||||||
torrent = self.torrentlist.pop()
|
torrent = self.torrentlist.pop()
|
||||||
if self.use_log:
|
if self.use_log:
|
||||||
self.tl.debug(f'["{torrent["name"][0:20]}..."] {torrent["infohash_v1"]}')
|
self.tl.debug(f'["{torrent["name"][0:20]}..."] {torrent["infohash_v1"]}')
|
||||||
|
if isignoredtag(self.ignored_tags.values(),torrent['tags']):
|
||||||
|
self.ignored_counter += 1
|
||||||
|
continue
|
||||||
# if torrent['added_on'] + self.minimum_age >= self.t.time():
|
# if torrent['added_on'] + self.minimum_age >= self.t.time():
|
||||||
if ispreme(torrent['added_on'], self.minimum_age, self.t.time()):
|
if ispreme(torrent['added_on'], self.minimum_age, self.t.time()):
|
||||||
self.preme_tor_counter += 1
|
self.preme_tor_counter += 1
|
||||||
@ -64,3 +67,7 @@ def istagblank(tag):
|
|||||||
if tag == '':
|
if tag == '':
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def isignoredtag(igtags, tortags):
|
||||||
|
for igt in igtags:
|
||||||
|
if igt in tortags:
|
||||||
|
return True
|
@ -1,5 +1,5 @@
|
|||||||
import unittest
|
import unittest
|
||||||
from qlist import ispreme,iscatignored,istrackerblank,isprotectedtracker,isnotprotectedtracker,istagblank
|
from qlist import ispreme,iscatignored,istrackerblank,isprotectedtracker,isnotprotectedtracker,istagblank,isignoredtag
|
||||||
from qprocess import isdownloading,isprotectedunderratio,isoldtor,isprotectedoverratio,isnonprotectedtor
|
from qprocess import isdownloading,isprotectedunderratio,isoldtor,isprotectedoverratio,isnonprotectedtor
|
||||||
|
|
||||||
class TestQbitmaid(unittest.TestCase):
|
class TestQbitmaid(unittest.TestCase):
|
||||||
@ -87,6 +87,12 @@ class TestQbitmaid(unittest.TestCase):
|
|||||||
def test_isnonprotectedtor(self):
|
def test_isnonprotectedtor(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def test_isignoredtag_sanity(self):
|
||||||
|
self.assertTrue(isignoredtag(['a','b','c'], 'first,second,third,a'))
|
||||||
|
|
||||||
|
def test_isignoredtag_sanity(self):
|
||||||
|
self.assertTrue(isignoredtag(['a','b','c'], 'first,second,third,a'))
|
||||||
|
|
||||||
# def test__sanity(self):
|
# def test__sanity(self):
|
||||||
# pass
|
# pass
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user