def translate_message_to_porn(message, config): keywords = [message] client = pornhub.PornHub(keywords=keywords) photos = [] for photo_url in client.getPhotos(3, random.randint(1,3)): photos.append(photo_url) return photos[random.randint(0, len(photos)-1)]
def pornhub_search(word1, word2): keywords = [word1, word2] client = pornhub.PornHub(keywords) result = [] for video in client.getVideos(10, page=2): result.append(video["url"]) result.append(video["name"]) result.append(video["duration"]) result.append(video["rating"]) result.append(video["background"]) return result
async def pornhub(self, ctx, *, searchTerm: str = "Sex"): await self.bot.safe_delete(ctx.message) if not ctx.message.channel.is_nsfw(): return await self.channel_is_blocked(ctx) permCheck, err = (await self.bot.permissions_hasrole(self, ctx.message.author, "canusensfw")) if permCheck: loadingMessage = await ctx.send( f"``Searching for {searchTerm}. Please wait...`` :hourglass_flowing_sand:" ) phClient = None phURL = None phClient = pornhub.PornHub(list(searchTerm)) phURL = "" videos = [] for x in phClient.getVideos(100, page=1): videos.append(x) video = videos[random.randint(0, len(videos) - 1)] phURL = video["background"] embed = discord.Embed(title="For " + ctx.message.author.name + ". Search : " + searchTerm, color=(await self.bot.generate_embedcolor())) embed.set_image(url=str(phURL)) embed.set_footer(text="Will Self-Destruct in 20 seconds") embed.add_field(name="URL", value=str(video["url"]), inline=False) await ctx.send(embed=embed, delete_after=20) try: await loadingMessage.delete() except Exception: pass else: await ctx.send(embed=(await self.bot.generate_error(self, err))) return
def on_chat_message(msg): content_type, chat_type, chat_id = telepot.glance(msg) print(msg) if content_type == "text": text = msg["text"].lower() if text.startswith("/start"): requests.post( "https://api.telegram.org/bot885925187:AAH9GMyKo6EICdqKc5hzHqzXj2Qxyj_PPMQ/sendMessage?chat_id=" + str(chat_id) + "&text=Buongiorno " + msg["from"]["first_name"] + ", ti auguro di gustarti un buon caffè gratis. 🤙") elif text.startswith("/ping"): requests.post( "https://api.telegram.org/bot885925187:AAH9GMyKo6EICdqKc5hzHqzXj2Qxyj_PPMQ/sendMessage?chat_id=" + str(chat_id) + "&text=Pong.") elif text.startswith("/ph/"): total = [] search_keywords = [] cat = text[4:] search_keywords.append(cat) client = pornhub.PornHub(search_keywords) for video in client.getVideos(10, page=1): total.append(video) for i in total: requests.get( "https://api.telegram.org/bot885925187:AAH9GMyKo6EICdqKc5hzHqzXj2Qxyj_PPMQ/sendPhoto", verify=True, data={ "chat_id": chat_id, "photo": i["background"], "caption": """Title :{0}\nUrl: {1}\nDuration: {2}\nRating: {3}%""" .format(i["name"], i["url"], i["duration"], i["rating"]), "reply_to_message_id": msg["message_id"] })
async def porn_search(keyword): search_keywords = [keyword] pornhub.client = pornhub.PornHub(search_keywords) for video in pornhub.client.getVideos(5, page=100): await client.say(str(video["name"] + " " + video["url"]))
def allinone(url): res = '' if 'm.acfun.cn' in url: import acfun res = acfun.AcFun(url) elif 'm.hanyuhl.com' in url: import before res = before.Before(url) elif 'bilibili.com' in url: import bilibili res = bilibili.BiLiPhone(url) elif 'h5.hibixin.com' in url: import bixin res = bixin.BiXin(url) elif 'www.xinpianchang.com' in url: import changku res = changku.ChangKuVideo(url) elif 'p.doupai.cc' in url: import doupai res = doupai.DouPai(url) elif 'v.douyin.com' in url: import douyin2_parse res = douyin2_parse.DouYin2(url) elif 'haokan.baidu.com' in url: import haokan res = haokan.HaoKan(url) elif 'share.huoshan.com' in url: import huoshan_parse res = huoshan_parse.HuoShan(url) elif 'v.huya.com' in url: import huya res = huya.HuYa(url) elif 'www.eyepetizer.net' in url: import kaiyan_parse res = kaiyan_parse.OpenEye(url) elif 'video.kuaishou.com' in url: import kuaishou res = kuaishou.KuaiShou(url) elif 'www.17kuxiu.com' in url: import kuxiu res = kuxiu.KuXiu(url) elif 'm.oasis.weibo.cn' in url: import lvzhou res = lvzhou.LvZhou(url) elif 'n.miaopai.com' in url: import miaopai_parse res = miaopai_parse.MiaoPai(url) elif 'm.immomo.com' in url: import momo res = momo.MoMo(url) elif 'www.pearvideo.com' in url: import pear res = pear.PearVideo(url) elif 'h5.ippzone.com' in url: import pipi_funny res = pipi_funny.PiPiFunny(url) elif 'h5.pipix.com' in url: import pipixia res = pipixia.PiPiXia(url) elif 'pornhub.com' in url: import pornhub res = pornhub.PornHub(url) elif 'quanmin.baidu.com' in url: import quanmin res = quanmin.QuanMin(url) elif 'qq.com' in url: import quanmin_kge res = quanmin_kge.KGe(url) elif 'xhslink.com' in url: import xhs_parse res = xhs_parse.XiaoHongShu(url) elif 'mobile.xiaokaxiu.com' in url: import xiaokaxiu_parse res = xiaokaxiu_parse.XiaoKaXiu(url) elif 'www.ixigua.com' in url: import xigua res = xigua.XiGua(url) elif 'share.izuiyou.com' in url: import zuiyou res = zuiyou.ZuiYou(url) elif 'v.6.cn' in url: import sixroom res = sixroom.sixRoom(url) elif 'm.vuevideo.net' in url: import vue_parse res = vue_parse.Vue(url) elif 'weibo.com' in url: import weibo res = weibo.WeiBo(url) elif 'h5.weishi.qq.com' in url: import weishi_parse res = weishi_parse.WeiShi(url) else: return '未匹配到相关接口' if res != '': # print(res.get_video()) return res.get_video()
keyword, html = fetch_results(search_term, number_results, language_code) results = parse_results(html, keyword) return results except AssertionError: raise Exception("Incorrect arguments parsed to function") except requests.HTTPError: raise Exception("You appear to have been blocked by Google") except requests.RequestException: raise Exception("Appears to be an issue with your connection") if __name__ == '__main__': data = [] youtube_data = [] i = 0 try: #exemple client = pornhub.PornHub() keywords = ["teen", "milf"] client = pornhub.PornHub(keywords) for video in client.getVideos(10, page=2): print(video) print(video["url"]) except Exception as e: print(e) finally: time.sleep(5)
import pornhub from multiprocessing import queue import queue search_keywords = [] client = pornhub.PornHub(search_keywords) for star in client.getStars(10): print star print star["mako oda"] for video in client.getVideos(10,page=2): print video for photo_url in client.getPhotos(5): print photo_url print "All done!"
import pornhub search_keywords = [] client = pornhub.PornHub(search_keywords) for star in client.getStars(10): print star print star["name"] for video in client.getVideos(10, page=2): print video for photo_url in client.getPhotos(5): print photo_url print "All done!"
import subprocess import pornhub import youtube_dl import subtitler NUM_VIDEOS = 1 DOWNLOAD = True search_keywords = [] client = pornhub.PornHub(keywords=search_keywords, pro=True, sort="mv", timeframe="a") ydl_opts = { 'postprocessors': [{ 'key': 'FFmpegExtractAudio', 'preferredcodec': 'wav', }], "outtmpl": "%(id)s.%(ext)s", "keepvideo": "True" } filenames = [] with youtube_dl.YoutubeDL(ydl_opts) as ydl: for video in client.getVideos(NUM_VIDEOS, page=1): vid_url = video['url'] filename = vid_url.split("=")[-1] + ".wav"
async def on_message(message): if message.author.id != 776812266048716804: for word in HelloList: if word in message.content.lower(): await message.add_reaction("👋") for word in ByeList: if word in message.content.lower(): await message.add_reaction("🤙") if isinstance(message.channel, PrivateChannel) == True: if message.author != bot.user: #''' Python Types ''' if message.content == "str": await message.channel.send("String") elif message.content == "numbers": await message.channel.send( "Integers, Floating point number, complex") elif message.content == "bool": await message.channel.send("Boolean") #''' Python Conversions ''' elif message.content == "types": await message.channel.send("Conversions entre types") elif message.content == "tables": await message.channel.send("Conversions entre tables") #''' Python Listes ''' elif message.content == "listes": await message.channel.send( "https://python.sdv.univ-paris-diderot.fr/04_listes/") #Pour les dictionnaires, on se référe à juste en desous #''' Python Dictionnaires ''' elif message.content == "dictionnaires": await message.channel.send( "https://python.sdv.univ-paris-diderot.fr/13_dictionnaires_tuples_sets/" ) #''' NSFW made for fun''' elif message.content == "p**n": import pornhub client = pornhub.PornHub() for video in client.getVideos(1, page=1): url = video['background'] r = requests.get(url, allow_redirects=False) open( str(video['rating']) + str(message.author.id) + '.jpg', 'wb').write(r.content) with open( str(video['rating']) + str(message.author.id) + '.jpg', 'rb') as fh: f = discord.File(fh, filename=str(video['rating']) + str(message.author.id) + '.jpg') embed = discord.Embed(title=str(video['name']), description="[Voir la vidéo](" + str(video['url']) + ")") embed.set_image(url='attachment://' + str(video['rating']) + str(message.author.id) + '.jpg') embedPrevention = discord.Embed( title= "Attention, du contenu potentiellement pornographique va apparaître. Souhaitez-vous continuer ?", color=discord.Colour(0xed1f20)) await message.author.send(embed=embedPrevention) await bot.wait_for( 'message', check=lambda message: message.content == "oui") print(message.author + " is horny") await message.author.send(file=f, embed=embed) fh.close() os.remove( str(video['rating']) + str(message.author.id) + '.jpg') elif message.content == "oui": response = True elif message.content == "non": response = False #Command didn't exist or non usable on dm else: embed = discord.Embed( title= "Cette commande n'existe pas ou bien n'est pas utilisable en mp !", color=discord.Colour(0xed1f20)) await message.channel.send(embed=embed) else: pass else: pass await bot.process_commands(message)