作者 陈俊学

2.2.4

增加清理服务器缓存cookies登录
@@ -4,5 +4,5 @@ SERVER: @@ -4,5 +4,5 @@ SERVER:
4 reconnect_interval: 3 4 reconnect_interval: 3
5 5
6 VERSION: 6 VERSION:
7 - code: 113  
8 - name: 2.2.3  
  7 + code: 114
  8 + name: 2.2.4
@@ -54,7 +54,10 @@ class CallBack(): @@ -54,7 +54,10 @@ class CallBack():
54 models.UserList.remove(email=user_obj.email) 54 models.UserList.remove(email=user_obj.email)
55 return 55 return
56 56
57 - def onLoggingIn(self, email, password, cookie, user_agent=None, proxy=None): 57 + def onLoggingIn(self, email, password, cookie, user_agent=None, proxy=None, clear: bool = False):
  58 + if clear:
  59 + print('清理缓存登录', email)
  60 + models.UserList.remove(email=email)
58 user_obj = models.UserList.get(email=email) 61 user_obj = models.UserList.get(email=email)
59 if not user_obj: 62 if not user_obj:
60 print('初次登录') 63 print('初次登录')
@@ -106,7 +106,7 @@ class Monitor(callback.CallBack): @@ -106,7 +106,7 @@ class Monitor(callback.CallBack):
106 # self.change_list.remove(email) 106 # self.change_list.remove(email)
107 # self.changeLock.release() 107 # self.changeLock.release()
108 108
109 - def login(self, email, password, cookie=None, user_agent=None, proxy=None): 109 + def login(self, email, password, cookie=None, user_agent=None, proxy=None, clear: bool = False):
110 limit = 100 110 limit = 100
111 if self.size >= limit: 111 if self.size >= limit:
112 raise Exception("单台终端登录到达上限,%d个号" % limit) 112 raise Exception("单台终端登录到达上限,%d个号" % limit)
@@ -117,7 +117,7 @@ class Monitor(callback.CallBack): @@ -117,7 +117,7 @@ class Monitor(callback.CallBack):
117 else: 117 else:
118 if user_agent is None or user_agent == '': 118 if user_agent is None or user_agent == '':
119 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' 119 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'
120 - obj = self.onLoggingIn(email, password, cookie, user_agent, proxy) 120 + obj = self.onLoggingIn(email, password, cookie, user_agent, proxy, clear)
121 try: 121 try:
122 client = FacebookClient(obj, logout_call=functools.partial(self.logout, obj.email), 122 client = FacebookClient(obj, logout_call=functools.partial(self.logout, obj.email),
123 logging_level=logging.INFO) 123 logging_level=logging.INFO)
@@ -1961,6 +1961,12 @@ class FacebookClient(Client): @@ -1961,6 +1961,12 @@ class FacebookClient(Client):
1961 res = self.graphql_api('ProfileOverviewContainerQuery', '3218725658179182', data) 1961 res = self.graphql_api('ProfileOverviewContainerQuery', '3218725658179182', data)
1962 return res['data']['user']['timeline_feed_units'] 1962 return res['data']['user']['timeline_feed_units']
1963 1963
  1964 + def AllPhotosAppCollectionPagelet(self, cursor=None):
  1965 + """
  1966 + 你的照片
  1967 + """
  1968 + #如果cursor为None,则请求 https://www.facebook.com/ana.sofia.583671/photos_all 获取到
  1969 + return
1964 ###############graph接口 start ############## 1970 ###############graph接口 start ##############
1965 1971
1966 def checkVaild(self): 1972 def checkVaild(self):