randydev commited on
Commit
f56d232
1 Parent(s): 5a6bc28

Upload main.py

Browse files
Files changed (1) hide show
  1. main.py +80 -1
main.py CHANGED
@@ -384,6 +384,85 @@ async def hapyymod(q):
384
  res.append({"title": title, "link": link, "thumb": thumb})
385
  return {"status": 200, "creator": "@xtdevs", "result": res}
386
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
387
  @app.get("/akeno/happymod", response_model=SuccessResponse, responses={422: {"model": SuccessResponse}})
388
  async def happymods_(q: str):
389
  try:
@@ -2046,7 +2125,7 @@ def custom_openapi():
2046
  return app.openapi_schema
2047
  openapi_schema = get_openapi(
2048
  title="RyuzakiLib API",
2049
- version="4.1.1",
2050
  summary="Use It Only For Personal Project Else I Need To Delete The Api",
2051
  description=description,
2052
  routes=app.routes,
 
384
  res.append({"title": title, "link": link, "thumb": thumb})
385
  return {"status": 200, "creator": "@xtdevs", "result": res}
386
 
387
+ async def search_pornwhite_videos(query):
388
+ images = search_pornowhite(query)
389
+ data = []
390
+ for image in images:
391
+ data.append(scraper_pornowhite(image))
392
+ return data
393
+
394
+ def scraper_pornowhite(url):
395
+ response = requests.get(url)
396
+ response.raise_for_status()
397
+ soup = BeautifulSoup(response.text, "html.parser")
398
+ data = []
399
+ for meta in soup.select(".player meta"):
400
+ content = meta.get("content")
401
+ if content:
402
+ data.append(content)
403
+ return {
404
+ "title": data[0] if len(data) > 0 else None,
405
+ "thumbnail": data[2] if len(data) > 2 else None,
406
+ "video": data[4] if len(data) > 4 else None,
407
+ "date": data[5] if len(data) > 5 else None,
408
+ "url": data[6] if len(data) > 6 else None,
409
+ }
410
+
411
+ def search_pornowhite(query):
412
+ url = f"https://www.pornwhite.com/search/?q={query}"
413
+ response = requests.get(url)
414
+ response.raise_for_status()
415
+ soup = BeautifulSoup(response.text, "html.parser")
416
+ data = []
417
+ for a in soup.select("a"):
418
+ href = a.get("href")
419
+ if href and href.startswith("https://www.pornwhite.com/videos/"):
420
+ data.append(href)
421
+ return data
422
+
423
+ async def search_porn_images(query):
424
+ data = []
425
+ try:
426
+ url = f"https://www.pornpics.com/{query}/"
427
+ response = requests.get(url)
428
+ response.raise_for_status()
429
+ soup = BeautifulSoup(response.text, "html.parser")
430
+ for img in soup.select(".rel-link img"):
431
+ src = img.get("data-src")
432
+ if src:
433
+ data.append(src)
434
+ return data
435
+ except requests.exceptions.RequestException:
436
+ return []
437
+
438
+ @app.get("/akeno/pornpics", response_model=SuccessResponse, responses={422: {"model": SuccessResponse}})
439
+ async def pornpics(query: str):
440
+ try:
441
+ response = await search_porn_images(query)
442
+ return SuccessResponse(
443
+ status="True",
444
+ randydev={"results": response}
445
+ )
446
+ except:
447
+ return SuccessResponse(
448
+ status="False",
449
+ randydev={"error": "Error fucking"}
450
+ )
451
+
452
+ @app.get("/akeno/pornowhite", response_model=SuccessResponse, responses={422: {"model": SuccessResponse}})
453
+ async def pornowhite_new(query: str):
454
+ try:
455
+ response = await search_porn_videos(query)
456
+ return SuccessResponse(
457
+ status="True",
458
+ randydev={"results": response}
459
+ )
460
+ except:
461
+ return SuccessResponse(
462
+ status="False",
463
+ randydev={"error": "Error fucking"}
464
+ )
465
+
466
  @app.get("/akeno/happymod", response_model=SuccessResponse, responses={422: {"model": SuccessResponse}})
467
  async def happymods_(q: str):
468
  try:
 
2125
  return app.openapi_schema
2126
  openapi_schema = get_openapi(
2127
  title="RyuzakiLib API",
2128
+ version="4.1.2",
2129
  summary="Use It Only For Personal Project Else I Need To Delete The Api",
2130
  description=description,
2131
  routes=app.routes,