Skip to content

Commit

Permalink
Fixed blocklist not working bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBananaPants committed Jul 14, 2022
1 parent 2be746c commit fdf8117
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CamAlert.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,17 @@ def blocklist_filter(listings):
blocklist_items.append(line.rstrip().lower())
# Make a dictionary with the advert name as key and the URL as value
for listing in listings:

for blocklist_item in blocklist_items:
# Removes findings that are in the blocklist if there are any items in the blocklist
if blocklist_item not in str(listing).lower():
listing_details = listing
advert_url = listing["vipUrl"].encode('utf-8')
not_blocked_listings[json.dumps(listing_details)] = advert_url
not_blocked_listings[json.dumps(listing)] = advert_url
else:
print(f"BLOCKED LISTING ({blocklist_item}): {listing['title']}")
if json.dumps(listing) in not_blocked_listings:
del not_blocked_listings[json.dumps(listing)]
break
return not_blocked_listings


Expand Down

0 comments on commit fdf8117

Please sign in to comment.