|
...
|
...
|
@@ -6,7 +6,9 @@ |
|
|
|
# @Software: PyCharm
|
|
|
|
import base64
|
|
|
|
import json
|
|
|
|
import random
|
|
|
|
import re
|
|
|
|
import string
|
|
|
|
import time
|
|
|
|
from urllib import parse
|
|
|
|
|
|
...
|
...
|
@@ -40,9 +42,9 @@ def friend_unit(p: dict): |
|
|
|
unit = li.find('div', class_='friendBrowserUnit')
|
|
|
|
thread_id = unit.find('input', class_='friendBrowserID').attrs['value']
|
|
|
|
try:
|
|
|
|
img_attrs=li.find('img').attrs
|
|
|
|
title=img_attrs['aria-label']
|
|
|
|
src=img_attrs['src']
|
|
|
|
img_attrs = li.find('img').attrs
|
|
|
|
title = img_attrs['aria-label']
|
|
|
|
src = img_attrs['src']
|
|
|
|
result.append({'fbid': thread_id, 'name': title, 'src': src})
|
|
|
|
except:
|
|
|
|
result.append({'fbid': thread_id, 'name': None, 'src': None})
|
|
...
|
...
|
@@ -80,6 +82,17 @@ def find_input_fields_with_pc(html): |
|
|
|
return login_form.find_all("input")
|
|
|
|
|
|
|
|
|
|
|
|
def find_hsi_with_pc(html):
|
|
|
|
b = bs4.BeautifulSoup(html, "html.parser")
|
|
|
|
a = b.select('script')[4]
|
|
|
|
xw_dict = {
|
|
|
|
'hsi': re.findall(r',"hsi":"(.*?)",', a.text)[0],
|
|
|
|
'pkg_cohort': re.findall(r',"pkg_cohort":"(.*?)",', a.text)[0],
|
|
|
|
'server_revision': re.findall(r',{"server_revision":(.*?),"client_revision', a.text)[0]
|
|
|
|
}
|
|
|
|
return xw_dict
|
|
|
|
|
|
|
|
|
|
|
|
def get_publickey_id(text):
|
|
|
|
try:
|
|
|
|
pub = re.findall(r'"pubKey":({.*?})', text)[0]
|
|
...
|
...
|
@@ -109,6 +122,10 @@ def get_domops_3(res): |
|
|
|
return html
|
|
|
|
|
|
|
|
|
|
|
|
def get_webSessionId():
|
|
|
|
return ':'.join([''.join(random.sample(string.ascii_lowercase + string.digits, 6)) for _ in range(3)])
|
|
|
|
|
|
|
|
|
|
|
|
def get_overview_text(res):
|
|
|
|
html = get_domops_3(res)
|
|
|
|
msgs = []
|
|
...
|
...
|
@@ -208,6 +225,7 @@ def get_all_unit_id(text): |
|
|
|
pass
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
|
|
def get_hidden_input(res):
|
|
|
|
text = get_domops_3(res)
|
|
|
|
b = bs4.BeautifulSoup(text, 'html.parser')
|
...
|
...
|
|