forked from Sitoi/dailycheckin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
564 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
from pojie.pojie import PojieCheckIn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# -*- coding: utf-8 -*- | ||
import json | ||
import os | ||
import re | ||
|
||
import requests | ||
|
||
|
||
class PojieCheckIn: | ||
def __init__(self, pojie_cookie_list): | ||
self.pojie_cookie_list = pojie_cookie_list | ||
|
||
@staticmethod | ||
def sign(headers): | ||
try: | ||
msg = "" | ||
session = requests.session() | ||
session.get(url='https://www.52pojie.cn/home.php?mod=task&do=apply&id=2', headers=headers) | ||
resp = session.get(url='https://www.52pojie.cn/home.php?mod=task&do=draw&id=2', headers=headers) | ||
content = re.findall(r'<div id="messagetext".*?\n<p>(.*?)</p>', resp.text)[0] | ||
if "您需要先登录才能继续本操作" in resp.text: | ||
msg += "吾爱破解 cookie 失效" | ||
elif "恭喜" in resp.text: | ||
msg += "吾爱破解签到成功" | ||
else: | ||
msg += content | ||
except Exception as e: | ||
if "安域防护节点" in resp.text: | ||
print("触发吾爱破解安全防护,访问出错。自行修改脚本运行时间和次数,总有能访问到的时间") | ||
print("吾爱破解出错") | ||
msg += "吾爱破解出错" | ||
return msg | ||
|
||
def main(self): | ||
msg_list = [] | ||
for pojie_cookie in self.pojie_cookie_list: | ||
pojie_cookie = pojie_cookie.get("pojie_cookie") | ||
headers = { | ||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36', | ||
'Cookie': pojie_cookie, | ||
'ContentType': 'text/html;charset=gbk' | ||
} | ||
uid = re.findall(r"htVD_2132_lastcheckfeed=(.*?);", pojie_cookie)[0].split("%7C")[0] | ||
sign_msg = self.sign(headers=headers) | ||
msg = f"【吾爱破解】\n帐号信息: {uid}\n签到状态: {sign_msg}" | ||
msg_list.append(msg) | ||
return msg_list | ||
|
||
|
||
if __name__ == "__main__": | ||
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f: | ||
datas = json.loads(f.read()) | ||
_pojie_cookie_list = datas.get("POJIE_COOKIE_LIST", []) | ||
PojieCheckIn(pojie_cookie_list=_pojie_cookie_list).main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
from samsung.samsung import SamsungCheckIn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# -*- coding: utf-8 -*- | ||
import json | ||
import os | ||
import time | ||
|
||
import requests | ||
from requests import utils | ||
|
||
|
||
class SamsungCheckIn: | ||
def __init__(self, samsung_cookie_list): | ||
self.samsung_cookie_list = samsung_cookie_list | ||
|
||
@staticmethod | ||
def sign(session): | ||
try: | ||
params = {"ramdon": str(int(round(time.time() * 1000)))} | ||
user_info = session.get( | ||
url=f"http://www.samsungmembers.cn/Shared/CheckUserLogin?ramdon=1613969035891", params=params | ||
).json() | ||
username = user_info.get("Data", {}).get("UserName") | ||
except Exception as e: | ||
print(e) | ||
username = "获取用户名失败" | ||
try: | ||
current = session.post(url="http://www.samsungmembers.cn/Shared/Sign").json() | ||
if current.get("State"): | ||
data = current.get("Data") | ||
msg = f'获得经验 {data.get("EmpricCount")}, 获得星钻 {data.get("CreditCount")}' | ||
else: | ||
msg = current.get("Error") | ||
except Exception as e: | ||
msg = f"签到失败\n错误信息: {e}" | ||
sign_msg = f"用户昵称: {username}\n签到状态: {msg}" | ||
return sign_msg | ||
|
||
def main(self): | ||
msg_list = [] | ||
for samsung_cookie in self.samsung_cookie_list: | ||
samsung_cookie = { | ||
item.split("=")[0]: item.split("=")[1] for item in samsung_cookie.get("samsung_cookie").split("; ") | ||
} | ||
session = requests.session() | ||
requests.utils.add_dict_to_cookiejar(session.cookies, samsung_cookie) | ||
session.headers.update( | ||
{ | ||
"Accept": "*/*", | ||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 Edg/88.0.705.74", | ||
"X-Requested-With": "XMLHttpRequest", | ||
"Origin": "http://www.samsungmembers.cn", | ||
"Referer": "http://www.samsungmembers.cn/", | ||
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8", | ||
} | ||
) | ||
sign_msg = self.sign(session=session) | ||
msg = f"【盖乐世社区】\n{sign_msg}" | ||
msg_list.append(msg) | ||
return msg_list | ||
|
||
|
||
if __name__ == "__main__": | ||
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f: | ||
datas = json.loads(f.read()) | ||
_samsung_cookie_list = datas.get("SAMSUNG_COOKIE_LIST", []) | ||
SamsungCheckIn(samsung_cookie_list=_samsung_cookie_list).main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
from wps.wps import WPSCheckIn |
Oops, something went wrong.