Spaces:
Running
Running
File size: 412 Bytes
4117d38 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from fastapi import APIRouter,BackgroundTasks
def ValidSubCount(fileName:str)->int:
with open(fileName, "r") as f:
lines = f.readlines()
return len(lines)
router = APIRouter()
@router.get('/')
def returnValidSubCount():
# 获取当前剩余的有效订阅数量 (方便随时检测)
return ValidSubCount(router.fileName)
|