summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--twitch.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/twitch.py b/twitch.py
index 9ede9bb..bfce676 100644
--- a/twitch.py
+++ b/twitch.py
@@ -50,10 +50,12 @@ def get_total_follower_count_scrape(username: str) -> int:
"Chrome/124.0.0.0 Safari/537.36"
)
}
-
- response = requests.get(url, headers=headers, timeout=10)
- response.raise_for_status()
- html = response.text
+ try:
+ response = requests.get(url, headers=headers, timeout=10)
+ response.raise_for_status()
+ html = response.text
+ except:
+ return None
soup = BeautifulSoup(html, 'html.parser')
for li in soup.find_all("li", class_="list-group-item"):
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage