randydev commited on
Commit
a3a3e86
1 Parent(s): f56d232

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -7
main.py CHANGED
@@ -384,14 +384,14 @@ async def hapyymod(q):
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")
@@ -408,7 +408,7 @@ def scraper_pornowhite(url):
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()
@@ -450,9 +450,9 @@ async def pornpics(query: str):
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}
 
384
  res.append({"title": title, "link": link, "thumb": thumb})
385
  return {"status": 200, "creator": "@xtdevs", "result": res}
386
 
387
+ def search_pornwhite_videos(query):
388
+ images = _search_porn(query)
389
  data = []
390
  for image in images:
391
+ data.append(_scraper_porn(image))
392
  return data
393
 
394
+ def _scraper_porn(url):
395
  response = requests.get(url)
396
  response.raise_for_status()
397
  soup = BeautifulSoup(response.text, "html.parser")
 
408
  "url": data[6] if len(data) > 6 else None,
409
  }
410
 
411
+ def _search_porn(query):
412
  url = f"https://www.pornwhite.com/search/?q={query}"
413
  response = requests.get(url)
414
  response.raise_for_status()
 
450
  )
451
 
452
  @app.get("/akeno/pornowhite", response_model=SuccessResponse, responses={422: {"model": SuccessResponse}})
453
+ async def pornowhite_(query: str):
454
  try:
455
+ response = search_porn_videos(query)
456
  return SuccessResponse(
457
  status="True",
458
  randydev={"results": response}