#34 added tracker data to dragnet
This commit is contained in:
parent
1a5aee5272
commit
07aed161eb
@ -30,7 +30,7 @@ def tor_processor(self):
|
||||
self.tl.info(f'Submitted ["{canidate["name"][0:20]}..."] for deletion.')
|
||||
else:
|
||||
if self.enable_dragnet:
|
||||
dragnet(self.cv,self.dragnet_outfile,canidate['state'],canidate['ratio'],canidate["tags"],canidate['added_on'],self.age,self.t.time(),canidate['infohash_v1'],canidate["name"][0:20])
|
||||
dragnet(self.cv,self.dragnet_outfile,canidate['state'],canidate['ratio'],canidate["tags"],canidate['added_on'],self.age,self.t.time(),canidate['infohash_v1'],canidate["name"][0:20],canidate['tracker'])
|
||||
self.tl.info(f'["{canidate["name"][0:20]}..."] is orphaned.')
|
||||
self.up_tor_counter += 1
|
||||
continue
|
||||
@ -68,9 +68,9 @@ def is_not_protected_tor(setnonprotectedtag, tortags):
|
||||
if setnonprotectedtag in tortags:
|
||||
return True
|
||||
|
||||
def dragnet(csv_obj,outfile,state,ratio,tags,added,age,time,thash,tname):
|
||||
header = ['state','ratio','tags','added','age','time','thash','tname']
|
||||
row = [state,ratio,tags,added,age,time,thash,tname]
|
||||
def dragnet(csv_obj,outfile,state,ratio,tags,added,age,time,thash,tname,trname):
|
||||
header = ['state','ratio','tags','added','age','time','thash','tname','trname']
|
||||
row = [state,ratio,tags,added,age,time,thash,tname,trname]
|
||||
with open(outfile, 'a+', encoding='UTF8', newline='') as f:
|
||||
writer = csv_obj.writer(f)
|
||||
if f.tell() == 0:
|
||||
|
@ -14,7 +14,8 @@ class TestDragnet(unittest.TestCase):
|
||||
time = 123456
|
||||
thash = 'asfasdf23412adfqwer'
|
||||
tname = 'thisismynamehahahah'
|
||||
dragnet(self.cv,outfile,state,ratio,tags,added,age,time,thash,tname)
|
||||
trname = 'https://localhost.stackoverflow.tech/317332f1c125bc9c1b9b14fb8e054908/announce'
|
||||
dragnet(self.cv,outfile,state,ratio,tags,added,age,time,thash,tname,trname)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Loading…
x
Reference in New Issue
Block a user