Skip to content

Commit 9cd5adc

Browse files
authored
Aktualisieren von user.py
1 parent 2e74507 commit 9cd5adc

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

scratchattach/site/user.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -327,25 +327,28 @@ def is_followed_by(self, user):
327327
return followed
328328

329329
def project_count(self):
330-
text = requests.get(
331-
f"https://scratch.mit.edu/users/{self.username}/projects/",
332-
headers = self._headers
333-
).text
334-
return commons.webscrape_count(text, "Shared Projects (", ")")
330+
with requests.no_error_handling():
331+
text = requests.get(
332+
f"https://scratch.mit.edu/users/{self.username}/projects/",
333+
headers = self._headers
334+
).text
335+
return commons.webscrape_count(text, "Shared Projects (", ")")
335336

336337
def studio_count(self):
337-
text = requests.get(
338-
f"https://scratch.mit.edu/users/{self.username}/studios/",
339-
headers = self._headers
340-
).text
341-
return commons.webscrape_count(text, "Studios I Curate (", ")")
338+
with requests.no_error_handling():
339+
text = requests.get(
340+
f"https://scratch.mit.edu/users/{self.username}/studios/",
341+
headers = self._headers
342+
).text
343+
return commons.webscrape_count(text, "Studios I Curate (", ")")
342344

343345
def studios_following_count(self):
344-
text = requests.get(
345-
f"https://scratch.mit.edu/users/{self.username}/studios_following/",
346-
headers = self._headers
347-
).text
348-
return commons.webscrape_count(text, "Studios I Follow (", ")")
346+
with requests.no_error_handling():
347+
text = requests.get(
348+
f"https://scratch.mit.edu/users/{self.username}/studios_following/",
349+
headers = self._headers
350+
).text
351+
return commons.webscrape_count(text, "Studios I Follow (", ")")
349352

350353
def studios(self, *, limit=40, offset=0):
351354
_studios = commons.api_iterative(

0 commit comments

Comments
 (0)