|
6 | 6 | from fastapi.responses import HTMLResponse |
7 | 7 |
|
8 | 8 | from app.db import AsyncSession |
9 | | -from app.db.crud.user import get_user_usages, user_sub_update |
10 | 9 | from app.db.crud.hwid import ( |
11 | 10 | get_user_hwid_by_value, |
12 | 11 | get_user_hwid_count, |
13 | 12 | register_user_hwid, |
14 | 13 | update_hwid_last_used, |
15 | 14 | ) |
| 15 | +from app.db.crud.user import get_user_usages, user_sub_update |
16 | 16 | from app.db.models import User |
17 | 17 | from app.models.admin import AdminDetails |
18 | | -from app.models.settings import Application, ConfigFormat, SubRule, Subscription as SubSettings, HWIDSettings |
| 18 | +from app.models.settings import Application, ConfigFormat, HWIDSettings, SubRule, Subscription as SubSettings |
19 | 19 | from app.models.stats import UserUsageStatsList |
20 | 20 | from app.models.subscription import SubscriptionUsageQuery |
21 | 21 | from app.models.user import SubscriptionUserResponse, UsersResponseWithInbounds |
22 | | -from app.settings import subscription_settings, hwid_settings |
| 22 | +from app.settings import hwid_settings, subscription_settings |
23 | 23 | from app.subscription.share import encode_title, generate_subscription, setup_format_variables |
24 | 24 | from app.templates import render_template |
25 | 25 | from config import template_settings, wireguard_settings |
@@ -496,29 +496,11 @@ def _build_raw_subscription_payload( |
496 | 496 | "headers": headers, |
497 | 497 | } |
498 | 498 |
|
499 | | - async def user_subscription_raw( |
500 | | - self, |
501 | | - db: AsyncSession, |
502 | | - token: str, |
503 | | - request_url: str = "", |
504 | | - update_user_agent: str = "", |
505 | | - ip: str | None = None, |
506 | | - x_hwid: str | None = None, |
507 | | - x_device_os: str | None = None, |
508 | | - x_ver_os: str | None = None, |
509 | | - x_device_model: str | None = None, |
510 | | - ): |
| 499 | + async def user_subscription_raw(self, db: AsyncSession, token: str, request_url: str = ""): |
511 | 500 | sub_settings: SubSettings = await subscription_settings() |
512 | 501 | db_user = await self.get_validated_sub(db, token) |
513 | 502 | user = await self.validated_user(db_user) |
514 | 503 |
|
515 | | - await self.validate_and_register_hwid( |
516 | | - db, db_user.id, db_user.hwid_limit, x_hwid, x_device_os, x_ver_os, x_device_model |
517 | | - ) |
518 | | - |
519 | | - if update_user_agent: |
520 | | - await user_sub_update(db, db_user.id, update_user_agent, ip=ip, hwid=x_hwid) |
521 | | - |
522 | 504 | links = [] |
523 | 505 | if sub_settings.allow_browser_config: |
524 | 506 | conf, _ = await self.fetch_config(user, ConfigFormat.links) |
|
0 commit comments