-
-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for new share URL format created from Reddit's mobile apps.
- Loading branch information
1 parent
884ffdd
commit ea69554
Showing
11 changed files
with
926 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
198 changes: 198 additions & 0 deletions
198
tests/integration/cassettes/TestComment.test_id_from_url.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
{ | ||
"http_interactions": [ | ||
{ | ||
"recorded_at": "2023-11-09T19:03:42", | ||
"request": { | ||
"body": { | ||
"encoding": "utf-8", | ||
"string": "grant_type=client_credentials" | ||
}, | ||
"headers": { | ||
"Accept": [ | ||
"*/*" | ||
], | ||
"Accept-Encoding": [ | ||
"identity" | ||
], | ||
"Authorization": [ | ||
"Basic <BASIC_AUTH>" | ||
], | ||
"Connection": [ | ||
"close" | ||
], | ||
"Content-Length": [ | ||
"29" | ||
], | ||
"Content-Type": [ | ||
"application/x-www-form-urlencoded" | ||
], | ||
"User-Agent": [ | ||
"<USER_AGENT> PRAW/7.7.2.dev0 prawcore/2.3.0" | ||
] | ||
}, | ||
"method": "POST", | ||
"uri": "https://www.reddit.com/api/v1/access_token" | ||
}, | ||
"response": { | ||
"body": { | ||
"encoding": "UTF-8", | ||
"string": "{\"access_token\": \"<ACCESS_TOKEN>\", \"token_type\": \"bearer\", \"expires_in\": 86400, \"scope\": \"*\"}" | ||
}, | ||
"headers": { | ||
"Accept-Ranges": [ | ||
"bytes" | ||
], | ||
"Cache-Control": [ | ||
"private, max-age=3600" | ||
], | ||
"Connection": [ | ||
"close" | ||
], | ||
"Content-Length": [ | ||
"812" | ||
], | ||
"Date": [ | ||
"Thu, 09 Nov 2023 19:03:42 GMT" | ||
], | ||
"NEL": [ | ||
"{\"report_to\": \"w3-reporting-nel\", \"max_age\": 14400, \"include_subdomains\": false, \"success_fraction\": 1.0, \"failure_fraction\": 1.0}" | ||
], | ||
"Report-To": [ | ||
"{\"group\": \"w3-reporting-nel\", \"max_age\": 14400, \"include_subdomains\": true, \"endpoints\": [{ \"url\": \"https://w3-reporting-nel.reddit.com/reports\" }]}, {\"group\": \"w3-reporting\", \"max_age\": 14400, \"include_subdomains\": true, \"endpoints\": [{ \"url\": \"https://w3-reporting.reddit.com/reports\" }]}, {\"group\": \"w3-reporting-csp\", \"max_age\": 14400, \"include_subdomains\": true, \"endpoints\": [{ \"url\": \"https://w3-reporting-csp.reddit.com/reports\" }]}" | ||
], | ||
"Server": [ | ||
"snooserv" | ||
], | ||
"Set-Cookie": [ | ||
"edgebucket=ZiuasF2t2VM3rHunbP; Domain=reddit.com; Max-Age=63071999; Path=/; secure" | ||
], | ||
"Strict-Transport-Security": [ | ||
"max-age=31536000; includeSubdomains" | ||
], | ||
"Vary": [ | ||
"accept-encoding, Accept-Encoding" | ||
], | ||
"Via": [ | ||
"1.1 varnish" | ||
], | ||
"X-Content-Type-Options": [ | ||
"nosniff" | ||
], | ||
"X-Frame-Options": [ | ||
"SAMEORIGIN" | ||
], | ||
"X-XSS-Protection": [ | ||
"1; mode=block" | ||
], | ||
"content-type": [ | ||
"application/json; charset=UTF-8" | ||
], | ||
"x-reddit-loid": [ | ||
"000000000njwzxoaiz.2.1699556622239.Z0FBQUFBQmxUUzBPZm1TOUx4SElwWW1rMG1rSXhZdmRCb2REMm50Vlo3V2xyaUltbnpKZTM4ZVd2cmNmdHRHbktzazFwS2FUNzIxeW5HTmN3MVIxM084NERFdnNHd2RaY2RFTlg1dHBmVFJqQjdBYVZuV1RHRGpzZjk5S3RBcG5laDE1ZFA2WF9vSmc" | ||
] | ||
}, | ||
"status": { | ||
"code": 200, | ||
"message": "OK" | ||
}, | ||
"url": "https://www.reddit.com/api/v1/access_token" | ||
} | ||
}, | ||
{ | ||
"recorded_at": "2023-11-09T19:03:42", | ||
"request": { | ||
"body": { | ||
"encoding": "utf-8", | ||
"string": "" | ||
}, | ||
"headers": { | ||
"Accept": [ | ||
"*/*" | ||
], | ||
"Accept-Encoding": [ | ||
"identity" | ||
], | ||
"Authorization": [ | ||
"bearer <ACCESS_TOKEN>" | ||
], | ||
"Connection": [ | ||
"keep-alive" | ||
], | ||
"Cookie": [ | ||
"edgebucket=ZiuasF2t2VM3rHunbP" | ||
], | ||
"User-Agent": [ | ||
"<USER_AGENT> PRAW/7.7.2.dev0 prawcore/2.3.0" | ||
] | ||
}, | ||
"method": "GET", | ||
"uri": "https://www.reddit.com/r/redditdev/s/nGnQE1QkLC?raw_json=1" | ||
}, | ||
"response": { | ||
"body": { | ||
"encoding": "utf-8", | ||
"string": "<a href=\"https://www.reddit.com/r/redditdev/comments/2gmzqe/praw_https_enabled_praw_testing_needed/cklhv0f/?context=3&share_id=vi8DOF9B0U5cJSzhFjDE9&utm_content=1&utm_medium=ios_app&utm_name=ioscss&utm_source=share&utm_term=1\">Moved Permanently</a>.\n\n" | ||
}, | ||
"headers": { | ||
"Accept-Ranges": [ | ||
"bytes" | ||
], | ||
"Cache-Control": [ | ||
"private, max-age=3600" | ||
], | ||
"Connection": [ | ||
"keep-alive" | ||
], | ||
"Content-Length": [ | ||
"275" | ||
], | ||
"Date": [ | ||
"Thu, 09 Nov 2023 19:03:42 GMT" | ||
], | ||
"NEL": [ | ||
"{\"report_to\": \"w3-reporting-nel\", \"max_age\": 14400, \"include_subdomains\": false, \"success_fraction\": 1.0, \"failure_fraction\": 1.0}" | ||
], | ||
"Report-To": [ | ||
"{\"group\": \"w3-reporting-nel\", \"max_age\": 14400, \"include_subdomains\": true, \"endpoints\": [{ \"url\": \"https://w3-reporting-nel.reddit.com/reports\" }]}, {\"group\": \"w3-reporting\", \"max_age\": 14400, \"include_subdomains\": true, \"endpoints\": [{ \"url\": \"https://w3-reporting.reddit.com/reports\" }]}, {\"group\": \"w3-reporting-csp\", \"max_age\": 14400, \"include_subdomains\": true, \"endpoints\": [{ \"url\": \"https://w3-reporting-csp.reddit.com/reports\" }]}" | ||
], | ||
"Server": [ | ||
"snooserv" | ||
], | ||
"Set-Cookie": [ | ||
"csv=2; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None" | ||
], | ||
"Strict-Transport-Security": [ | ||
"max-age=31536000; includeSubdomains" | ||
], | ||
"Vary": [ | ||
"Accept-Encoding" | ||
], | ||
"Via": [ | ||
"1.1 varnish" | ||
], | ||
"X-Content-Type-Options": [ | ||
"nosniff" | ||
], | ||
"X-Frame-Options": [ | ||
"SAMEORIGIN" | ||
], | ||
"X-XSS-Protection": [ | ||
"1; mode=block" | ||
], | ||
"content-type": [ | ||
"text/html; charset=utf-8" | ||
], | ||
"location": [ | ||
"https://www.reddit.com/r/redditdev/comments/2gmzqe/praw_https_enabled_praw_testing_needed/cklhv0f/?context=3&share_id=vi8DOF9B0U5cJSzhFjDE9&utm_content=1&utm_medium=ios_app&utm_name=ioscss&utm_source=share&utm_term=1" | ||
] | ||
}, | ||
"status": { | ||
"code": 301, | ||
"message": "Moved Permanently" | ||
}, | ||
"url": "https://www.reddit.com/r/redditdev/s/nGnQE1QkLC?raw_json=1" | ||
} | ||
} | ||
], | ||
"recorded_with": "betamax/0.8.1" | ||
} |
Oops, something went wrong.