Skip to content

Commit

Permalink
fix htp names
Browse files Browse the repository at this point in the history
  • Loading branch information
weebzone authored Oct 28, 2022
1 parent f2b9977 commit 7fa2750
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bot/modules/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,7 @@ def scrapper(update, context):
links.append(a['href'])
for o in links:
url = f"https://htpmovies.lol"+o
purl = htpmovies(url)
res = rget(purl)
soup = BeautifulSoup(res.content, "html.parser")
title = soup.title.get_text()
reftxt = resub(r'www\S+', '', title)
prsd += f'{reftxt} {purl}\n\n'
prsd += htpmovies(url) + '\n\n'
if len(prsd) > 4000:
deleteMessage(context.bot, sent)
sendMessage(prsd, context.bot, update.message)
Expand Down Expand Up @@ -145,9 +140,14 @@ def htpmovies(link):
h = { "x-requested-with": "XMLHttpRequest" }
sleep(10)
r = client.post(f"{DOMAIN}/links/go", data=data, headers=h)
p = get(r.json()['url'])
soup = BeautifulSoup(p.text, "html.parser")
title = soup.title.get_text()
reftxt = re.sub(r'www\S+', '', title)
final = r.json()['url']
try:
return r.json()['url']
except: return "Something went Wrong :("
return f'{reftxt} {final}\n\n'
except: return "Something went wrong :("

srp_handler = CommandHandler(BotCommands.ScrapeCommand, scrapper,

Expand Down

0 comments on commit 7fa2750

Please sign in to comment.