uu_pixiv_api / validSubCount.py
rogerxavier's picture
Upload 6 files
4117d38 verified
raw
history blame contribute delete
412 Bytes
#!/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)