Template
217 lines
7.2 KiB
Python
217 lines
7.2 KiB
Python
"""Топ клиентов по https://docs.rw/clients (featured + самые популярные)."""
|
||
|
||
from __future__ import annotations
|
||
|
||
from dataclasses import dataclass
|
||
|
||
|
||
@dataclass(frozen=True, slots=True)
|
||
class ClientLink:
|
||
title: str
|
||
url: str
|
||
|
||
|
||
@dataclass(frozen=True, slots=True)
|
||
class ClientApp:
|
||
id: str
|
||
name: str
|
||
core: str
|
||
description: str
|
||
featured: bool
|
||
hwid: bool
|
||
links: tuple[ClientLink, ...]
|
||
|
||
|
||
# Источник: https://docs.rw/clients + src/data/clients.ts (featured первыми)
|
||
TOP_CLIENTS: tuple[ClientApp, ...] = (
|
||
ClientApp(
|
||
id="happ",
|
||
name="Happ",
|
||
core="Xray",
|
||
description="Современный клиент для Android, iOS, macOS, Windows, Linux.",
|
||
featured=True,
|
||
hwid=True,
|
||
links=(
|
||
ClientLink("Android · Google Play", "https://play.google.com/store/apps/details?id=com.happproxy"),
|
||
ClientLink(
|
||
"Android · APK",
|
||
"https://github.com/Happ-proxy/happ-android/releases/latest/download/Happ.apk",
|
||
),
|
||
ClientLink("iOS · App Store", "https://apps.apple.com/us/app/happ-proxy-utility/id6504287215"),
|
||
ClientLink(
|
||
"Windows",
|
||
"https://github.com/Happ-proxy/happ-desktop/releases/latest/download/setup-Happ.x64.exe",
|
||
),
|
||
ClientLink("Linux · релизы", "https://github.com/Happ-proxy/happ-desktop/releases/latest"),
|
||
ClientLink("Сайт", "https://happ.su/main"),
|
||
),
|
||
),
|
||
ClientApp(
|
||
id="flclashx",
|
||
name="FlClashX",
|
||
core="Mihomo",
|
||
description="Форк FlClash с улучшениями. Android / Windows / macOS / Linux.",
|
||
featured=True,
|
||
hwid=True,
|
||
links=(
|
||
ClientLink("GitHub · релизы", "https://github.com/pluralplay/FlClashX/releases/latest"),
|
||
ClientLink("Telegram", "https://t.me/flclashx"),
|
||
),
|
||
),
|
||
ClientApp(
|
||
id="koala-clash",
|
||
name="Koala Clash",
|
||
core="Mihomo",
|
||
description="Форк Clash Verge Rev (community Remnawave). Windows / macOS / Linux.",
|
||
featured=True,
|
||
hwid=True,
|
||
links=(
|
||
ClientLink(
|
||
"GitHub · релизы",
|
||
"https://github.com/coolcoala/clash-verge-rev-lite/releases/latest",
|
||
),
|
||
ClientLink("Telegram", "https://t.me/+WCL__GOFzZJkYjZi"),
|
||
),
|
||
),
|
||
ClientApp(
|
||
id="flowvy",
|
||
name="Flowvy",
|
||
core="Mihomo",
|
||
description="Удобный Mihomo-клиент «в два клика». Windows / macOS / Linux.",
|
||
featured=True,
|
||
hwid=True,
|
||
links=(
|
||
ClientLink(
|
||
"Windows",
|
||
"https://github.com/flowvy-proxy/desktop/releases/latest/download/Flowvy_x64.exe",
|
||
),
|
||
ClientLink(
|
||
"Linux · deb",
|
||
"https://github.com/flowvy-proxy/desktop/releases/latest/download/Flowvy_x64.deb",
|
||
),
|
||
ClientLink("macOS · релизы", "https://github.com/flowvy-proxy/desktop/releases/latest"),
|
||
ClientLink("Docs", "https://docs.flowvy.io"),
|
||
),
|
||
),
|
||
ClientApp(
|
||
id="rabbit-hole",
|
||
name="Rabbit Hole",
|
||
core="Mihomo",
|
||
description="Чистый UX для iOS и macOS.",
|
||
featured=True,
|
||
hwid=True,
|
||
links=(
|
||
ClientLink(
|
||
"iOS / macOS · App Store",
|
||
"https://apps.apple.com/app/rabbithole-vpn-client/id6683309629",
|
||
),
|
||
ClientLink("Docs", "https://rabbit-hole-1.gitbook.io/rabbit-hole-docs/"),
|
||
ClientLink("Telegram", "https://t.me/rabbit_hole_vpn"),
|
||
),
|
||
),
|
||
ClientApp(
|
||
id="v2raytun",
|
||
name="V2rayTun",
|
||
core="Xray",
|
||
description="Лёгкий Xray-клиент. Android / iOS / Windows / macOS.",
|
||
featured=False,
|
||
hwid=True,
|
||
links=(
|
||
ClientLink(
|
||
"Android · Google Play",
|
||
"https://play.google.com/store/apps/details?id=com.v2raytun.android",
|
||
),
|
||
ClientLink("iOS / macOS", "https://apps.apple.com/en/app/v2raytun/id6476628951"),
|
||
ClientLink("Windows / сайт", "https://v2raytun.com/"),
|
||
ClientLink("Telegram", "https://t.me/v2raytun"),
|
||
),
|
||
),
|
||
ClientApp(
|
||
id="v2rayng",
|
||
name="V2rayNG",
|
||
core="Xray",
|
||
description="Самый популярный V2Ray/Xray клиент для Android.",
|
||
featured=False,
|
||
hwid=False,
|
||
links=(
|
||
ClientLink("Android · релизы", "https://github.com/2dust/v2rayNG/releases/latest"),
|
||
ClientLink("GitHub", "https://github.com/2dust/v2rayNG"),
|
||
),
|
||
),
|
||
ClientApp(
|
||
id="v2rayn",
|
||
name="V2rayN",
|
||
core="Xray",
|
||
description="Популярный клиент для Windows / macOS / Linux.",
|
||
featured=False,
|
||
hwid=False,
|
||
links=(
|
||
ClientLink("Релизы", "https://github.com/2dust/v2rayN/releases/latest"),
|
||
ClientLink("Wiki", "https://github.com/2dust/v2rayN/wiki"),
|
||
),
|
||
),
|
||
ClientApp(
|
||
id="clash-verge",
|
||
name="Clash Verge",
|
||
core="Mihomo",
|
||
description="Clash Meta GUI на Tauri. Windows / macOS / Linux.",
|
||
featured=False,
|
||
hwid=False,
|
||
links=(
|
||
ClientLink(
|
||
"Релизы",
|
||
"https://github.com/clash-verge-rev/clash-verge-rev/releases/latest",
|
||
),
|
||
ClientLink("Telegram", "https://t.me/clash_verge_rev"),
|
||
),
|
||
),
|
||
ClientApp(
|
||
id="karing",
|
||
name="Karing",
|
||
core="Sing-box",
|
||
description="Мультиплатформенный клиент на Sing-box.",
|
||
featured=False,
|
||
hwid=True,
|
||
links=(
|
||
ClientLink("Android / Desktop · релизы", "https://github.com/KaringX/karing/releases/latest"),
|
||
ClientLink("iOS · App Store", "https://apps.apple.com/us/app/karing/id6472431552"),
|
||
ClientLink("Сайт", "https://karing.app/"),
|
||
ClientLink("Telegram", "https://t.me/KaringApp"),
|
||
),
|
||
),
|
||
)
|
||
|
||
DOCS_CLIENTS_URL = "https://docs.rw/clients"
|
||
|
||
CLIENTS_INTRO = (
|
||
"<b>📥 Скачать клиент</b>\n\n"
|
||
"Топ‑10 по <a href=\"https://docs.rw/clients\">docs.rw/clients</a> "
|
||
"(featured Remnawave + самые популярные).\n\n"
|
||
"Установи приложение и вставь ссылку из «Моя подписка».\n"
|
||
"Выбери клиент:"
|
||
)
|
||
|
||
|
||
def get_client(client_id: str) -> ClientApp | None:
|
||
for client in TOP_CLIENTS:
|
||
if client.id == client_id:
|
||
return client
|
||
return None
|
||
|
||
|
||
def client_card(client: ClientApp) -> str:
|
||
badges: list[str] = []
|
||
if client.featured:
|
||
badges.append("⭐ featured")
|
||
if client.hwid:
|
||
badges.append("🪪 HWID")
|
||
badge_line = " · ".join(badges)
|
||
lines = [
|
||
f"<b>{client.name}</b>",
|
||
f"Core: <code>{client.core}</code>",
|
||
]
|
||
if badge_line:
|
||
lines.append(badge_line)
|
||
lines.extend(["", client.description, "", "Выбери платформу / ссылку:"])
|
||
return "\n".join(lines)
|