Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cf923301a7 | |||
| f833bfe3a5 | |||
| d6129f5d79 |
@@ -0,0 +1,40 @@
|
|||||||
|
id: feed_feodotracker
|
||||||
|
name: Feodo Tracker Feed
|
||||||
|
version: 1.0.0
|
||||||
|
description: "abuse.ch Feodo Tracker feed connector — pull the botnet C2 IP blocklist (Emotet, Dridex, TrickBot, QakBot, BumbleBee, ...) and emit normalized IOCs (IP + type, with port/malware/status context) for import into the Threat Indicator Manager. Free, no authentication required; stdlib-only, no extra Python dependencies."
|
||||||
|
changelog: "1.0.0 — Initial release: fetch the Feodo Tracker C2 IP blocklist (full or recommended)."
|
||||||
|
category: feed
|
||||||
|
|
||||||
|
# Feodo Tracker is a free abuse.ch feed served over HTTPS. No API key is required.
|
||||||
|
config_schema:
|
||||||
|
properties:
|
||||||
|
recommended_only:
|
||||||
|
type: boolean
|
||||||
|
description: "Fetch the 'recommended' blocklist (higher-confidence subset) instead of the full list"
|
||||||
|
default: false
|
||||||
|
insecure:
|
||||||
|
type: boolean
|
||||||
|
description: "Trust any TLS certificate (not secure)"
|
||||||
|
default: false
|
||||||
|
required: []
|
||||||
|
|
||||||
|
commands:
|
||||||
|
- id: fetch_indicators
|
||||||
|
name: feed-feodotracker-fetch-indicators
|
||||||
|
description: "Fetch the Feodo Tracker C2 IP blocklist and return normalized indicators."
|
||||||
|
risk: read
|
||||||
|
inputs_schema:
|
||||||
|
properties:
|
||||||
|
recommended_only: { type: boolean, description: "Fetch the recommended (higher-confidence) subset (overrides the config default)" }
|
||||||
|
max_indicators: { type: number, description: "Max indicators to return (0 = no limit, default 0)" }
|
||||||
|
required: []
|
||||||
|
outputs_schema: { properties: {} }
|
||||||
|
|
||||||
|
- id: test_connection
|
||||||
|
name: feed-feodotracker-test-connection
|
||||||
|
description: "Verify the Feodo Tracker feed is reachable (used by the Test button)."
|
||||||
|
risk: read
|
||||||
|
inputs_schema:
|
||||||
|
properties: {}
|
||||||
|
required: []
|
||||||
|
outputs_schema: { properties: {} }
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
import json, os, sys, ssl, urllib.request, urllib.error
|
||||||
|
|
||||||
|
BASE = "https://feodotracker.abuse.ch/downloads/"
|
||||||
|
|
||||||
|
|
||||||
|
def _cfg():
|
||||||
|
return json.loads(os.environ.get("INTEGRATION_SECRETS", "{}"))
|
||||||
|
|
||||||
|
|
||||||
|
def _inputs():
|
||||||
|
return json.loads(os.environ.get("INTEGRATION_INPUTS", "{}"))
|
||||||
|
|
||||||
|
|
||||||
|
def _ctx(cfg):
|
||||||
|
if cfg.get("insecure"):
|
||||||
|
c = ssl.create_default_context()
|
||||||
|
c.check_hostname = False
|
||||||
|
c.verify_mode = ssl.CERT_NONE
|
||||||
|
return c
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _get(url, cfg):
|
||||||
|
req = urllib.request.Request(
|
||||||
|
url, headers={"User-Agent": "Riposte-SOAR", "Accept": "application/json"}
|
||||||
|
)
|
||||||
|
with urllib.request.urlopen(req, timeout=120, context=_ctx(cfg)) as r:
|
||||||
|
return r.read()
|
||||||
|
|
||||||
|
|
||||||
|
def _run(fn):
|
||||||
|
try:
|
||||||
|
print(json.dumps(fn(_cfg(), _inputs())))
|
||||||
|
except urllib.error.HTTPError as e:
|
||||||
|
print(json.dumps({"error": "HTTP " + str(e.code), "detail": e.read().decode("utf-8", "replace")}))
|
||||||
|
sys.exit(1)
|
||||||
|
except Exception as e:
|
||||||
|
print(json.dumps({"error": str(e)}))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def main(cfg, inputs):
|
||||||
|
rec = inputs.get("recommended_only")
|
||||||
|
if rec is None:
|
||||||
|
rec = cfg.get("recommended_only")
|
||||||
|
fname = "ipblocklist_recommended.json" if rec else "ipblocklist.json"
|
||||||
|
|
||||||
|
raw = _get(BASE + fname, cfg)
|
||||||
|
data = json.loads(raw) if raw else []
|
||||||
|
if not isinstance(data, list):
|
||||||
|
data = []
|
||||||
|
|
||||||
|
maxn = int(inputs.get("max_indicators") or 0)
|
||||||
|
out = []
|
||||||
|
for e in data:
|
||||||
|
if not isinstance(e, dict):
|
||||||
|
continue
|
||||||
|
ip = e.get("ip_address")
|
||||||
|
if not ip:
|
||||||
|
continue
|
||||||
|
out.append({
|
||||||
|
"value": ip,
|
||||||
|
"type": "ip",
|
||||||
|
"port": e.get("port"),
|
||||||
|
"malware": e.get("malware"),
|
||||||
|
"status": e.get("status"),
|
||||||
|
"hostname": e.get("hostname"),
|
||||||
|
"as_number": e.get("as_number"),
|
||||||
|
"country": e.get("country"),
|
||||||
|
"first_seen": e.get("first_seen"),
|
||||||
|
"last_online": e.get("last_online"),
|
||||||
|
})
|
||||||
|
if maxn and len(out) >= maxn:
|
||||||
|
break
|
||||||
|
|
||||||
|
return {"source": "feodotracker:" + fname, "count": len(out), "indicators": out}
|
||||||
|
|
||||||
|
|
||||||
|
_run(main)
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import json, os, sys, ssl, urllib.request, urllib.error
|
||||||
|
|
||||||
|
BASE = "https://feodotracker.abuse.ch/downloads/"
|
||||||
|
|
||||||
|
|
||||||
|
def _cfg():
|
||||||
|
return json.loads(os.environ.get("INTEGRATION_SECRETS", "{}"))
|
||||||
|
|
||||||
|
|
||||||
|
def _inputs():
|
||||||
|
return json.loads(os.environ.get("INTEGRATION_INPUTS", "{}"))
|
||||||
|
|
||||||
|
|
||||||
|
def _ctx(cfg):
|
||||||
|
if cfg.get("insecure"):
|
||||||
|
c = ssl.create_default_context()
|
||||||
|
c.check_hostname = False
|
||||||
|
c.verify_mode = ssl.CERT_NONE
|
||||||
|
return c
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _get(url, cfg):
|
||||||
|
req = urllib.request.Request(
|
||||||
|
url, headers={"User-Agent": "Riposte-SOAR", "Accept": "application/json"}
|
||||||
|
)
|
||||||
|
with urllib.request.urlopen(req, timeout=60, context=_ctx(cfg)) as r:
|
||||||
|
return r.read()
|
||||||
|
|
||||||
|
|
||||||
|
def _run(fn):
|
||||||
|
try:
|
||||||
|
print(json.dumps(fn(_cfg(), _inputs())))
|
||||||
|
except urllib.error.HTTPError as e:
|
||||||
|
print(json.dumps({"error": "HTTP " + str(e.code), "detail": e.read().decode("utf-8", "replace")}))
|
||||||
|
sys.exit(1)
|
||||||
|
except Exception as e:
|
||||||
|
print(json.dumps({"error": str(e)}))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def main(cfg, inputs):
|
||||||
|
raw = _get(BASE + "ipblocklist_recommended.json", cfg)
|
||||||
|
data = json.loads(raw) if raw else []
|
||||||
|
n = len(data) if isinstance(data, list) else 0
|
||||||
|
return {"ok": True, "sample_count": n}
|
||||||
|
|
||||||
|
|
||||||
|
_run(main)
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
id: feed_spamhaus_drop
|
||||||
|
name: Spamhaus DROP Feed
|
||||||
|
version: 1.0.0
|
||||||
|
description: "Spamhaus DROP feed connector — pull the 'Don't Route Or Peer' lists (hijacked/leased netblocks and ASNs used by cyber-criminals) and emit normalized IOCs (CIDR or ASN + type, with SBL reference) for import into the Threat Indicator Manager. Free, no authentication required; stdlib-only, no extra Python dependencies."
|
||||||
|
changelog: "1.0.0 — Initial release: fetch DROP (IPv4), DROPv6 or ASN-DROP as normalized indicators."
|
||||||
|
category: feed
|
||||||
|
|
||||||
|
# Spamhaus DROP lists are free and served over HTTPS as line-delimited JSON.
|
||||||
|
config_schema:
|
||||||
|
properties:
|
||||||
|
list:
|
||||||
|
type: string
|
||||||
|
description: "Which list to fetch: drop (IPv4), dropv6 (IPv6) or asndrop (default drop)"
|
||||||
|
default: "drop"
|
||||||
|
insecure:
|
||||||
|
type: boolean
|
||||||
|
description: "Trust any TLS certificate (not secure)"
|
||||||
|
default: false
|
||||||
|
required: []
|
||||||
|
|
||||||
|
commands:
|
||||||
|
- id: fetch_indicators
|
||||||
|
name: feed-spamhaus-drop-fetch-indicators
|
||||||
|
description: "Fetch a Spamhaus DROP list and return normalized indicators."
|
||||||
|
risk: read
|
||||||
|
inputs_schema:
|
||||||
|
properties:
|
||||||
|
list: { type: string, description: "drop | dropv6 | asndrop (overrides the config default)" }
|
||||||
|
max_indicators: { type: number, description: "Max indicators to return (0 = no limit, default 0)" }
|
||||||
|
required: []
|
||||||
|
outputs_schema: { properties: {} }
|
||||||
|
|
||||||
|
- id: test_connection
|
||||||
|
name: feed-spamhaus-drop-test-connection
|
||||||
|
description: "Verify the Spamhaus DROP feed is reachable (used by the Test button)."
|
||||||
|
risk: read
|
||||||
|
inputs_schema:
|
||||||
|
properties: {}
|
||||||
|
required: []
|
||||||
|
outputs_schema: { properties: {} }
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
import json, os, sys, ssl, urllib.request, urllib.error
|
||||||
|
|
||||||
|
LISTS = {
|
||||||
|
"drop": "https://www.spamhaus.org/drop/drop_v4.json",
|
||||||
|
"dropv6": "https://www.spamhaus.org/drop/drop_v6.json",
|
||||||
|
"asndrop": "https://www.spamhaus.org/drop/asndrop.json",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _cfg():
|
||||||
|
return json.loads(os.environ.get("INTEGRATION_SECRETS", "{}"))
|
||||||
|
|
||||||
|
|
||||||
|
def _inputs():
|
||||||
|
return json.loads(os.environ.get("INTEGRATION_INPUTS", "{}"))
|
||||||
|
|
||||||
|
|
||||||
|
def _ctx(cfg):
|
||||||
|
if cfg.get("insecure"):
|
||||||
|
c = ssl.create_default_context()
|
||||||
|
c.check_hostname = False
|
||||||
|
c.verify_mode = ssl.CERT_NONE
|
||||||
|
return c
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _get(url, cfg):
|
||||||
|
req = urllib.request.Request(
|
||||||
|
url, headers={"User-Agent": "Riposte-SOAR", "Accept": "application/json"}
|
||||||
|
)
|
||||||
|
with urllib.request.urlopen(req, timeout=120, context=_ctx(cfg)) as r:
|
||||||
|
return r.read()
|
||||||
|
|
||||||
|
|
||||||
|
def _run(fn):
|
||||||
|
try:
|
||||||
|
print(json.dumps(fn(_cfg(), _inputs())))
|
||||||
|
except urllib.error.HTTPError as e:
|
||||||
|
print(json.dumps({"error": "HTTP " + str(e.code), "detail": e.read().decode("utf-8", "replace")}))
|
||||||
|
sys.exit(1)
|
||||||
|
except Exception as e:
|
||||||
|
print(json.dumps({"error": str(e)}))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def _parse(raw, maxn):
|
||||||
|
# Spamhaus DROP lists are newline-delimited JSON objects. Metadata lines
|
||||||
|
# (type == "metadata") are skipped. A legacy "cidr ; SBLxxx" text form is
|
||||||
|
# also tolerated as a fallback.
|
||||||
|
out = []
|
||||||
|
for line in raw.splitlines():
|
||||||
|
line = line.strip()
|
||||||
|
if not line:
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
obj = json.loads(line)
|
||||||
|
except ValueError:
|
||||||
|
part = line.split(";")[0].strip()
|
||||||
|
if part and not part.startswith("#"):
|
||||||
|
out.append({"value": part, "type": "cidr"})
|
||||||
|
if maxn and len(out) >= maxn:
|
||||||
|
break
|
||||||
|
continue
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
continue
|
||||||
|
if obj.get("type") == "metadata":
|
||||||
|
continue
|
||||||
|
cidr = obj.get("cidr")
|
||||||
|
asn = obj.get("asn")
|
||||||
|
if cidr:
|
||||||
|
out.append({"value": cidr, "type": "cidr", "sblid": obj.get("sblid"), "rir": obj.get("rir")})
|
||||||
|
elif asn is not None:
|
||||||
|
out.append({"value": "AS" + str(asn), "type": "asn", "org": obj.get("org")})
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
if maxn and len(out) >= maxn:
|
||||||
|
break
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def main(cfg, inputs):
|
||||||
|
key = str(inputs.get("list") or cfg.get("list") or "drop").lower()
|
||||||
|
url = LISTS.get(key, LISTS["drop"])
|
||||||
|
raw = _get(url, cfg).decode("utf-8", "replace")
|
||||||
|
maxn = int(inputs.get("max_indicators") or 0)
|
||||||
|
out = _parse(raw, maxn)
|
||||||
|
return {"source": "spamhaus:" + key, "count": len(out), "indicators": out}
|
||||||
|
|
||||||
|
|
||||||
|
_run(main)
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
import json, os, sys, ssl, urllib.request, urllib.error
|
||||||
|
|
||||||
|
LISTS = {
|
||||||
|
"drop": "https://www.spamhaus.org/drop/drop_v4.json",
|
||||||
|
"dropv6": "https://www.spamhaus.org/drop/drop_v6.json",
|
||||||
|
"asndrop": "https://www.spamhaus.org/drop/asndrop.json",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _cfg():
|
||||||
|
return json.loads(os.environ.get("INTEGRATION_SECRETS", "{}"))
|
||||||
|
|
||||||
|
|
||||||
|
def _inputs():
|
||||||
|
return json.loads(os.environ.get("INTEGRATION_INPUTS", "{}"))
|
||||||
|
|
||||||
|
|
||||||
|
def _ctx(cfg):
|
||||||
|
if cfg.get("insecure"):
|
||||||
|
c = ssl.create_default_context()
|
||||||
|
c.check_hostname = False
|
||||||
|
c.verify_mode = ssl.CERT_NONE
|
||||||
|
return c
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _get(url, cfg):
|
||||||
|
req = urllib.request.Request(
|
||||||
|
url, headers={"User-Agent": "Riposte-SOAR", "Accept": "application/json"}
|
||||||
|
)
|
||||||
|
with urllib.request.urlopen(req, timeout=60, context=_ctx(cfg)) as r:
|
||||||
|
return r.read()
|
||||||
|
|
||||||
|
|
||||||
|
def _run(fn):
|
||||||
|
try:
|
||||||
|
print(json.dumps(fn(_cfg(), _inputs())))
|
||||||
|
except urllib.error.HTTPError as e:
|
||||||
|
print(json.dumps({"error": "HTTP " + str(e.code), "detail": e.read().decode("utf-8", "replace")}))
|
||||||
|
sys.exit(1)
|
||||||
|
except Exception as e:
|
||||||
|
print(json.dumps({"error": str(e)}))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def main(cfg, inputs):
|
||||||
|
key = str(cfg.get("list") or "drop").lower()
|
||||||
|
url = LISTS.get(key, LISTS["drop"])
|
||||||
|
raw = _get(url, cfg).decode("utf-8", "replace")
|
||||||
|
n = sum(1 for ln in raw.splitlines() if ln.strip())
|
||||||
|
return {"ok": True, "sample_lines": n, "list": key}
|
||||||
|
|
||||||
|
|
||||||
|
_run(main)
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
id: feed_tor_exit
|
||||||
|
name: Tor Exit Nodes Feed
|
||||||
|
version: 1.0.0
|
||||||
|
description: "Tor Project exit-node feed connector — pull the current list of Tor exit-relay IP addresses and emit normalized IOCs (IP + type, tagged tor-exit) for import into the Threat Indicator Manager. Useful for flagging traffic from Tor anonymizing infrastructure. Free, no authentication required; stdlib-only, no extra Python dependencies."
|
||||||
|
changelog: "1.0.0 — Initial release: fetch the Tor bulk exit list."
|
||||||
|
category: feed
|
||||||
|
|
||||||
|
# The Tor exit list is served over HTTPS by the Tor Project. No API key is required.
|
||||||
|
config_schema:
|
||||||
|
properties:
|
||||||
|
feed_url:
|
||||||
|
type: string
|
||||||
|
description: "Override the exit-list URL (default https://check.torproject.org/torbulkexitlist)"
|
||||||
|
insecure:
|
||||||
|
type: boolean
|
||||||
|
description: "Trust any TLS certificate (not secure)"
|
||||||
|
default: false
|
||||||
|
required: []
|
||||||
|
|
||||||
|
commands:
|
||||||
|
- id: fetch_indicators
|
||||||
|
name: feed-tor-exit-fetch-indicators
|
||||||
|
description: "Fetch the Tor exit-node list and return normalized indicators."
|
||||||
|
risk: read
|
||||||
|
inputs_schema:
|
||||||
|
properties:
|
||||||
|
max_indicators: { type: number, description: "Max indicators to return (0 = no limit, default 0)" }
|
||||||
|
required: []
|
||||||
|
outputs_schema: { properties: {} }
|
||||||
|
|
||||||
|
- id: test_connection
|
||||||
|
name: feed-tor-exit-test-connection
|
||||||
|
description: "Verify the Tor exit list is reachable (used by the Test button)."
|
||||||
|
risk: read
|
||||||
|
inputs_schema:
|
||||||
|
properties: {}
|
||||||
|
required: []
|
||||||
|
outputs_schema: { properties: {} }
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
import json, os, sys, ssl, urllib.request, urllib.error
|
||||||
|
|
||||||
|
DEFAULT_URL = "https://check.torproject.org/torbulkexitlist"
|
||||||
|
|
||||||
|
|
||||||
|
def _cfg():
|
||||||
|
return json.loads(os.environ.get("INTEGRATION_SECRETS", "{}"))
|
||||||
|
|
||||||
|
|
||||||
|
def _inputs():
|
||||||
|
return json.loads(os.environ.get("INTEGRATION_INPUTS", "{}"))
|
||||||
|
|
||||||
|
|
||||||
|
def _ctx(cfg):
|
||||||
|
if cfg.get("insecure"):
|
||||||
|
c = ssl.create_default_context()
|
||||||
|
c.check_hostname = False
|
||||||
|
c.verify_mode = ssl.CERT_NONE
|
||||||
|
return c
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _get(url, cfg):
|
||||||
|
req = urllib.request.Request(url, headers={"User-Agent": "Riposte-SOAR"})
|
||||||
|
with urllib.request.urlopen(req, timeout=120, context=_ctx(cfg)) as r:
|
||||||
|
return r.read()
|
||||||
|
|
||||||
|
|
||||||
|
def _run(fn):
|
||||||
|
try:
|
||||||
|
print(json.dumps(fn(_cfg(), _inputs())))
|
||||||
|
except urllib.error.HTTPError as e:
|
||||||
|
print(json.dumps({"error": "HTTP " + str(e.code), "detail": e.read().decode("utf-8", "replace")}))
|
||||||
|
sys.exit(1)
|
||||||
|
except Exception as e:
|
||||||
|
print(json.dumps({"error": str(e)}))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def main(cfg, inputs):
|
||||||
|
url = cfg.get("feed_url") or DEFAULT_URL
|
||||||
|
raw = _get(url, cfg).decode("utf-8", "replace")
|
||||||
|
|
||||||
|
maxn = int(inputs.get("max_indicators") or 0)
|
||||||
|
out = []
|
||||||
|
for line in raw.splitlines():
|
||||||
|
line = line.strip()
|
||||||
|
if not line or line.startswith("#"):
|
||||||
|
continue
|
||||||
|
out.append({"value": line, "type": "ip", "tags": ["tor-exit"]})
|
||||||
|
if maxn and len(out) >= maxn:
|
||||||
|
break
|
||||||
|
|
||||||
|
return {"source": "tor-exit", "count": len(out), "indicators": out}
|
||||||
|
|
||||||
|
|
||||||
|
_run(main)
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import json, os, sys, ssl, urllib.request, urllib.error
|
||||||
|
|
||||||
|
DEFAULT_URL = "https://check.torproject.org/torbulkexitlist"
|
||||||
|
|
||||||
|
|
||||||
|
def _cfg():
|
||||||
|
return json.loads(os.environ.get("INTEGRATION_SECRETS", "{}"))
|
||||||
|
|
||||||
|
|
||||||
|
def _inputs():
|
||||||
|
return json.loads(os.environ.get("INTEGRATION_INPUTS", "{}"))
|
||||||
|
|
||||||
|
|
||||||
|
def _ctx(cfg):
|
||||||
|
if cfg.get("insecure"):
|
||||||
|
c = ssl.create_default_context()
|
||||||
|
c.check_hostname = False
|
||||||
|
c.verify_mode = ssl.CERT_NONE
|
||||||
|
return c
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _get(url, cfg):
|
||||||
|
req = urllib.request.Request(url, headers={"User-Agent": "Riposte-SOAR"})
|
||||||
|
with urllib.request.urlopen(req, timeout=60, context=_ctx(cfg)) as r:
|
||||||
|
return r.read()
|
||||||
|
|
||||||
|
|
||||||
|
def _run(fn):
|
||||||
|
try:
|
||||||
|
print(json.dumps(fn(_cfg(), _inputs())))
|
||||||
|
except urllib.error.HTTPError as e:
|
||||||
|
print(json.dumps({"error": "HTTP " + str(e.code), "detail": e.read().decode("utf-8", "replace")}))
|
||||||
|
sys.exit(1)
|
||||||
|
except Exception as e:
|
||||||
|
print(json.dumps({"error": str(e)}))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def main(cfg, inputs):
|
||||||
|
url = cfg.get("feed_url") or DEFAULT_URL
|
||||||
|
raw = _get(url, cfg).decode("utf-8", "replace")
|
||||||
|
n = sum(1 for ln in raw.splitlines() if ln.strip() and not ln.startswith("#"))
|
||||||
|
return {"ok": True, "sample_count": n}
|
||||||
|
|
||||||
|
|
||||||
|
_run(main)
|
||||||
Reference in New Issue
Block a user