stars fixes

This commit is contained in:
√(noham)²
2025-02-18 21:16:43 +01:00
parent 71ad18cfb2
commit 8afa404d78

View File

@@ -41,6 +41,7 @@ class TheBlackSidePlatform(CTFPlatform):
def login(self) -> bool: def login(self) -> bool:
""" """
Not implementing traditional login as we're using cookies Not implementing traditional login as we're using cookies
Login is protected using Google reCAPTCHA..
Returns True if we can access authenticated endpoints Returns True if we can access authenticated endpoints
""" """
try: try:
@@ -51,6 +52,8 @@ class TheBlackSidePlatform(CTFPlatform):
) )
if "/profil/" in response.text: if "/profil/" in response.text:
print("Logged in") print("Logged in")
else:
raise Exception("Failed to login")
except requests.exceptions.RequestException: except requests.exceptions.RequestException:
raise Exception("Failed to login") raise Exception("Failed to login")
@@ -192,6 +195,8 @@ class TheBlackSidePlatform(CTFPlatform):
--- ---
""" """
) )
stars = "" * min(5, max(1, round(challenge.points / 12)))
files_section = "" files_section = ""
for file in challenge.files: for file in challenge.files:
@@ -205,7 +210,7 @@ class TheBlackSidePlatform(CTFPlatform):
- Author: {challenge.author} - Author: {challenge.author}
- Category: {challenge.category} - Category: {challenge.category}
- Challenge description: {challenge.description} - Challenge description: {challenge.description}
- Points: {challenge.points} - Points: {challenge.points} {stars}
- Solved by: {challenge.solved_number} users - Solved by: {challenge.solved_number} users
- Files provided: {files_section} - Files provided: {files_section}
@@ -219,7 +224,7 @@ class TheBlackSidePlatform(CTFPlatform):
- Auteur: {challenge.author} - Auteur: {challenge.author}
- Catégorie: {challenge.category} - Catégorie: {challenge.category}
- Description du challenge: {challenge.description} - Description du challenge: {challenge.description}
- Points: {challenge.points} - Points: {challenge.points} {stars}
- Résolu par: {challenge.solved_number} utilisateurs - Résolu par: {challenge.solved_number} utilisateurs
- Fichiers fournis: {files_section} - Fichiers fournis: {files_section}