From 2f6d8363ad596966625a7532d8ff0c4dbd389e66 Mon Sep 17 00:00:00 2001 From: CharlesPikachu <1159254961@qq.com> Date: Fri, 11 Mar 2022 15:21:08 +0800 Subject: [PATCH] support clients of ten websites --- DecryptLogin/login.py | 3 ++ DecryptLogin/modules/clients/__init__.py | 12 +++++- DecryptLogin/modules/clients/baidupan.py | 24 +++++++++++ DecryptLogin/modules/clients/codalab.py | 24 +++++++++++ DecryptLogin/modules/clients/douyu.py | 26 ++++++++++++ DecryptLogin/modules/clients/fishc.py | 26 ++++++++++++ DecryptLogin/modules/clients/migu.py | 34 +++++++++++++++ DecryptLogin/modules/clients/pypi.py | 24 +++++++++++ DecryptLogin/modules/clients/qunar.py | 24 +++++++++++ DecryptLogin/modules/clients/stackoverflow.py | 26 ++++++++++++ DecryptLogin/modules/clients/w3cschool.py | 41 +++++++++++++++++++ DecryptLogin/modules/clients/youdao.py | 30 ++++++++++++++ DecryptLogin/modules/core/migu.py | 9 ++++ 13 files changed, 302 insertions(+), 1 deletion(-) create mode 100644 DecryptLogin/modules/clients/baidupan.py create mode 100644 DecryptLogin/modules/clients/codalab.py create mode 100644 DecryptLogin/modules/clients/douyu.py create mode 100644 DecryptLogin/modules/clients/fishc.py create mode 100644 DecryptLogin/modules/clients/migu.py create mode 100644 DecryptLogin/modules/clients/pypi.py create mode 100644 DecryptLogin/modules/clients/qunar.py create mode 100644 DecryptLogin/modules/clients/stackoverflow.py create mode 100644 DecryptLogin/modules/clients/w3cschool.py create mode 100644 DecryptLogin/modules/clients/youdao.py diff --git a/DecryptLogin/login.py b/DecryptLogin/login.py index 475fb9e..f78927e 100644 --- a/DecryptLogin/login.py +++ b/DecryptLogin/login.py @@ -45,6 +45,9 @@ class Client(): 'QQQun': QQQunClient, 'zhihu': ZhihuClient, 'taobao': TaobaoClient, 'toutiao': ToutiaoClient, 'jingdong': JingdongClient, 'ifeng': IfengClient, 'sohu': SohuClient, 'zgconline': ZgconlineClient, 'twitter': TwitterClient, 'renren': RenRenClient, 'lagou': LagouClient, 'eSurfing': eSurfingClient, + 'w3cschool': W3CSchoolClient, 'fishc': FishCClient, 'youdao': YoudaoClient, 'stackoverflow': StackoverflowClient, + 'baidupan': BaiduPanClient, 'douyu': DouyuClient, 'codalab': CodaLabClient, 'pypi': PyPiClient, + 'migu': MiguClient, 'qunar': QunarClient, } for key, value in self.supported_clients.items(): setattr(self, key, value) diff --git a/DecryptLogin/modules/clients/__init__.py b/DecryptLogin/modules/clients/__init__.py index c8b4761..aa67af7 100644 --- a/DecryptLogin/modules/clients/__init__.py +++ b/DecryptLogin/modules/clients/__init__.py @@ -1,16 +1,23 @@ '''initialize''' +from .migu import MiguClient +from .pypi import PyPiClient from .sohu import SohuClient from .QQId import QQIdClient +from .qunar import QunarClient +from .fishc import FishCClient from .lagou import LagouClient from .ifeng import IfengClient from .zhihu import ZhihuClient from .QQQun import QQQunClient from .weibo import WeiboClient +from .douyu import DouyuClient +from .youdao import YoudaoClient from .renren import RenRenClient from .taobao import TaobaoClient from .github import GithubClient from .douban import DoubanClient from .QQZone import QQZoneClient +from .codalab import CodaLabClient from .toutiao import ToutiaoClient from .twitter import TwitterClient from .zt12306 import Zt12306Client @@ -18,4 +25,7 @@ from .eSurfing import eSurfingClient from .music163 import Music163Client from .bilibili import BiliBiliClient from .jingdong import JingdongClient -from .zgconline import ZgconlineClient \ No newline at end of file +from .baidupan import BaiduPanClient +from .zgconline import ZgconlineClient +from .w3cschool import W3CSchoolClient +from .stackoverflow import StackoverflowClient \ No newline at end of file diff --git a/DecryptLogin/modules/clients/baidupan.py b/DecryptLogin/modules/clients/baidupan.py new file mode 100644 index 0000000..c0c0b84 --- /dev/null +++ b/DecryptLogin/modules/clients/baidupan.py @@ -0,0 +1,24 @@ +''' +Function: + 百度网盘客户端 +Author: + Charles +微信公众号: + Charles的皮卡丘 +更新日期: + 2022-03-11 +''' +from .baseclient import BaseClient + + +'''百度网盘客户端''' +class BaiduPanClient(BaseClient): + def __init__(self, reload_history=True, **kwargs): + super(BaiduPanClient, self).__init__(website_name='baidupan', reload_history=reload_history, **kwargs) + '''检查会话是否已经过期, 过期返回True''' + def checksessionstatus(self, session, infos_return): + url = 'https://www.baidu.com/' + response = session.get(url) + if 'username' in response.text: + return False + return True \ No newline at end of file diff --git a/DecryptLogin/modules/clients/codalab.py b/DecryptLogin/modules/clients/codalab.py new file mode 100644 index 0000000..ef6ad70 --- /dev/null +++ b/DecryptLogin/modules/clients/codalab.py @@ -0,0 +1,24 @@ +''' +Function: + CodaLab客户端 +Author: + Charles +微信公众号: + Charles的皮卡丘 +更新日期: + 2022-03-11 +''' +from .baseclient import BaseClient + + +'''CodaLab客户端''' +class CodaLabClient(BaseClient): + def __init__(self, reload_history=True, **kwargs): + super(CodaLabClient, self).__init__(website_name='codalab', reload_history=reload_history, **kwargs) + '''检查会话是否已经过期, 过期返回True''' + def checksessionstatus(self, session, infos_return): + url = 'https://competitions.codalab.org/' + response = session.get(url) + if infos_return['username'] in response.text: + return False + return True \ No newline at end of file diff --git a/DecryptLogin/modules/clients/douyu.py b/DecryptLogin/modules/clients/douyu.py new file mode 100644 index 0000000..6f0bbb4 --- /dev/null +++ b/DecryptLogin/modules/clients/douyu.py @@ -0,0 +1,26 @@ +''' +Function: + 斗鱼客户端 +Author: + Charles +微信公众号: + Charles的皮卡丘 +更新日期: + 2022-03-11 +''' +import re +from .baseclient import BaseClient + + +'''斗鱼客户端''' +class DouyuClient(BaseClient): + def __init__(self, reload_history=True, **kwargs): + super(DouyuClient, self).__init__(website_name='douyu', reload_history=reload_history, **kwargs) + '''检查会话是否已经过期, 过期返回True''' + def checksessionstatus(self, session, infos_return): + url = 'https://www.douyu.com/member' + response = session.get(url) + username = re.findall(r'uname_con clearfix" title="(.*?)"', response.text)[0] + if infos_return['username'] == username: + return False + return True \ No newline at end of file diff --git a/DecryptLogin/modules/clients/fishc.py b/DecryptLogin/modules/clients/fishc.py new file mode 100644 index 0000000..6883b7c --- /dev/null +++ b/DecryptLogin/modules/clients/fishc.py @@ -0,0 +1,26 @@ +''' +Function: + 鱼C论坛客户端 +Author: + Charles +微信公众号: + Charles的皮卡丘 +更新日期: + 2022-03-11 +''' +import re +from .baseclient import BaseClient + + +'''鱼C论坛客户端''' +class FishCClient(BaseClient): + def __init__(self, reload_history=True, **kwargs): + super(FishCClient, self).__init__(website_name='fishc', reload_history=reload_history, **kwargs) + '''检查会话是否已经过期, 过期返回True''' + def checksessionstatus(self, session, infos_return): + url = 'https://fishc.com.cn/' + response = session.get(url) + nickname = re.findall(r'title="访问我的空间">(.*?)', response.text)[0] + if infos_return['nickname'] == nickname: + return False + return True \ No newline at end of file diff --git a/DecryptLogin/modules/clients/migu.py b/DecryptLogin/modules/clients/migu.py new file mode 100644 index 0000000..4709bb1 --- /dev/null +++ b/DecryptLogin/modules/clients/migu.py @@ -0,0 +1,34 @@ +''' +Function: + 咪咕客户端 +Author: + Charles +微信公众号: + Charles的皮卡丘 +更新日期: + 2022-03-11 +''' +import requests +from .baseclient import BaseClient + + +'''咪咕客户端''' +class MiguClient(BaseClient): + def __init__(self, reload_history=True, **kwargs): + super(MiguClient, self).__init__(website_name='migu', reload_history=reload_history, **kwargs) + '''检查会话是否已经过期, 过期返回True''' + def checksessionstatus(self, session, infos_return): + cookies = requests.utils.dict_from_cookiejar(session.cookies) + cookies_str = [] + for key in cookies.keys(): + cookies_str.append(f'{key}={cookies[key]}') + headers = { + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36', + 'referer': 'https://music.migu.cn/v3/my', + 'cookie': '; '.join(cookies_str), + } + url = 'https://music.migu.cn/v3/api/my/listen/listend?page=1' + response = session.get(url, headers=headers) + if '成功' in response.text: + return False + return True \ No newline at end of file diff --git a/DecryptLogin/modules/clients/pypi.py b/DecryptLogin/modules/clients/pypi.py new file mode 100644 index 0000000..c7108bf --- /dev/null +++ b/DecryptLogin/modules/clients/pypi.py @@ -0,0 +1,24 @@ +''' +Function: + PyPi客户端 +Author: + Charles +微信公众号: + Charles的皮卡丘 +更新日期: + 2022-03-11 +''' +from .baseclient import BaseClient + + +'''PyPi客户端''' +class PyPiClient(BaseClient): + def __init__(self, reload_history=True, **kwargs): + super(PyPiClient, self).__init__(website_name='pypi', reload_history=reload_history, **kwargs) + '''检查会话是否已经过期, 过期返回True''' + def checksessionstatus(self, session, infos_return): + url = 'https://pypi.org/_includes/current-user-indicator/' + response = session.get(url) + if infos_return['username'] in response.text: + return False + return True \ No newline at end of file diff --git a/DecryptLogin/modules/clients/qunar.py b/DecryptLogin/modules/clients/qunar.py new file mode 100644 index 0000000..9688db0 --- /dev/null +++ b/DecryptLogin/modules/clients/qunar.py @@ -0,0 +1,24 @@ +''' +Function: + 去哪儿旅行客户端 +Author: + Charles +微信公众号: + Charles的皮卡丘 +更新日期: + 2022-03-11 +''' +from .baseclient import BaseClient + + +'''去哪儿旅行客户端''' +class QunarClient(BaseClient): + def __init__(self, reload_history=True, **kwargs): + super(QunarClient, self).__init__(website_name='qunar', reload_history=reload_history, **kwargs) + '''检查会话是否已经过期, 过期返回True''' + def checksessionstatus(self, session, infos_return): + url = 'https://user.qunar.com/webApi/getPwdType.jsp' + response = session.post(url) + if 'success' in response.text: + return False + return True \ No newline at end of file diff --git a/DecryptLogin/modules/clients/stackoverflow.py b/DecryptLogin/modules/clients/stackoverflow.py new file mode 100644 index 0000000..3bdea30 --- /dev/null +++ b/DecryptLogin/modules/clients/stackoverflow.py @@ -0,0 +1,26 @@ +''' +Function: + Stackoverflow客户端 +Author: + Charles +微信公众号: + Charles的皮卡丘 +更新日期: + 2022-03-11 +''' +import re +from .baseclient import BaseClient + + +'''Stackoverflow客户端''' +class StackoverflowClient(BaseClient): + def __init__(self, reload_history=True, **kwargs): + super(StackoverflowClient, self).__init__(website_name='stackoverflow', reload_history=reload_history, **kwargs) + '''检查会话是否已经过期, 过期返回True''' + def checksessionstatus(self, session, infos_return): + url = 'https://stackoverflow.com/' + response = session.get(url) + profile_url = 'https://stackoverflow.com' + re.findall(r'