def reddit(input): print(input) args = input.split(" ") print(args) if input == "": main.send_msg("```no subreddit requested!```") else: page = requests.get( f'https://www.reddit.com/r/{input}/new/.json').json() if 'error' in page.keys(): print('retry?') main.time.sleep(1) reddit(input) else: imageurl = page['data']['children'][0]['data'][ 'url_overridden_by_dest'] print(imageurl) print(os.path.basename(imageurl)) imagetitle = page['data']['children'][0]['data']['title'] postlonk = 'www.reddit.com' + page['data']['children'][0]['data'][ 'permalink'] print(imageurl, imagetitle, postlonk) pic = open('download/' + os.path.basename(imageurl), 'xb') pic.write(requests.get(imageurl, allow_redirects=True).content) main.media_with_caption('download/' + os.path.basename(imageurl), f'{imagetitle}\n\n{postlonk}') os.remove('download/' + os.path.basename(imageurl))
def help(): main.send_msg("""``` RipVid Usage : .ripaud youtubelink downloads songs and shares in the active chat. ```""")
def help(): main.send_msg("""``` RipVid Usage : .ripvid youtubelink downloads youtube video and shares in the active chat. ```""")
def grev(args): try: main.replied_media() name = "sticker/replied.png" except: name = "sticker/" + getsticker("x") print(name) searchUrl = "https://www.google.com/searchbyimage/upload" multipart = { "encoded_image": (name, open(name, "rb")), "image_content": "" } response = requests.post( searchUrl, files=multipart, allow_redirects=False, headers={ "User-Agent": "Mozilla/5.0 (Linux; Android 10; SM-G975F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Mobile Safari/537.36" }) if response == 400: main.send_msg("**Google told me to f**k off.**") else: sauce = BeautifulSoup(response.text) main.send_msg(str(sauce.a['href']))
def help(args): if args == "": modlist = 'Available Modules : \n\n' for i in main.mods: if i == "help": pass else: modlist = modlist + "• " + i + "\n" main.send_msg(modlist) else: main.helpinside(args)
def cow(placebo): main.send_msg("""``` ____________________________ / Cow Module bullshit \\ \ - jeel 2021 / ---------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\\ ||----w | || || ```""")
def fuckyou(placebo): main.send_msg(''' .............../´¯/) .............,/¯../ ............/..../ ....../´¯/'...'/´¯¯`·¸ .../'/.../..../......./¨¯\ .('(...´...´.... ¯~/'...') ..\.................'...../ ...''...\.......... _.·´ .....\..............( .......\.............\... ''')
def ripaud(context): print("context" + context) if context == "": main.send_msg("No Download Link found") else: try: os.remove("YTDL/ytdlaudio.mp3") except: pass if "://" not in str(context): results = ys(context, max_results=1).to_dict() youtubeurl = 'youtube.com' + results[0]['url_suffix'] print(youtubeurl) else: youtubeurl = context print("youtubeurl :" + youtubeurl) main.send_msg("starting download!") list = [str(youtubeurl)] print(list) try: with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download(list) main.send_msg("download finished, sending audio..") main.send_media("YTDL/ytdlaudio.mp3") except youtube_dl.utils.DownloadError as e: main.send_msg(str(e))
def yrev(args): try: main.replied_media() name = "sticker/replied.png" except: name = "sticker/" + getsticker("x") searchUrl = 'https://yandex.ru/images/search' files = {'upfile': ('blob', open(name, 'rb'), 'image/jpeg')} params = { 'rpt': 'imageview', 'format': 'json', 'request': '{"blocks":[{"block":"b-page_type_search-by-image__link"}]}' } response = requests.post(searchUrl, params=params, files=files) if "captcha" in response.json(): main.send_msg("```f*****g captcha!```") else: query_string = json.loads( response.content)['blocks'][0]['params']['url'] img_search_url = searchUrl + '?' + query_string main.send_msg(img_search_url)
def rbg(args): try: uri = main.replied_media() bytes = main.get_file_content_chrome(uri) f = open("sticker/remove.png", "wb") f.write(bytes) f.close() name = "sticker/replied.png" except: name = "sticker/" + getsticker("x") print(name) response = requests.post( 'https://api.remove.bg/v1.0/removebg', files={'image_file': open(name, 'rb')}, data={'size': 'auto'}, headers={'X-Api-Key': os.environ['REM_BG_API']}, ) if response.status_code == requests.codes.ok: with open('sticker/no-bg.png', 'wb') as out: out.write(response.content) main.send_media('sticker/no-bg.png') else: main.send_msg("Error:", response.status_code, response.text)
def ripvid(context): if context == "": main.send_msg("No Download Link found") else: try: os.remove("YTDL/ytdlvideo.mp4") except: pass main.send_msg("starting download!") list = [str(context)] print(list) try: with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download(list) main.send_msg("download finished, sending video..") main.send_media("YTDL/ytdlvideo.mp4") except youtube_dl.utils.DownloadError as e: main.send_msg(str(e))
def help(): main.send_msg("```Uploads Image to google and sends link to look up```")
def help(): main.send_msg("```Uploads Image to Yandex and sends link to look up```")
def help(): main.send_msg("```just a placebo module to check if the bot is alive.```")
def help(): main.send_msg("```Searches and sends back images of the text input```")
def calc(args): if args == "": main.send_msg("```evaluated the Void!```") else: main.send_msg(str(eval(args)))
def help(): main.send_msg("```calculates stuff for your lazy ass```")
def help(): main.send_msg("```meme-ifies the given image.```")
def help(): main.send_msg("```shut the f**k up weeb```")
def help(): main.send_msg("```Sends Posts from reddit, yay! -_-```")
def help(): main.send_msg(""" ```Get sticker in PNG and GIF format``` """)
def help(): main.send_msg("```Says F**K YOU, literally.```")