first commit

This commit is contained in:
“xHuPo” 2024-10-17 12:01:35 +08:00
parent 973c47ff25
commit 4b01ff4c75
5 changed files with 40 additions and 21 deletions

View file

@ -6,7 +6,7 @@ from logger import logger
COMMON_HEADERS = {
"Content-Type": "text/plain;charset=UTF-8",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
"Referer": "https://suno.com",
"Referer": "https://suno.com/",
"Origin": "https://suno.com",
}
@ -37,7 +37,7 @@ async def fetch(url, headers=None, data=None, method="POST"):
async def get_feed(url, ids, token):
headers = {"Authorization": f"Bearer {token}"}
api_url = f"{url}/api/feed/?ids={ids}"
api_url = f"{url}/api/feed/v2?ids={ids}"
response = await fetch(api_url, headers, method="GET")
return response
@ -70,7 +70,8 @@ async def get_credits(url,token):
"credits_left": respose['total_credits_left'],
"period": respose['period'],
"monthly_limit": respose['monthly_limit'],
"monthly_usage": respose['monthly_usage']
"monthly_usage": respose['monthly_usage'],
"subscription_type": respose['subscription_type']
}
async def recharge(url,data, token):
@ -86,5 +87,5 @@ async def get_expire(cookie):
logger.error("Invalid cookie at get expire")
raise
headers = {"Cookie": cookie}
api_url = "https://clerk.suno.com/v1/client?_clerk_js_version=5.16.1"
api_url = "https://clerk.suno.com/v1/client?_clerk_js_version=5.26.1"
return await fetch(api_url, headers, method="GET")