BuffIO to read PDF COntent
This commit is contained in:
@@ -2,6 +2,7 @@ import nextcord as nc
|
||||
from nextcord.ext import commands
|
||||
from typing import Optional
|
||||
import asyncio
|
||||
import io
|
||||
import os
|
||||
import requests as req
|
||||
from bs4 import BeautifulSoup as soup
|
||||
@@ -30,7 +31,7 @@ async def search(txt):
|
||||
|
||||
async def getPDF(url):
|
||||
resp = req.get(url, stream=True)
|
||||
pdf = resp.content
|
||||
pdf = io.BytesIO(resp.content)
|
||||
pages = pdftotext.PDF(pdf)
|
||||
return "\n\n".join(pages)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user