Esempio n. 1
0
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))
Esempio n. 2
0
def help():
    main.send_msg("""```
RipVid Usage :
.ripaud youtubelink

downloads songs and shares in the active chat.
    ```""")
Esempio n. 3
0
def help():
    main.send_msg("""```
RipVid Usage :
.ripvid youtubelink

downloads youtube video and shares in the active chat.
    ```""")
Esempio n. 4
0
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']))
Esempio n. 5
0
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)
Esempio n. 6
0
def cow(placebo):
    main.send_msg("""```
 ____________________________
/ Cow Module bullshit        \\
\               - jeel 2021  /
 ----------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\\
                ||----w |
                ||     ||
```""")
Esempio n. 7
0
def fuckyou(placebo):
    main.send_msg('''
.............../´¯/) 
.............,/¯../ 
............/..../ 
....../´¯/'...'/´¯¯`·¸ 
.../'/.../..../......./¨¯\ 
.('(...´...´.... ¯~/'...') 
..\.................'...../ 
...''...\.......... _.·´ 
.....\..............( 
.......\.............\...
''')
Esempio n. 8
0
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))
Esempio n. 9
0
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)
Esempio n. 10
0
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)
Esempio n. 11
0
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))
Esempio n. 12
0
def help():
    main.send_msg("```Uploads Image to google and sends link to look up```")
Esempio n. 13
0
def help():
    main.send_msg("```Uploads Image to Yandex and sends link to look up```")
Esempio n. 14
0
def help():
    main.send_msg("```just a placebo module to check if the bot is alive.```")
Esempio n. 15
0
def help():
    main.send_msg("```Searches and sends back images of the text input```")
Esempio n. 16
0
def calc(args):
    if args == "":
        main.send_msg("```evaluated the Void!```")
    else:
        main.send_msg(str(eval(args)))
Esempio n. 17
0
def help():
    main.send_msg("```calculates stuff for your lazy ass```")
Esempio n. 18
0
def help():
    main.send_msg("```meme-ifies the given image.```")
Esempio n. 19
0
def help():
    main.send_msg("```shut the f**k up weeb```")
Esempio n. 20
0
def help():
    main.send_msg("```Sends Posts from reddit, yay! -_-```")
Esempio n. 21
0
def help():
    main.send_msg("""
```Get sticker in PNG and GIF format```
""")
Esempio n. 22
0
def help():
    main.send_msg("```Says F**K YOU, literally.```")