async def track_amazon(): headers = { "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36' } ws = get_all_urls() if len(ws) == 0: return kk = get_all_tracker() for url in kk.amazon_url: for pm in kk.budget: page = requests.get(url, headers=headers) soup = BeautifulSoup(page.content, 'html.parser') title = soup.find(id="productTitle").get_text() price = soup.find(id="priceblock_ourprice").get_text() title = title.strip() price = price[2:].split(',') price = round(float("".join(price))) if (price <= pm): await borg.send_message( Config.PRIVATE_GROUP_ID, f"#Tracker - Price Reduced \nProduct Name : {title} \nCurrent price : {price}" ) rm_tracker(str(url)) else: pass
async def _(event): if event.fwd_from: return await event.edit("`Processing..`") url = event.text.split(" ", maxsplit=1)[1] if url == "all": ws = get_all_urls() for i in ws: try: rm_tracker(str(i)) except: pass await event.edit("Sucessfully Removed All Trackers") if not is_tracker_in_db(str(url)): await event.edit("**Tracker Not Found In Db**") return rm_tracker(str(url)) await event.edit(f"**Sucessfully Removed From TrackerList**")