作者 陈俊学

2.2.4

增加清理服务器缓存cookies登录
... ... @@ -4,5 +4,5 @@ SERVER:
reconnect_interval: 3
VERSION:
code: 113
name: 2.2.3
\ No newline at end of file
code: 114
name: 2.2.4
\ No newline at end of file
... ...
... ... @@ -54,7 +54,10 @@ class CallBack():
models.UserList.remove(email=user_obj.email)
return
def onLoggingIn(self, email, password, cookie, user_agent=None, proxy=None):
def onLoggingIn(self, email, password, cookie, user_agent=None, proxy=None, clear: bool = False):
if clear:
print('清理缓存登录', email)
models.UserList.remove(email=email)
user_obj = models.UserList.get(email=email)
if not user_obj:
print('初次登录')
... ...
... ... @@ -106,7 +106,7 @@ class Monitor(callback.CallBack):
# self.change_list.remove(email)
# self.changeLock.release()
def login(self, email, password, cookie=None, user_agent=None, proxy=None):
def login(self, email, password, cookie=None, user_agent=None, proxy=None, clear: bool = False):
limit = 100
if self.size >= limit:
raise Exception("单台终端登录到达上限,%d个号" % limit)
... ... @@ -117,7 +117,7 @@ class Monitor(callback.CallBack):
else:
if user_agent is None or user_agent == '':
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36'
obj = self.onLoggingIn(email, password, cookie, user_agent, proxy)
obj = self.onLoggingIn(email, password, cookie, user_agent, proxy, clear)
try:
client = FacebookClient(obj, logout_call=functools.partial(self.logout, obj.email),
logging_level=logging.INFO)
... ...
... ... @@ -1961,7 +1961,13 @@ class FacebookClient(Client):
res = self.graphql_api('ProfileOverviewContainerQuery', '3218725658179182', data)
return res['data']['user']['timeline_feed_units']
###############graph接口 start ##############
def AllPhotosAppCollectionPagelet(self, cursor=None):
"""
你的照片
"""
#如果cursor为None,则请求 https://www.facebook.com/ana.sofia.583671/photos_all 获取到
return
###############graph接口 start ##############
def checkVaild(self):
try:
... ...