"get_peers_url": {},
}
+language_mapping = {
+ # English -> English
+ "Silenced instances" : "Silenced servers",
+ "Suspended instances" : "Suspended servers",
+ "Limited instances" : "Limited servers",
+ # Mappuing German -> English
+ "Gesperrte Server" : "Suspended servers",
+ "Gefilterte Medien" : "Filtered media",
+ "Stummgeschaltete Server" : "Silenced servers",
+ # Japanese -> English
+ "停止済みのサーバー" : "Suspended servers",
+ "制限中のサーバー" : "Limited servers",
+ "メディアを拒否しているサーバー": "Filtered media",
+ "サイレンス済みのサーバー" : "Silenced servers",
+ # ??? -> English
+ "שרתים מושעים" : "Suspended servers",
+ "מדיה מסוננת" : "Filtered media",
+ "שרתים מוגבלים" : "Silenced servers",
+ # French -> English
+ "Serveurs suspendus" : "Suspended servers",
+ "Médias filtrés" : "Filtered media",
+ "Serveurs limités" : "Limited servers",
+ "Serveurs modérés" : "Limited servers",
+}
+
# URL for fetching peers
get_peers_url = "/api/v1/instance/peers"
"Silenced servers" : [],
}
- translations = {
- "Silenced instances" : "Silenced servers",
- "Suspended instances" : "Suspended servers",
- "Gesperrte Server" : "Suspended servers",
- "Gefilterte Medien" : "Filtered media",
- "Stummgeschaltete Server" : "Silenced servers",
- "停止済みのサーバー" : "Suspended servers",
- "制限中のサーバー" : "Limited servers",
- "メディアを拒否しているサーバー": "Filtered media",
- "サイレンス済みのサーバー" : "Silenced servers",
- "שרתים מושעים" : "Suspended servers",
- "מדיה מסוננת" : "Filtered media",
- "שרתים מוגבלים" : "Silenced servers",
- "Serveurs suspendus" : "Suspended servers",
- "Médias filtrés" : "Filtered media",
- "Serveurs limités" : "Limited servers",
- "Serveurs modérés" : "Limited servers",
- }
-
try:
doc = bs4.BeautifulSoup(
reqto.get(f"https://{domain}/about/more", headers=headers, timeout=(config["connection_timeout"], config["read_timeout"])).text,
return {}
for header in doc.find_all("h3"):
- header_text = header.text
+ header_text = tidyup(header.text)
- if header_text in translations:
- header_text = translations[header_text]
+ if header_text in language_mapping:
+ print(f"DEBUG: header_text='{header_text}'")
+ header_text = language_mapping[header_text]
if header_text in blocks or header_text.lower() in blocks:
# replaced find_next_siblings with find_all_next to account for instances that e.g. hide lists in dropdown menu