Skip to content

Commit

Permalink
ddg: add support for whitelist-subdomains
Browse files Browse the repository at this point in the history
  • Loading branch information
kar committed Nov 25, 2022
1 parent 3e0c8c8 commit e661890
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/ddg.py
Expand Up @@ -69,8 +69,22 @@ def usage():
with open(path.join(base_path, "whitelist")) as f:
whitelist = f.read().split("\n")

print("Whitelist:")
print(whitelist)

# load whitelisted subdomains if any
whitelistedSubdomains = []
with open(path.join(base_path, "whitelist-subdomains")) as f:
wsInput = f.read().split("\n")
for ws in wsInput:
if ws:
whitelistedSubdomains.append(ws)
for x in range(10):
whitelistedSubdomains.append(ws + str(x))

print("Whitelisted subdomains:")
print(whitelistedSubdomains)

# load all domain files
print(" Processing DuckDuckGo repo...")
domains = []
Expand Down
26 changes: 26 additions & 0 deletions scripts/whitelist-subdomains
@@ -0,0 +1,26 @@
www
api
cdn
im
image-
image
images
imagesd
imageservice-assets-ht
imagesjoins
imagesrv
imagesxf
img
img-
imgb
imgbp
imgcdn
imgcover
imgcy
imgd
imgg
imgix
imgopt01
imgproxy
imgs
imgs10

0 comments on commit e661890

Please sign in to comment.