黑松山资源网 Design By www.paidiu.com
这是一个自动化程度较高的程序,运行本程序后会从chrome中读取cookies用于登录人人影视签到,
并且会自动添加一个windows 任务计划,这个任务计划每天下午两点会执行本程序进行签到。
sys.executable == 'C:\\Python34\\pythonw.exe'
使用pythonw 执行.py 不会弹出命令行窗口。
以system权限执行的程序不能访问网络,/ru 参数后的值改为administrators或者users
import os import sys import subprocess import sqlite3 import time import requests from win32.win32crypt import CryptUnprotectData def getcookiefromchrome(host='.oschina.net'): cookiepath=os.environ['LOCALAPPDATA']+r"\Google\Chrome\User Data\Default\Cookies" sql = "select host_key,name,encrypted_value from cookies where host_key='%s'" % host with sqlite3.connect(cookiepath) as conn: cu = conn.cursor() cookies = {name:CryptUnprotectData(encrypted_value)[1].decode() for host_key,name,encrypted_value in cu.execute(sql).fetchall()} print(cookies) return cookies #运行环境windows 2012 server python3.4 x64 pywin32 chrome 50 """ #windows 版chrome Cookies文件为一个sqlite3数据库, #chrome 33以后的版本的cookies的value都加密存在encrypted_value中, #需要使用win32crypt的CryptUnprotectData 对encrypted_value进行解密, win32crypt是pywin32的一部分,需要安装最新的pywin32模块 """ #getcookiefromchrome() #getcookiefromchrome('.baidu.com') def sign(): zmcookie = getcookiefromchrome('.zimuzu.tv') url = 'http://www.zimuzu.tv/user/login/getCurUserTopInfo' requests.get(url,cookies=zmcookie).text rs = requests.get('http://www.zimuzu.tv/user/sign',cookies=zmcookie).text.split('\n') info = [r for r in rs if "三次登录时间" in r] time_=time.strftime("%c") with open("zmlog.txt","a+") as f: f.write(time_ + " :" ) f.writelines(info) f.write("\n\n") tn='zmautosign' def run(ar=sys.argv): if len(ar)==1: sign() if not intask(): addtask() #添加任务计划 elif len(ar)>1 and ar[1].lower()=="-task": sign() def intask(tn=tn,ar=sys.argv[0]): txt=subprocess.getoutput('schtasks /query |find "%s"' % tn) if tn in txt: return 1 else: return 0 def addtask(tn=tn,ar=sys.argv[0]): cmd='schtasks /create /F /ru Administrators /tn "%s" /sc daily /st 14:00:00 /tr "%s %s -task"' % (tn,sys.executable,ar) subprocess.call(cmd,shell=1) os.chdir(sys.path[0]) run()
黑松山资源网 Design By www.paidiu.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
黑松山资源网 Design By www.paidiu.com
暂无评论...
更新日志
2024年10月09日
2024年10月09日
- s14全球总决赛瑞士轮什么时候开始 s14瑞士轮开始时间介绍
- 晨报|《使命召唤21》全球发布预告 《异形:隔离》续作官宣开发中
- 隐形女联动毁灭博士?杰西卡·阿尔巴与小唐尼晒合影
- 《博德之门3》7号补丁发布后:Mod下载量达到2200万次!
- 徐璨宾《井底的蚯蚓》[FLAC/分轨][218.37MB]
- 王冰冰《Vaga Luna 月球漫游》[320K/MP3][62.76MB]
- 证声音乐图书馆《蔚蓝海岸·爵士度假日》[320K/MP3][59.79MB]
- 群星.1993-飞图合唱歌曲精丫飞图】【WAV+CUE】
- 王霏霏.2024-TOOOOO.BUSY(EP)【SNMUSIC】【FLAC分轨】
- 张宇.2016-好男人的情歌NEWXRCD【金牌大风】【WAV+CUE】
- 《食戟之灵》小林龙胆兔女郎比基尼版模型即将发售
- 重大里程碑!九号电动第500万台智能两轮电动车正式下线
- TGA主持人发文祝贺《暗喻幻想》 国外网友:提名稳了?
- 【原神】V5.0攻略 | 旋曜玉帛收集攻略(序号81~序号90)
- 【原神】V5.0攻略 | 旋曜玉帛收集攻略(序号91~序号100)