#!/usr/bin/env python # -*- coding: UTF-8 -*- #author:Wos import requests import os import random import pyperclip import string import time import urllib.parse xff = "" cnt = 0 cookie = "CLIPSHARE=rndn25n1q0osvkvli65vdvcfgf; language=cn_CN" def random_ip(): global xff,cookie s=string.ascii_lowercase+string.digits random.seed(time.time()*9) a=random.randint(1,255) b=random.randint(1,255) c=random.randint(1,255) d=random.randint(1,255) xff = (str(a)+'.'+str(b)+'.'+str(c)+'.'+str(d)) cookie = "language=cn_CN; CLIPSHARE="+''.join(random.sample(s,26)) return def get_91porn(url): global cnt url_ = url hdr4 = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Waterfox/78.13.0", "Cookie": cookie, 'X-Forwarded-For':xff } while True: try: r = requests.get(url,headers=hdr4,timeout=(3,7)) url2 = r.text.split("document.write(strencode2(\"")[1].split("\"));")[0] result = urllib.parse.unquote(url2) data = result.split("src=\'")[1].split("\'")[0] cnt = 0 return data except: if cnt < 3: random_ip() cnt += 1 return get_91porn(url_) else: cnt = 0 pyperclip.copy("") return def automode(): pyperclip.copy("") while True: os.system('clear') print("Right click to copy the video link of interest and wait 1~2 seconds") print("Ctrl+C to close") try: url = pyperclip.paste() if str(url).strip() == "": time.sleep(3) continue elif str(url).startswith("https://www.91porn.com") or str(url).startswith("https://91porn.com"): result = get_91porn(url) pyperclip.copy(result) cmdline = ("mpv --really-quiet --ontop \"%s\""%(result)) os.system(cmdline) continue else: time.sleep(3) continue except KeyboardInterrupt: return if __name__ == '__main__': random_ip() automode()