902 Commits

Author SHA1 Message Date
Mads Marquart
7345de149a Improve HTTP error handling 2019-07-02 17:23:42 +02:00
Mads Marquart
4fdf0bbc57 Remove JSON conversion from _util.check_request 2019-07-02 17:23:42 +02:00
Mads Marquart
d17f741f97 Refactor _util.check_json 2019-07-02 17:23:42 +02:00
Mads Marquart
4a898b3ff5 Use Client._payload_post helper where relevant 2019-07-02 15:52:02 +02:00
Mads Marquart
7f84ca8d0c Add Client._payload_post helper 2019-07-02 15:50:58 +02:00
Mads Marquart
c3a974a495 Refactor _util.check_request 2019-07-02 15:34:23 +02:00
Mads Marquart
5b57d49a3e Remove Client._postFile 2019-07-02 15:14:02 +02:00
Mads Marquart
7af83c04c0 Remove as_json parameter
The requests that didn't need this parameter were moved to the State model
2019-07-01 22:53:26 +02:00
Mads Marquart
b5ba338f86 Remove fix_request parameter
The requests that don't need this parameter is handled in the State model
2019-07-01 22:49:21 +02:00
Mads Marquart
50bfeb92b2 Add fix_request=True and as_json=True to missing requests
I've tested, these endpoints actually all return JSON data
2019-07-01 22:47:05 +02:00
Mads Marquart
8d41ea5bfd Use POST in Client.fetchImageUrl
Reduces the amount of different request methods we're using.

Not really sure whether this is actually the best option:
- Each request includes `fb_dtsg` and such, so using POST everywhere might be the more secure option?
- But at the same time, the request is more opaque, and harder to debug (urllib3 logs all request urls automatically, so using GET would make that easy)
2019-07-01 18:43:00 +02:00
Mads Marquart
b10b14c8e9 Update url in Client.removeFriend 2019-07-01 18:23:03 +02:00
Mads Marquart
144e81bd46 Add Python 2 support 2019-07-01 13:40:15 +02:00
Mads Marquart
230c849b60 Always create the State object in a valid state 2019-07-01 13:31:42 +02:00
Mads Marquart
466f27a8c5 Move login check code into State 2019-07-01 13:31:42 +02:00
Mads Marquart
dc12e01fc7 Move logout code to State 2019-07-01 13:31:42 +02:00
Mads Marquart
d0e9a7f693 Move login/2fa code to State 2019-07-01 13:31:42 +02:00
Mads Marquart
1ba21e03c6 Handle headers in State 2019-07-01 13:31:42 +02:00
Mads Marquart
bcc8b44bb5 Handle ssl verification in State 2019-07-01 13:31:42 +02:00
Mads Marquart
b01b371c66 Refactor session cookie handling into State 2019-07-01 13:31:42 +02:00
Mads Marquart
94a0f6b3df Move client session into State 2019-07-01 13:31:42 +02:00
Mads Marquart
5df10ecc31 Remove _cleanGet and _cleanPost Client methods 2019-07-01 13:31:42 +02:00
Mads Marquart
56786406ec Refactor most of _postLogin into the State model 2019-07-01 13:31:42 +02:00
Mads Marquart
a4268f36cf Move logout h into the State model 2019-07-01 13:31:42 +02:00
Mads Marquart
8e7afa2edf Move request counter into State model 2019-07-01 13:31:30 +02:00
Mads Marquart
f07122d446 Move request payload into State model 2019-07-01 13:30:29 +02:00
Mads Marquart
78c307780b Clean up a few utility functions 2019-06-29 20:40:11 +02:00
Mads Marquart
ad705d544a Merge pull request #433 from carpedm20/remove-req-url-model
Remove ReqUrl model
2019-06-29 20:24:20 +02:00
Mads Marquart
77f28315c9 Inline urls from ReqUrl 2019-06-29 20:14:49 +02:00
Mads Marquart
e0754031ad Extract pull channel handling from ReqUrl 2019-06-29 20:10:55 +02:00
Mads Marquart
f97d36b41f Add ability to specify urls relative to www.facebook.com 2019-06-29 20:05:16 +02:00
Mads Marquart
bb2afe8e40 Remove redundant timeout parameter 2019-06-23 18:25:30 +02:00
Mads Marquart
faa0383af3 Remove unnecessary default payload attributes
This has been fairly thoroughly tested on all URLs, so it should be safe to do
2019-06-23 18:08:25 +02:00
Mads Marquart
e1e988272b Version up, thanks to @kapi2289
- Removed / privatized a lot of undocumented functionality, which might break some users application if they were relying on those (hence the minor version bump). See #432 for further reasoning
- Add `Client.forwardAttachment` and `Message.forwarded` attribute, see #420
- Fix parsing subattachments with no target, see #412
- Lots of other refactoring, aka. work on the transition towards v2
v1.7.0
2019-06-23 18:02:05 +02:00
Mads Marquart
b159f04a6b Merge pull request #432 from carpedm20/undocumented-breaking-changes
Undocumented breaking changes
2019-06-23 17:51:37 +02:00
Mads Marquart
d91a7ea9e3 Remove internal stuff from _graphql in __init__.py 2019-06-23 17:44:03 +02:00
Mads Marquart
8056f3399e Privatize Client.req_url
Undocumented
2019-06-23 17:40:20 +02:00
Mads Marquart
fd9aa7ee90 Remove client.py
Undocumented
2019-06-23 17:38:42 +02:00
Mads Marquart
53c19f473b Remove utils.py
The file, and contained functions, were explicitly documented as something you couldn't rely on for backwards compatibility
2019-06-23 17:38:27 +02:00
Mads Marquart
78b5f05729 Fix search when the result is empty
Return an empty result instead of raising
2019-05-01 23:50:23 +02:00
Mads Marquart
f689376830 Fix check_json
The payload is sometimes a list
2019-05-01 23:49:29 +02:00
Mads Marquart
d244856b41 Fix setting forwarded when creating Message objects 2019-05-01 23:18:12 +02:00
Kacper Ziubryniewicz
3cd0f3a9a7 Add missing mid parameter in message parsing (#426) 2019-05-01 19:32:04 +02:00
Mads Marquart
f480d68b57 Fix subattachment target parsing, fixes #412 2019-04-25 23:26:04 +02:00
Mads Marquart
db2bda1f9b Fix ShareAttachment GraphQL source parsing
Fixes #418
2019-04-25 23:26:03 +02:00
Kacper Ziubryniewicz
f834c01921 Fix sending remote files with URLs containing GET parameters or hashtags (#423) 2019-04-25 22:50:32 +02:00
Mads Marquart
f945fa80b3 Merge pull request #419 from carpedm20/remove-client-variables
Clean up `Client` variables
2019-04-25 22:45:45 +02:00
Kacper Ziubryniewicz
70faa86e34 Add forwarding attachments (#420)
- Add ability to forward attachments and `Message.forwarded` attribute
- Improve error handling for a lot of client methods, including, but not limited to:
    - `fetchAllUsers`
    - `searchForMessageIDs`
    - `search`
    - `fetchThreadInfo` and siblings
    - `fetchUnread`
    - `fetchUnseen`
    - `fetchPollOptions`
    - `fetchPlanInfo`
    - `send` and siblings
    - File uploads
2019-04-25 22:03:03 +02:00
Mads Marquart
61502ed32a Merge pull request #406 from carpedm20/refactor-model-parsing
Refactor model parsing
2019-04-25 21:06:26 +02:00
Mads Marquart
bfca20bb12 Privatize req_counter, payloadDefault and seq client variables
These have complicated semantics, and so are hopefully not depended on externally
2019-04-17 23:24:01 +02:00