2025-03-30 22:49:37 +08:00

88 lines
2.8 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import hashlib
import random
def md5(s: str) -> str:
m = hashlib.md5()
m.update(s.encode('utf-8'))
return m.hexdigest()
def get_proxies():
username = "t14131310374591"
password = "qg6xwmrq"
tunnel = "d432.kdltps.com:15818"
proxies = {
"http": "http://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel},
"https": "http://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel}
}
return proxies
def get_all_cookies():
cookies_holder = []
def inner():
if not cookies_holder:
for line in open('./data/live_cookies.txt', 'r'):
line = line.strip()
if line:
cookies_holder.append(line)
return cookies_holder
return inner()
def report_keywords():
return [
"成人", "av", "亚洲", "日韩", "欧美", "国产", "无码", "黄色", "丝袜", "少妇", "人妻"
]
def get_reporter_name():
surnames = [
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
]
# 常用名字字
name_characters = [
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
]
xing = random.choice(surnames)
ming = random.choice(name_characters)
ming2 = random.choice(name_characters)
if random.choice([True, False]):
return f"{xing}{ming}"
else:
return f"{xing}{ming}{ming2}"
def generate_random_phone_number():
"""
随机生成一个国内11位手机号
"""
# 常见的手机号段前3位移动、联通、电信等
prefixes = [
"134", "135", "136", "137", "138", "139", # 移动号段
"150", "151", "152", "157", "158", "159", # 移动号段
"130", "131", "132", "155", "156", # 联通号段
"133", "153", "180", "181", "189", # 电信号段
"177", "173", "175", # 其他号段
"199", "198", "166", # 新号段
"186", "187", "188", "139" # 常见号段
]
# 随机选择一个前缀
prefix = random.choice(prefixes)
# 随机生成剩余的8位数字
suffix = ''.join(random.choices("0123456789", k=8))
# 返回完整的手机号
return prefix + suffix