/
Noriyki
/
VibeCodeBot
Обзор
Документация
Войти
/
Noriyki
/
VibeCodeBot
Код
Запросы
2
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/services/CodeforceApi.py
28 строк
712 B
Noriyki
refactor:соединение мейнов, запуск страниц через эндпоинты, выделение фласк в отдельный поток
11 фев 2026, 20:06
11 фев 2026, 20:06
361ea2e
Код
Авторство
О чём код?
import requests def get_all_problems(): """Получает все задачи с Codeforces""" try: url = "https://codeforces.com/api/problemset.problems" response = requests.get(url, timeout=10) response.raise_for_status() data = response.json() if data.get("status") != "OK": return None return data.get("result") except requests.exceptions.RequestException: return None except Exception: return None def get_problems_by_rating(rating: int): data = get_all_problems() if not data: return [] problems = data.get("problems", []) return [p for p in problems if p.get("rating") == rating]