Merge pull request #35 from jonbranan/add_tracker_data_to_dragnet
#34 added tracker data to dragnet
This commit is contained in:
commit
1f5f93b452
@ -30,7 +30,7 @@ def tor_processor(self):
|
|||||||
self.tl.info(f'Submitted ["{canidate["name"][0:20]}..."] for deletion.')
|
self.tl.info(f'Submitted ["{canidate["name"][0:20]}..."] for deletion.')
|
||||||
else:
|
else:
|
||||||
if self.enable_dragnet:
|
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.tl.info(f'["{canidate["name"][0:20]}..."] is orphaned.')
|
||||||
self.up_tor_counter += 1
|
self.up_tor_counter += 1
|
||||||
continue
|
continue
|
||||||
@ -68,9 +68,9 @@ def is_not_protected_tor(setnonprotectedtag, tortags):
|
|||||||
if setnonprotectedtag in tortags:
|
if setnonprotectedtag in tortags:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def dragnet(csv_obj,outfile,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']
|
header = ['state','ratio','tags','added','age','time','thash','tname','trname']
|
||||||
row = [state,ratio,tags,added,age,time,thash,tname]
|
row = [state,ratio,tags,added,age,time,thash,tname,trname]
|
||||||
with open(outfile, 'a+', encoding='UTF8', newline='') as f:
|
with open(outfile, 'a+', encoding='UTF8', newline='') as f:
|
||||||
writer = csv_obj.writer(f)
|
writer = csv_obj.writer(f)
|
||||||
if f.tell() == 0:
|
if f.tell() == 0:
|
||||||
|
@ -14,7 +14,8 @@ class TestDragnet(unittest.TestCase):
|
|||||||
time = 123456
|
time = 123456
|
||||||
thash = 'asfasdf23412adfqwer'
|
thash = 'asfasdf23412adfqwer'
|
||||||
tname = 'thisismynamehahahah'
|
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__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
Loading…
x
Reference in New Issue
Block a user