mirror of
https://github.com/simon987/chan_feed.git
synced 2025-12-17 14:09:01 +00:00
replace rabbitMQ with redis
This commit is contained in:
42
get_8kun_boards.py
Normal file
42
get_8kun_boards.py
Normal file
@@ -0,0 +1,42 @@
|
||||
import json
|
||||
import requests
|
||||
from chan.chan import CHANS
|
||||
|
||||
existing = CHANS["8kun2"]._boards
|
||||
updated = list(existing)
|
||||
added = set()
|
||||
|
||||
|
||||
def mask(board):
|
||||
for i, b in enumerate(updated):
|
||||
if b == board:
|
||||
updated[i] = "_" + board
|
||||
print("[-] " + board)
|
||||
|
||||
|
||||
def unmask(board):
|
||||
for i, b in enumerate(updated):
|
||||
if b == ("_" + board):
|
||||
updated[i] = board
|
||||
print("[*] " + board)
|
||||
|
||||
|
||||
for i in range(0, 500, 50):
|
||||
r = requests.get("https://sys.8kun.top/board-search.php?page=" + str(i))
|
||||
|
||||
j = json.loads(r.text)
|
||||
|
||||
for board in j["boards"]:
|
||||
added.add(board)
|
||||
|
||||
if ("_" + board) in updated:
|
||||
unmask(board)
|
||||
elif board not in existing:
|
||||
updated.append(board)
|
||||
print("[+] " + board)
|
||||
|
||||
for board in existing:
|
||||
if board not in added:
|
||||
mask(board)
|
||||
|
||||
print("(" + ",".join('"' + u + '"' for u in updated) + ")")
|
||||
Reference in New Issue
Block a user