randydev commited on
Commit
37032fc
1 Parent(s): 32c473b

Upload main.py

Browse files
Files changed (1) hide show
  1. main.py +36 -18
main.py CHANGED
@@ -289,12 +289,6 @@ async def youtube_api(payload: YouTubeBase):
289
  randydev={"error": f"An error occurred: {str(e)}"}
290
  )
291
 
292
- class XnxxSearch(BaseModel):
293
- q: str
294
-
295
- class XnxxLinks(BaseModel):
296
- url: str
297
-
298
  async def toanime(input):
299
  try:
300
  image = Image.open(input)
@@ -324,15 +318,9 @@ async def toanime(input):
324
  return 'Identifikasi Gagal'
325
 
326
  @app.get("/akeno/toanime", response_model=SuccessResponse, responses={422: {"model": SuccessResponse}})
327
- async def toanime_endpoint(file: UploadFile = File(...)):
328
- file_path = f"./uploads/{file.filename}"
329
- try:
330
- with open(file_path, "wb") as f:
331
- f.write(await file.read())
332
- except Exception:
333
- raise HTTPException(status_code=500, detail="Failed to save file")
334
  try:
335
- response = await toanime(file_path)
336
  url_image = response["image_data"]
337
  return SuccessResponse(
338
  status="True",
@@ -343,15 +331,42 @@ async def toanime_endpoint(file: UploadFile = File(...)):
343
  status="False",
344
  randydev={"error": "Error during processing"}
345
  )
346
- finally:
347
- if os.path.exists(file_path):
348
- os.remove(file_path)
349
 
350
  async def api_tools_fix(name, ok, query):
351
  url = f"https://tools.betabotz.eu.org/tools/{name}?{ok}={query}"
352
  response = requests.get(url).json()
353
  return response
354
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
  @app.get("/akeno/xnxxsearch", response_model=SuccessResponse, responses={422: {"model": SuccessResponse}})
356
  async def xnxx_search(query: str):
357
  try:
@@ -402,9 +417,12 @@ async def instagramdl(link: str):
402
  try:
403
  response = await api_tools_fix(name="instagramdl", ok="url", query=link)
404
  result = response.get("result", {})
 
 
 
405
  return SuccessResponse(
406
  status="True",
407
- randydev={"results": result}
408
  )
409
  except:
410
  return SuccessResponse(
 
289
  randydev={"error": f"An error occurred: {str(e)}"}
290
  )
291
 
 
 
 
 
 
 
292
  async def toanime(input):
293
  try:
294
  image = Image.open(input)
 
318
  return 'Identifikasi Gagal'
319
 
320
  @app.get("/akeno/toanime", response_model=SuccessResponse, responses={422: {"model": SuccessResponse}})
321
+ async def toanimes(link=None):
 
 
 
 
 
 
322
  try:
323
+ response = await toanime(link)
324
  url_image = response["image_data"]
325
  return SuccessResponse(
326
  status="True",
 
331
  status="False",
332
  randydev={"error": "Error during processing"}
333
  )
 
 
 
334
 
335
  async def api_tools_fix(name, ok, query):
336
  url = f"https://tools.betabotz.eu.org/tools/{name}?{ok}={query}"
337
  response = requests.get(url).json()
338
  return response
339
 
340
+ @app.get("/akeno/facebookdl", response_model=SuccessResponse, responses={422: {"model": SuccessResponse}})
341
+ async def facebookdl_(link: str):
342
+ try:
343
+ response = await api_tools_fix(name="facebookdl", ok="url", query=link)
344
+ result = response.get("result", {})
345
+ return SuccessResponse(
346
+ status="True",
347
+ randydev={"results": result}
348
+ )
349
+ except:
350
+ return SuccessResponse(
351
+ status="False",
352
+ randydev={"error": "Error fucking"}
353
+ )
354
+
355
+ @app.get("/akeno/tiktokdl", response_model=SuccessResponse, responses={422: {"model": SuccessResponse}})
356
+ async def tiktokdl_(link: str):
357
+ try:
358
+ response = await api_tools_fix(name="tiktokdl", ok="url", query=link)
359
+ result = response.get("result", {})
360
+ return SuccessResponse(
361
+ status="True",
362
+ randydev={"results": result}
363
+ )
364
+ except:
365
+ return SuccessResponse(
366
+ status="False",
367
+ randydev={"error": "Error fucking"}
368
+ )
369
+
370
  @app.get("/akeno/xnxxsearch", response_model=SuccessResponse, responses={422: {"model": SuccessResponse}})
371
  async def xnxx_search(query: str):
372
  try:
 
417
  try:
418
  response = await api_tools_fix(name="instagramdl", ok="url", query=link)
419
  result = response.get("result", {})
420
+ wm = results.get("wm").replace("Powered By Betabotz", "Powered By Randydev")
421
+ thumbnail = results.get("thumbnail")
422
+ _url = results.get("_url")
423
  return SuccessResponse(
424
  status="True",
425
+ randydev={"wm": wm, "thumb": thumbnail, "url": _url}
426
  )
427
  except:
428
  return SuccessResponse(