This commit is contained in:
TheErrorExe 2025-02-26 14:30:57 +01:00
parent c75017a8a5
commit 0661d46b99

View file

@ -239,18 +239,16 @@ def watch():
if channel_response.status_code == 200: if channel_response.status_code == 200:
channel_data = channel_response.json() channel_data = channel_response.json()
# Abonnentenanzahl extrahieren
for stat in channel_data.get("statistics", []): for stat in channel_data.get("statistics", []):
for count in stat.get("counts", []): for count in stat.get("counts", []):
if count.get("value") == "subscribers": if count.get("value") == "subscribers":
subscriber_count = count.get("count", "Unbekannt") subscriber_count = count.get("count", "Unbekannt")
break break
# Profilbild (PFP) extrahieren
for stat in channel_data.get("statistics", []): for stat in channel_data.get("statistics", []):
for user_info in stat.get("user", []): for user_info in stat.get("user", []):
if user_info.get("value") == "pfp": if user_info.get("value") == "pfp":
channel_logo_url = user_info.get("count", "") channel_logo_url = user_info.get("count", "").replace("https://", "http://")
break break
except Exception as e: except Exception as e:
print(f"SuperPlayCounts API Error: {str(e)}") print(f"SuperPlayCounts API Error: {str(e)}")