From f4542819c72370728b336b71c2f1f1684e84928d Mon Sep 17 00:00:00 2001 From: Foohy Date: Sun, 12 May 2024 19:55:32 -0700 Subject: [PATCH] Cherrypick ca95ebce130e1f0aa6c18a5a7517fa7c17886d59 From #179 | branch scraper-strengthen --- other/scraper/scrape.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/other/scraper/scrape.py b/other/scraper/scrape.py index 07b96a03..fceb79cf 100644 --- a/other/scraper/scrape.py +++ b/other/scraper/scrape.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + import sys import json import time @@ -11,16 +13,24 @@ DELAY = 0.1 # How long to delay between requests FILENAME = "addons.txt" -ignore_words = ["content", "server"] +# Not a whole word search, so nav also gets navmesh +ignore_words = [ + "content", + "server", + "nav", + "node", + "icon" +] + ignore_reg = "(? resobj["response"]["total"]: break - else: + else: # so valve doesn't get angry at us time.sleep(DELAY) - + # Results come back sorted, but reverse it so # newer entries are added at the end instead of shifting everything at the beginning workshopids.reverse() @@ -78,4 +90,3 @@ def containsIgnoreWords(str): print("Finished!!") f.close() -