Merge remote-tracking branch 'orenyomtov/patch-2'
This commit is contained in:
@@ -209,8 +209,18 @@ class Client(object):
|
|||||||
|
|
||||||
r = self._get(self.req_url.BASE)
|
r = self._get(self.req_url.BASE)
|
||||||
soup = bs(r.text, "lxml")
|
soup = bs(r.text, "lxml")
|
||||||
self.fb_dtsg = soup.find("input", {'name':'fb_dtsg'})['value']
|
|
||||||
self.fb_h = soup.find("input", {'name':'h'})['value']
|
fb_dtsg_element = soup.find("input", {'name': 'fb_dtsg'})
|
||||||
|
if fb_dtsg_element:
|
||||||
|
self.fb_dtsg = fb_dtsg_element['value']
|
||||||
|
else:
|
||||||
|
self.fb_dtsg = re.search(r'name="fb_dtsg" value="(.*?)"', r.text).group(1)
|
||||||
|
|
||||||
|
|
||||||
|
fb_h_element = soup.find("input", {'name':'h'})
|
||||||
|
if fb_h_element:
|
||||||
|
self.fb_h = fb_h_element['value']
|
||||||
|
|
||||||
for i in self.fb_dtsg:
|
for i in self.fb_dtsg:
|
||||||
self.ttstamp += str(ord(i))
|
self.ttstamp += str(ord(i))
|
||||||
self.ttstamp += '2'
|
self.ttstamp += '2'
|
||||||
@@ -400,6 +410,11 @@ class Client(object):
|
|||||||
:return: True if the action was successful
|
:return: True if the action was successful
|
||||||
:rtype: bool
|
:rtype: bool
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if not hasattr(self, 'fb_h'):
|
||||||
|
h_r = self._post(self.req_url.MODERN_SETTINGS_MENU, {'pmid': '4'})
|
||||||
|
self.fb_h = re.search(r'name=\\"h\\" value=\\"(.*?)\\"', h_r.text).group(1)
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
'ref': "mb",
|
'ref': "mb",
|
||||||
'h': self.fb_h
|
'h': self.fb_h
|
||||||
|
@@ -121,6 +121,7 @@ class ReqUrl(object):
|
|||||||
GRAPHQL = "https://www.facebook.com/api/graphqlbatch/"
|
GRAPHQL = "https://www.facebook.com/api/graphqlbatch/"
|
||||||
ATTACHMENT_PHOTO = "https://www.facebook.com/mercury/attachments/photo/"
|
ATTACHMENT_PHOTO = "https://www.facebook.com/mercury/attachments/photo/"
|
||||||
EVENT_REMINDER = "https://www.facebook.com/ajax/eventreminder/create"
|
EVENT_REMINDER = "https://www.facebook.com/ajax/eventreminder/create"
|
||||||
|
MODERN_SETTINGS_MENU = "https://www.facebook.com/bluebar/modern_settings_menu/"
|
||||||
|
|
||||||
pull_channel = 0
|
pull_channel = 0
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user