remove lfs
This commit is contained in:
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:249b62caa7922fecea19e69989bb1ff7259cc37d6ce4ee78fb16abce6acb6720
|
|
||||||
size 7066775
|
|
Binary file not shown.
Binary file not shown.
104
pinyin/gen.py
104
pinyin/gen.py
@ -1,53 +1,53 @@
|
|||||||
t='''毕思淼
|
t='''毕思淼
|
||||||
毕一聪
|
毕一聪
|
||||||
丛金旺
|
丛金旺
|
||||||
崔子豪
|
崔子豪
|
||||||
樊乐天
|
樊乐天
|
||||||
高镆
|
高镆
|
||||||
黄卓琳
|
黄卓琳
|
||||||
姜樱楠
|
姜樱楠
|
||||||
焦祺
|
焦祺
|
||||||
李柏畅
|
李柏畅
|
||||||
李南卓阳
|
李南卓阳
|
||||||
李善伊
|
李善伊
|
||||||
李怡萱
|
李怡萱
|
||||||
李语恒
|
李语恒
|
||||||
刘宇航
|
刘宇航
|
||||||
刘雨鑫
|
刘雨鑫
|
||||||
刘卓
|
刘卓
|
||||||
娄晴
|
娄晴
|
||||||
洛艺伟
|
洛艺伟
|
||||||
马卉冉
|
马卉冉
|
||||||
潘一鸣
|
潘一鸣
|
||||||
庞惠铭
|
庞惠铭
|
||||||
乔旺源
|
乔旺源
|
||||||
沈洁
|
沈洁
|
||||||
宋佳怡
|
宋佳怡
|
||||||
宋雨蔓
|
宋雨蔓
|
||||||
宋智宪
|
宋智宪
|
||||||
苏振宇
|
苏振宇
|
||||||
王梁宇
|
王梁宇
|
||||||
王明仁
|
王明仁
|
||||||
王耀增
|
王耀增
|
||||||
王子来
|
王子来
|
||||||
吴庆波
|
吴庆波
|
||||||
徐子灏
|
徐子灏
|
||||||
阎展博
|
阎展博
|
||||||
杨颜聪
|
杨颜聪
|
||||||
于诗澳
|
于诗澳
|
||||||
于世函
|
于世函
|
||||||
张濠亿
|
张濠亿
|
||||||
张日昊
|
张日昊
|
||||||
张姝肜
|
张姝肜
|
||||||
张文桦
|
张文桦
|
||||||
张潇艺
|
张潇艺
|
||||||
张晓轩
|
张晓轩
|
||||||
张妍
|
张妍
|
||||||
周含笑
|
周含笑
|
||||||
周巧冉'''
|
周巧冉'''
|
||||||
from pypinyin import pinyin
|
from pypinyin import pinyin
|
||||||
from pypinyin import Style
|
from pypinyin import Style
|
||||||
l=t.splitlines()
|
l=t.splitlines()
|
||||||
for text in l:
|
for text in l:
|
||||||
tem=pinyin(text,style=Style.FIRST_LETTER)
|
tem=pinyin(text,style=Style.FIRST_LETTER)
|
||||||
print(''.join([i[0] for i in tem]))
|
print(''.join([i[0] for i in tem]))
|
56
rand/main.py
56
rand/main.py
@ -1,29 +1,29 @@
|
|||||||
from random import randint
|
from random import randint
|
||||||
|
|
||||||
bgn,end=[int(i) for i in input("Option: Input random area(like 21-43): ").split("-")]
|
bgn,end=[int(i) for i in input("Option: Input random area(like 21-43): ").split("-")]
|
||||||
obj=int(input("Option: Amount: "))
|
obj=int(input("Option: Amount: "))
|
||||||
repeat=input("Option: Allow repeat:\nAccept: T(true) (defalt), F(false)\n").lower()
|
repeat=input("Option: Allow repeat:\nAccept: T(true) (defalt), F(false)\n").lower()
|
||||||
if repeat == "":
|
if repeat == "":
|
||||||
repeat=True
|
repeat=True
|
||||||
else:
|
else:
|
||||||
if repeat in ["t","true"]:
|
if repeat in ["t","true"]:
|
||||||
repeat=True
|
repeat=True
|
||||||
elif repeat in ["f","false"]:
|
elif repeat in ["f","false"]:
|
||||||
repeat=False
|
repeat=False
|
||||||
else:
|
else:
|
||||||
input("Unsupported option.")
|
input("Unsupported option.")
|
||||||
l=[]
|
l=[]
|
||||||
if repeat:
|
if repeat:
|
||||||
l=[randint(bgn,end) for i in range(obj)]
|
l=[randint(bgn,end) for i in range(obj)]
|
||||||
else:
|
else:
|
||||||
i=0
|
i=0
|
||||||
while len(l)<obj and i<500:
|
while len(l)<obj and i<500:
|
||||||
t=randint(bgn,end)
|
t=randint(bgn,end)
|
||||||
i+=1
|
i+=1
|
||||||
if t not in l:
|
if t not in l:
|
||||||
l.append(t)
|
l.append(t)
|
||||||
|
|
||||||
print(l)
|
print(l)
|
||||||
for i in l[1:]:
|
for i in l[1:]:
|
||||||
print(randint(bgn,end),end=", ")
|
print(randint(bgn,end),end=", ")
|
||||||
print(l[0])
|
print(l[0])
|
206
recode/recode.py
206
recode/recode.py
@ -1,103 +1,103 @@
|
|||||||
from sys import argv
|
from sys import argv
|
||||||
from os.path import isfile, isdir
|
from os.path import isfile, isdir
|
||||||
from os import mkdir
|
from os import mkdir
|
||||||
from json import dump, load
|
from json import dump, load
|
||||||
HELP = '''
|
HELP = '''
|
||||||
Usage: recode.py <options>/<filename(s)>
|
Usage: recode.py <options>/<filename(s)>
|
||||||
Options:
|
Options:
|
||||||
If options is specified, program will only save configs.
|
If options is specified, program will only save configs.
|
||||||
|
|
||||||
-i: input file code. (eg. utf-8) (Default: test all known codes)
|
-i: input file code. (eg. utf-8) (Default: test all known codes)
|
||||||
-o: output file code. (Default: utf-8)
|
-o: output file code. (Default: utf-8)
|
||||||
-c: codes that try to convert from. (Default: test all known codes)
|
-c: codes that try to convert from. (Default: test all known codes)
|
||||||
split by ','. (eg. utf-8,gbk,gb2312)
|
split by ','. (eg. utf-8,gbk,gb2312)
|
||||||
-r: save the output file in the specified directory. (Default: out)
|
-r: save the output file in the specified directory. (Default: out)
|
||||||
-s: show all known codes. (Don't use this with others)
|
-s: show all known codes. (Don't use this with others)
|
||||||
'''
|
'''
|
||||||
OPTIONS = ["-i", "-o", "-c", "-s", "-r"]
|
OPTIONS = ["-i", "-o", "-c", "-s", "-r"]
|
||||||
|
|
||||||
CODES = ['ascii', 'big5', 'big5hkscs', 'cp037', 'cp273', 'cp424', 'cp437', 'cp500', 'cp720', 'cp737', 'cp775', 'cp850', 'cp852', 'cp855', 'cp856', 'cp857', 'cp858', 'cp860', 'cp861', 'cp862', 'cp863', 'cp864', 'cp865', 'cp866', 'cp869', 'cp874', 'cp875', 'cp932', 'cp949', 'cp950', 'cp1006', 'cp1026', 'cp1125', 'cp1140', 'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255', 'cp1256', 'cp1257', 'cp1258', 'euc_jp', 'euc_jis_2004', 'euc_jisx0213', 'euc_kr', 'gb2312', 'gbk', 'gb18030', 'hz', 'iso2022_jp', 'iso2022_jp_1', 'iso2022_jp_2', 'iso2022_jp_2004',
|
CODES = ['ascii', 'big5', 'big5hkscs', 'cp037', 'cp273', 'cp424', 'cp437', 'cp500', 'cp720', 'cp737', 'cp775', 'cp850', 'cp852', 'cp855', 'cp856', 'cp857', 'cp858', 'cp860', 'cp861', 'cp862', 'cp863', 'cp864', 'cp865', 'cp866', 'cp869', 'cp874', 'cp875', 'cp932', 'cp949', 'cp950', 'cp1006', 'cp1026', 'cp1125', 'cp1140', 'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255', 'cp1256', 'cp1257', 'cp1258', 'euc_jp', 'euc_jis_2004', 'euc_jisx0213', 'euc_kr', 'gb2312', 'gbk', 'gb18030', 'hz', 'iso2022_jp', 'iso2022_jp_1', 'iso2022_jp_2', 'iso2022_jp_2004',
|
||||||
'iso2022_jp_3', 'iso2022_jp_ext', 'iso2022_kr', 'latin_1', 'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5', 'iso8859_6', 'iso8859_7', 'iso8859_8', 'iso8859_9', 'iso8859_10', 'iso8859_11', 'iso8859_13', 'iso8859_14', 'iso8859_15', 'iso8859_16', 'johab', 'koi8_r', 'koi8_t', 'koi8_u', 'kz1048', 'mac_cyrillic', 'mac_greek', 'mac_iceland', 'mac_latin2', 'mac_roman', 'mac_turkish', 'ptcp154', 'shift_jis', 'shift_jis_2004', 'shift_jisx0213', 'utf_32', 'utf_32_be', 'utf_32_le', 'utf_16', 'utf_16_be', 'utf_16_le', 'utf_7', 'utf_8', 'utf_8_sig']
|
'iso2022_jp_3', 'iso2022_jp_ext', 'iso2022_kr', 'latin_1', 'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5', 'iso8859_6', 'iso8859_7', 'iso8859_8', 'iso8859_9', 'iso8859_10', 'iso8859_11', 'iso8859_13', 'iso8859_14', 'iso8859_15', 'iso8859_16', 'johab', 'koi8_r', 'koi8_t', 'koi8_u', 'kz1048', 'mac_cyrillic', 'mac_greek', 'mac_iceland', 'mac_latin2', 'mac_roman', 'mac_turkish', 'ptcp154', 'shift_jis', 'shift_jis_2004', 'shift_jisx0213', 'utf_32', 'utf_32_be', 'utf_32_le', 'utf_16', 'utf_16_be', 'utf_16_le', 'utf_7', 'utf_8', 'utf_8_sig']
|
||||||
DEFALT = {'ipt': None, 'opt': 'utf-8', 'test': None, 'write': 'out'}
|
DEFALT = {'ipt': None, 'opt': 'utf-8', 'test': None, 'write': 'out'}
|
||||||
|
|
||||||
|
|
||||||
def setOption(arg):
|
def setOption(arg):
|
||||||
if arg[0] == '-s':
|
if arg[0] == '-s':
|
||||||
for i in CODES:
|
for i in CODES:
|
||||||
print("%15s" % i, end=' ')
|
print("%15s" % i, end=' ')
|
||||||
return
|
return
|
||||||
opt = arg[::2]
|
opt = arg[::2]
|
||||||
val = arg[1:][::2]
|
val = arg[1:][::2]
|
||||||
option = DEFALT.copy()
|
option = DEFALT.copy()
|
||||||
trans = {'-i': 'ipt', '-o': 'opt', '-c': 'test', "-r": "write"}
|
trans = {'-i': 'ipt', '-o': 'opt', '-c': 'test', "-r": "write"}
|
||||||
for o, v in zip(opt, val):
|
for o, v in zip(opt, val):
|
||||||
if o == '-c':
|
if o == '-c':
|
||||||
option[trans[o]] = v.split(',')
|
option[trans[o]] = v.split(',')
|
||||||
else:
|
else:
|
||||||
option[trans[o]] = v
|
option[trans[o]] = v
|
||||||
with open("config.json", "w") as f:
|
with open("config.json", "w") as f:
|
||||||
dump(option, f)
|
dump(option, f)
|
||||||
|
|
||||||
|
|
||||||
def main(files):
|
def main(files):
|
||||||
if isfile("config.json"):
|
if isfile("config.json"):
|
||||||
try:
|
try:
|
||||||
with open("config.json", "r") as f:
|
with open("config.json", "r") as f:
|
||||||
config = load(f)
|
config = load(f)
|
||||||
except Exception:
|
except Exception:
|
||||||
print("Can't read config file.")
|
print("Can't read config file.")
|
||||||
config = DEFALT
|
config = DEFALT
|
||||||
else:
|
else:
|
||||||
print("No config file provided.")
|
print("No config file provided.")
|
||||||
config = DEFALT
|
config = DEFALT
|
||||||
|
|
||||||
codes = CODES if config["test"] is None else config["test"]
|
codes = CODES if config["test"] is None else config["test"]
|
||||||
outcode = config["opt"]
|
outcode = config["opt"]
|
||||||
outdir = config["write"]
|
outdir = config["write"]
|
||||||
|
|
||||||
if not isdir(outdir):
|
if not isdir(outdir):
|
||||||
mkdir(outdir)
|
mkdir(outdir)
|
||||||
|
|
||||||
for file in files:
|
for file in files:
|
||||||
if isfile(outdir+'/'+file):
|
if isfile(outdir+'/'+file):
|
||||||
print(f"File '{outdir+'/'+file} exists. Ignore.")
|
print(f"File '{outdir+'/'+file} exists. Ignore.")
|
||||||
continue
|
continue
|
||||||
if config["ipt"] is None:
|
if config["ipt"] is None:
|
||||||
for code in codes:
|
for code in codes:
|
||||||
if recode(file, outdir, code, outcode, config["write"]):
|
if recode(file, outdir, code, outcode, config["write"]):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
if not recode(file, outdir, config["ipt"], outcode):
|
if not recode(file, outdir, config["ipt"], outcode):
|
||||||
print("Could not convert '%s' from '%s' to '%s'" %
|
print("Could not convert '%s' from '%s' to '%s'" %
|
||||||
(file, config["ipt"], outcode))
|
(file, config["ipt"], outcode))
|
||||||
else:
|
else:
|
||||||
print(f"Success to convert {file}")
|
print(f"Success to convert {file}")
|
||||||
|
|
||||||
|
|
||||||
def recode(file, opt, src, to) -> bool:
|
def recode(file, opt, src, to) -> bool:
|
||||||
try:
|
try:
|
||||||
with open(file, 'r', encoding=src) as f:
|
with open(file, 'r', encoding=src) as f:
|
||||||
tem = f.read()
|
tem = f.read()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
exit(2)
|
exit(2)
|
||||||
except Exception:
|
except Exception:
|
||||||
print("Can't open file.")
|
print("Can't open file.")
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
with open(opt+'/'+file, 'w', encoding=to) as f:
|
with open(opt+'/'+file, 'w', encoding=to) as f:
|
||||||
f.write(tem)
|
f.write(tem)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
exit(2)
|
exit(2)
|
||||||
except Exception:
|
except Exception:
|
||||||
print("Can't write file.")
|
print("Can't write file.")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(argv) == 1:
|
if len(argv) == 1:
|
||||||
print(HELP)
|
print(HELP)
|
||||||
exit(1)
|
exit(1)
|
||||||
elif argv[1] in OPTIONS:
|
elif argv[1] in OPTIONS:
|
||||||
setOption(argv[1:])
|
setOption(argv[1:])
|
||||||
else:
|
else:
|
||||||
main(argv[1:])
|
main(argv[1:])
|
||||||
|
@ -1,58 +1,58 @@
|
|||||||
from sys import argv
|
from sys import argv
|
||||||
from os.path import isfile, isdir,abspath
|
from os.path import isfile, isdir,abspath
|
||||||
from os import mkdir
|
from os import mkdir
|
||||||
from chardet import detect
|
from chardet import detect
|
||||||
from colorama import init,Fore
|
from colorama import init,Fore
|
||||||
HELP = '''
|
HELP = '''
|
||||||
Usage: recode.py <options>/<filename(s)>
|
Usage: recode.py <options>/<filename(s)>
|
||||||
'''
|
'''
|
||||||
TARGET = 'utf-8'
|
TARGET = 'utf-8'
|
||||||
OUTDIR = "Output"
|
OUTDIR = "Output"
|
||||||
|
|
||||||
|
|
||||||
def main(files):
|
def main(files):
|
||||||
if not isdir(OUTDIR):
|
if not isdir(OUTDIR):
|
||||||
mkdir(OUTDIR)
|
mkdir(OUTDIR)
|
||||||
|
|
||||||
for file in files:
|
for file in files:
|
||||||
path = abspath(file)
|
path = abspath(file)
|
||||||
path = path.replace("\\", "/")
|
path = path.replace("\\", "/")
|
||||||
path = path.split('/')
|
path = path.split('/')
|
||||||
path = '/'.join(path[:-1])+"/"+OUTDIR+"/"+path[-1]
|
path = '/'.join(path[:-1])+"/"+OUTDIR+"/"+path[-1]
|
||||||
if isfile(path):
|
if isfile(path):
|
||||||
print(Fore.YELLOW+f"WARN: File '{path} exists. Ignore.")
|
print(Fore.YELLOW+f"WARN: File '{path} exists. Ignore.")
|
||||||
continue
|
continue
|
||||||
recode(file,path)
|
recode(file,path)
|
||||||
|
|
||||||
|
|
||||||
def recode(file,path):
|
def recode(file,path):
|
||||||
try:
|
try:
|
||||||
with open(file, 'rb') as f:
|
with open(file, 'rb') as f:
|
||||||
tem = f.read()
|
tem = f.read()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(Fore.RED+f"ERROR: Can't open file '{file}'")
|
print(Fore.RED+f"ERROR: Can't open file '{file}'")
|
||||||
return
|
return
|
||||||
ret = detect(tem)
|
ret = detect(tem)
|
||||||
if ret["encoding"] is None:
|
if ret["encoding"] is None:
|
||||||
print(Fore.RED+"ERROR: Cannot detect encoding of `%s`" % file)
|
print(Fore.RED+"ERROR: Cannot detect encoding of `%s`" % file)
|
||||||
return
|
return
|
||||||
|
|
||||||
with open(file, 'r',encoding=ret["encoding"]) as f:
|
with open(file, 'r',encoding=ret["encoding"]) as f:
|
||||||
tem = f.read()
|
tem = f.read()
|
||||||
|
|
||||||
if ret['confidence'] < 0.8:
|
if ret['confidence'] < 0.8:
|
||||||
print(Fore.YELLOW+"WARN: File `%s` confidence is lower than 0.8. Recognized as `%s`."%(file,ret["encoding"]))
|
print(Fore.YELLOW+"WARN: File `%s` confidence is lower than 0.8. Recognized as `%s`."%(file,ret["encoding"]))
|
||||||
|
|
||||||
with open(path, 'w', encoding=TARGET) as f:
|
with open(path, 'w', encoding=TARGET) as f:
|
||||||
f.write(tem)
|
f.write(tem)
|
||||||
print(Fore.LIGHTBLUE_EX+"INFO: Success for `%s` with confidence %0.1f%%"%(file,ret["confidence"]*100))
|
print(Fore.LIGHTBLUE_EX+"INFO: Success for `%s` with confidence %0.1f%%"%(file,ret["confidence"]*100))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
init(autoreset=True)
|
init(autoreset=True)
|
||||||
if len(argv) == 1:
|
if len(argv) == 1:
|
||||||
print(HELP)
|
print(HELP)
|
||||||
else:
|
else:
|
||||||
main(argv[1:])
|
main(argv[1:])
|
||||||
print("------------------------")
|
print("------------------------")
|
||||||
input("Press enter to exit")
|
input("Press enter to exit")
|
||||||
|
Binary file not shown.
62
video/cut.py
62
video/cut.py
@ -1,32 +1,32 @@
|
|||||||
from sys import argv
|
from sys import argv
|
||||||
from subprocess import run
|
from subprocess import run
|
||||||
from os import system
|
from os import system
|
||||||
|
|
||||||
if len(argv) != 2:
|
if len(argv) != 2:
|
||||||
print("Usage: <file>")
|
print("Usage: <file>")
|
||||||
exit(1)
|
exit(1)
|
||||||
file = argv[1]
|
file = argv[1]
|
||||||
tem=file.split(".")
|
tem=file.split(".")
|
||||||
name = ".".join(tem[:-1])
|
name = ".".join(tem[:-1])
|
||||||
o = tem[-1]
|
o = tem[-1]
|
||||||
bgn = input("bgn: ")
|
bgn = input("bgn: ")
|
||||||
if bgn=="":
|
if bgn=="":
|
||||||
bgn="0"
|
bgn="0"
|
||||||
to = input("to: ")
|
to = input("to: ")
|
||||||
cmd = [
|
cmd = [
|
||||||
r'E:\green\ffmpeg\bin\ffmpeg.exe',
|
r'E:\green\ffmpeg\bin\ffmpeg.exe',
|
||||||
'-i',
|
'-i',
|
||||||
file,
|
file,
|
||||||
'-ss',
|
'-ss',
|
||||||
bgn,
|
bgn,
|
||||||
'-to',
|
'-to',
|
||||||
to,
|
to,
|
||||||
'-c',
|
'-c',
|
||||||
'copy',
|
'copy',
|
||||||
name+"_cut."+o
|
name+"_cut."+o
|
||||||
]
|
]
|
||||||
print(cmd)
|
print(cmd)
|
||||||
# run("pause")
|
# run("pause")
|
||||||
ret = run(cmd)
|
ret = run(cmd)
|
||||||
print("ffmpeg finished with code",ret.returncode)
|
print("ffmpeg finished with code",ret.returncode)
|
||||||
system("pause")
|
system("pause")
|
148
wjx/main.py
148
wjx/main.py
@ -1,75 +1,75 @@
|
|||||||
from requests import Response,Session
|
from requests import Response,Session
|
||||||
from re import search
|
from re import search
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.42'
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.42'
|
||||||
}
|
}
|
||||||
s=Session()
|
s=Session()
|
||||||
|
|
||||||
def chk(resp:Response):
|
def chk(resp:Response):
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
print("Error: %d" % resp.status_code)
|
print("Error: %d" % resp.status_code)
|
||||||
exit(1)
|
exit(1)
|
||||||
return resp.text
|
return resp.text
|
||||||
|
|
||||||
def get(url,**kwargs):
|
def get(url,**kwargs):
|
||||||
ret = s.get(url,allow_redirects=False,headers=headers,**kwargs)
|
ret = s.get(url,allow_redirects=False,headers=headers,**kwargs)
|
||||||
jar = ret.cookies
|
jar = ret.cookies
|
||||||
if ret.status_code == 302:
|
if ret.status_code == 302:
|
||||||
url2 = ret.headers['Location']
|
url2 = ret.headers['Location']
|
||||||
return get(url2, cookies=jar)
|
return get(url2, cookies=jar)
|
||||||
elif ret.status_code != 200:
|
elif ret.status_code != 200:
|
||||||
print("Error: %d" % ret.status_code)
|
print("Error: %d" % ret.status_code)
|
||||||
exit(1)
|
exit(1)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def login(username, password):
|
def login(username, password):
|
||||||
# 问卷星竟然明文发送密码
|
# 问卷星竟然明文发送密码
|
||||||
ret = chk(s.get("https://www.wjx.cn/login.aspx"))
|
ret = chk(s.get("https://www.wjx.cn/login.aspx"))
|
||||||
v1 = search('(?<=(<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value=")).+(?=(" />))',ret)
|
v1 = search('(?<=(<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value=")).+(?=(" />))',ret)
|
||||||
if v1 is not None:
|
if v1 is not None:
|
||||||
v1 = v1.group()
|
v1 = v1.group()
|
||||||
v2 = search('(?<=(<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value=")).+(?=(" />))',ret)
|
v2 = search('(?<=(<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value=")).+(?=(" />))',ret)
|
||||||
if v2 is not None:
|
if v2 is not None:
|
||||||
v2 = v2.group()
|
v2 = v2.group()
|
||||||
v3 = search('(?<=(<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value=")).+(?=(" />))',ret)
|
v3 = search('(?<=(<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value=")).+(?=(" />))',ret)
|
||||||
if v3 is not None:
|
if v3 is not None:
|
||||||
v3 = v3.group()
|
v3 = v3.group()
|
||||||
print(v1,v2,v3)
|
print(v1,v2,v3)
|
||||||
with open("tmp.html", "w",encoding="utf-8") as f:
|
with open("tmp.html", "w",encoding="utf-8") as f:
|
||||||
print(ret,file=f)
|
print(ret,file=f)
|
||||||
d={
|
d={
|
||||||
"__VIEWSTATE": v1,
|
"__VIEWSTATE": v1,
|
||||||
"__VIEWSTATEGENERATOR": v2,
|
"__VIEWSTATEGENERATOR": v2,
|
||||||
"__EVENTVALIDATION": v3,
|
"__EVENTVALIDATION": v3,
|
||||||
"UserName": username,
|
"UserName": username,
|
||||||
"Password": password,
|
"Password": password,
|
||||||
"LoginButton": "登录"
|
"LoginButton": "登录"
|
||||||
}
|
}
|
||||||
# d={
|
# d={
|
||||||
# "__VIEWSTATE": "/wEPDwULLTIxMTQ1NzY4NzFkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBQpSZW1lbWJlck1ldLwU4qgz33Rji8zou8eAENNib4k=",
|
# "__VIEWSTATE": "/wEPDwULLTIxMTQ1NzY4NzFkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBQpSZW1lbWJlck1ldLwU4qgz33Rji8zou8eAENNib4k=",
|
||||||
# "__VIEWSTATEGENERATOR":"C2EE9ABB",
|
# "__VIEWSTATEGENERATOR":"C2EE9ABB",
|
||||||
# "__EVENTVALIDATION": "/wEdAAfxrqR6nVOy3mBYlwdwNQ3ZR1LBKX1P1xh290RQyTesRRHS0B3lkDg8wcTlzQR027xRgZ0GCHKgt6QG86UlMSuIXArz/WCefbk6V2VE3Ih52ScdcjStD50aK/ZrfWs/uQXcqaj6i4HaaYTcyD0yJuxuNMxKZaXzJnI0VXVv9OL2HZrk5tk=",
|
# "__EVENTVALIDATION": "/wEdAAfxrqR6nVOy3mBYlwdwNQ3ZR1LBKX1P1xh290RQyTesRRHS0B3lkDg8wcTlzQR027xRgZ0GCHKgt6QG86UlMSuIXArz/WCefbk6V2VE3Ih52ScdcjStD50aK/ZrfWs/uQXcqaj6i4HaaYTcyD0yJuxuNMxKZaXzJnI0VXVv9OL2HZrk5tk=",
|
||||||
# "UserName": username,
|
# "UserName": username,
|
||||||
# "Password": password,
|
# "Password": password,
|
||||||
# "LoginButton": "登录"
|
# "LoginButton": "登录"
|
||||||
# }
|
# }
|
||||||
ret = s.post("https://www.wjx.cn/Login.aspx",json=dumps(d))
|
ret = s.post("https://www.wjx.cn/Login.aspx",json=dumps(d))
|
||||||
ret.raise_for_status()
|
ret.raise_for_status()
|
||||||
|
|
||||||
def getlist(id):
|
def getlist(id):
|
||||||
ret = s.get(
|
ret = s.get(
|
||||||
"https://www.wjx.cn/wjx/activitystat/viewstatsummary.aspx",
|
"https://www.wjx.cn/wjx/activitystat/viewstatsummary.aspx",
|
||||||
params={"activity":id},
|
params={"activity":id},
|
||||||
headers=headers
|
headers=headers
|
||||||
)
|
)
|
||||||
ret = chk(ret)
|
ret = chk(ret)
|
||||||
find = search(r'(?<=(var ids = "))[\d,]+(?=(";))',ret)
|
find = search(r'(?<=(var ids = "))[\d,]+(?=(";))',ret)
|
||||||
assert find is not None,ret
|
assert find is not None,ret
|
||||||
return find.group().split(",")
|
return find.group().split(",")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
login("flt","**************")
|
login("flt","**************")
|
||||||
print(s.cookies)
|
print(s.cookies)
|
||||||
print(getlist("184412487"))
|
print(getlist("184412487"))
|
22
wjx/tmp.py
22
wjx/tmp.py
@ -1,12 +1,12 @@
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
url = "https://www.wjx.cn/login.aspx"
|
url = "https://www.wjx.cn/login.aspx"
|
||||||
|
|
||||||
payload={}
|
payload={}
|
||||||
headers = {
|
headers = {
|
||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.42'
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.42'
|
||||||
}
|
}
|
||||||
|
|
||||||
response = requests.request("GET", url, headers=headers, data=payload)
|
response = requests.request("GET", url, headers=headers, data=payload)
|
||||||
|
|
||||||
print(response.text)
|
print(response.text)
|
4
zxxk_dl/.gitignore
vendored
4
zxxk_dl/.gitignore
vendored
@ -1,3 +1,3 @@
|
|||||||
*.html
|
*.html
|
||||||
*.pdf
|
*.pdf
|
||||||
*.docx
|
*.docx
|
Reference in New Issue
Block a user