diff options
author | codl <[email protected]> | 2019-04-15 14:26:43 +0200 |
---|---|---|
committer | codl <[email protected]> | 2019-04-15 14:26:43 +0200 |
commit | eca31ea732d1c2c8f0491a138b2940e828a45973 (patch) | |
tree | 611e0a28ef365624d25ef2a22a3b69c0307d4b48 | |
parent | 62a47f4e92bd58639beeb682cb7cc53ebba8b803 (diff) | |
download | mastodon.py-eca31ea732d1c2c8f0491a138b2940e828a45973.tar.gz |
improve link header parameter extraction regex
-rw-r--r-- | mastodon/Mastodon.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 123d1a6..3f594cf 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -2272,7 +2272,7 @@ class Mastodon: | |||
2272 | if url['rel'] == 'next': | 2272 | if url['rel'] == 'next': |
2273 | # Be paranoid and extract max_id specifically | 2273 | # Be paranoid and extract max_id specifically |
2274 | next_url = url['url'] | 2274 | next_url = url['url'] |
2275 | matchgroups = re.search(r"max_id=([^&]+)", next_url) | 2275 | matchgroups = re.search(r"[?&]max_id=([^&]+)", next_url) |
2276 | 2276 | ||
2277 | if matchgroups: | 2277 | if matchgroups: |
2278 | next_params = copy.deepcopy(params) | 2278 | next_params = copy.deepcopy(params) |
@@ -2290,7 +2290,7 @@ class Mastodon: | |||
2290 | if url['rel'] == 'prev': | 2290 | if url['rel'] == 'prev': |
2291 | # Be paranoid and extract since_id specifically | 2291 | # Be paranoid and extract since_id specifically |
2292 | prev_url = url['url'] | 2292 | prev_url = url['url'] |
2293 | matchgroups = re.search(r"since_id=([^&]+)", prev_url) | 2293 | matchgroups = re.search(r"[?&]since_id=([^&]+)", prev_url) |
2294 | 2294 | ||
2295 | if matchgroups: | 2295 | if matchgroups: |
2296 | prev_params = copy.deepcopy(params) | 2296 | prev_params = copy.deepcopy(params) |