Update main.py
Browse files
main.py
CHANGED
|
@@ -61,13 +61,13 @@ async def starrail_card(id, designtype, character_id=None, character_art_url=Non
|
|
| 61 |
return await card.create(id, style=(2 if str(designtype) == "2" else 1))
|
| 62 |
else:
|
| 63 |
# Fallback to the existing process
|
| 64 |
-
async with starrailcard.Card(seeleland=True, remove_logo=True, character_art=character_art,boost_speed = True) as card:
|
| 65 |
return await card.create(id, style=(2 if str(designtype) == "2" else 1))
|
| 66 |
|
| 67 |
|
| 68 |
# Star Rail profile creation
|
| 69 |
async def starrail_profile(id):
|
| 70 |
-
async with starrailcard.Card(remove_logo=True, seeleland=True,boost_speed = True) as card:
|
| 71 |
return await card.create_profile(id, style=2)
|
| 72 |
|
| 73 |
# Genshin profile creation
|
|
@@ -144,11 +144,16 @@ def root():
|
|
| 144 |
return "خدتك عليه"
|
| 145 |
|
| 146 |
@app.get("/update")
|
| 147 |
-
async def
|
| 148 |
try:
|
| 149 |
-
# Update assets using
|
| 150 |
-
|
| 151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
except Exception as e:
|
| 153 |
error_details = traceback.format_exc()
|
| 154 |
return JSONResponse(
|
|
|
|
| 61 |
return await card.create(id, style=(2 if str(designtype) == "2" else 1))
|
| 62 |
else:
|
| 63 |
# Fallback to the existing process
|
| 64 |
+
async with starrailcard.Card(seeleland=True, remove_logo=True, character_art=character_art,boost_speed = True,enka=True) as card:
|
| 65 |
return await card.create(id, style=(2 if str(designtype) == "2" else 1))
|
| 66 |
|
| 67 |
|
| 68 |
# Star Rail profile creation
|
| 69 |
async def starrail_profile(id):
|
| 70 |
+
async with starrailcard.Card(remove_logo=True, seeleland=True,boost_speed = True,enka=True) as card:
|
| 71 |
return await card.create_profile(id, style=2)
|
| 72 |
|
| 73 |
# Genshin profile creation
|
|
|
|
| 144 |
return "خدتك عليه"
|
| 145 |
|
| 146 |
@app.get("/update")
|
| 147 |
+
async def update():
|
| 148 |
try:
|
| 149 |
+
# Update assets using EnkaNetworkAPI and ApiEnkaNetwork
|
| 150 |
+
async def update_assets() -> None:
|
| 151 |
+
async with EnkaNetworkAPI() as client:
|
| 152 |
+
await client.update_assets()
|
| 153 |
+
await enka.ApiEnkaNetwork().update_assets()
|
| 154 |
+
|
| 155 |
+
await asyncio.create_task(update_assets())
|
| 156 |
+
return JSONResponse(content={'response': 'Assets updated successfully'})
|
| 157 |
except Exception as e:
|
| 158 |
error_details = traceback.format_exc()
|
| 159 |
return JSONResponse(
|