randydev commited on
Commit
d4cf293
1 Parent(s): 0ec25f2

Upload main.py

Browse files
Files changed (1) hide show
  1. main.py +25 -18
main.py CHANGED
@@ -50,6 +50,7 @@ from serpapi import GoogleSearch
50
  from fastapi import FastAPI, UploadFile, File
51
  from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
52
  from fastapi import Depends, FastAPI, HTTPException, status
 
53
  from fastapi.responses import StreamingResponse
54
  from fastapi import HTTPException
55
  from fastapi import FastAPI, Request, Header
@@ -87,24 +88,7 @@ client_mongo = MongoClient(MONGO_URL)
87
  db = client_mongo["tiktokbot"]
88
  collection = db["users"]
89
 
90
- description = """
91
- - Ryuzaki Library: [Library Here](https://github.com/TeamKillerX/RyuzakiLib)
92
-
93
- •Developed by [@xtdevs](https://t.me/xtdevs)
94
- """
95
-
96
- app = FastAPI(
97
- title="RyuzakiLib API",
98
- description=description,
99
- version="1.3.1",
100
- terms_of_service="Use It Only For Personal Project Else I Need To Delete The Api",
101
- contact={
102
- "name": "RyuzakiLib",
103
- "url": "https://t.me/xtdevs",
104
- "email": "[email protected]",
105
- },
106
- docs_url="/"
107
- )
108
 
109
  def get_all_api_keys():
110
  user = collection.find({})
@@ -969,3 +953,26 @@ def myfile(link: Union[str, None] = None):
969
  return jsondata
970
  except:
971
  return "{'status': 'false', 'message': 'Invalid Link'}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  from fastapi import FastAPI, UploadFile, File
51
  from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
52
  from fastapi import Depends, FastAPI, HTTPException, status
53
+ from fastapi.openapi.utils import get_openapi
54
  from fastapi.responses import StreamingResponse
55
  from fastapi import HTTPException
56
  from fastapi import FastAPI, Request, Header
 
88
  db = client_mongo["tiktokbot"]
89
  collection = db["users"]
90
 
91
+ app = FastAPI()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
 
93
  def get_all_api_keys():
94
  user = collection.find({})
 
953
  return jsondata
954
  except:
955
  return "{'status': 'false', 'message': 'Invalid Link'}"
956
+
957
+ description = """
958
+ - Ryuzaki Library: [Library Here](https://github.com/TeamKillerX/RyuzakiLib)
959
+
960
+ •Developed by [@xtdevs](https://t.me/xtdevs)
961
+ """
962
+ def custom_openapi():
963
+ if app.openapi_schema:
964
+ return app.openapi_schema
965
+ openapi_schema = get_openapi(
966
+ title="RyuzakiLib API",
967
+ version="1.3.1",
968
+ summary="Use It Only For Personal Project Else I Need To Delete The Api",
969
+ description=description,
970
+ routes=app.routes,
971
+ )
972
+ openapi_schema["info"]["x-logo"] = {
973
+ "url": "https://github-production-user-asset-6210df.s3.amazonaws.com/90479255/289277800-f26513f7-cdf4-44ee-9a08-f6b27e6b99f7.jpg"
974
+ }
975
+ app.openapi_schema = openapi_schema
976
+ return app.openapi_schema
977
+
978
+ app.openapi = custom_openapi