Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,5 @@ Source Contributors
- c0d3rman `@c0d3rman <https://github.com/c0d3rman>`_
- Joe Kerhin `@jkerhin <https://github.com/jkerhin>`_
- Aaron Becker `@aaronjbecker <https://github.com/aaronjbecker>`_
- Volker `@volker-fr <https://github.com/volker-fr>`_
- Add "Name <email (optional)> and github profile link" above this line.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Unreleased
- Add support for optional Markdown-formatted ``selftext`` when submitting link, image,
gallery, and video posts.

**Fixed**

- Fix API endpoint for :meth:`.Submission.hide` and :meth:`.Submission.unhide`.

**Changed**

- Bumped prawcore to 3.0.2.
Expand Down
4 changes: 2 additions & 2 deletions praw/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"friend": "r/{subreddit}/api/friend/",
"friend_v1": "api/v1/me/friends/{user}",
"friends": "api/v1/me/friends/",
"hide": "api/hide/",
"hide": "api/hide",
"ignore_reports": "api/ignore_reports/",
"inbox": "message/inbox/",
"info": "api/info/",
Expand Down Expand Up @@ -190,7 +190,7 @@
"unblock_subreddit": "api/unblock_subreddit",
"uncollapse": "api/uncollapse_message/",
"unfriend": "r/{subreddit}/api/unfriend/",
"unhide": "api/unhide/",
"unhide": "api/unhide",
"unignore_reports": "api/unignore_reports/",
"unlock": "api/unlock/",
"unmarknsfw": "api/unmarknsfw/",
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/cassettes/TestSubmission.test_hide.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"User-Agent": "<USER_AGENT> PRAW/4.0.0b8 prawcore/0.0.10"
},
"method": "POST",
"uri": "https://oauth.reddit.com/api/hide/?raw_json=1"
"uri": "https://oauth.reddit.com/api/hide?raw_json=1"
},
"response": {
"body": {
Expand Down Expand Up @@ -94,7 +94,7 @@
"code": 200,
"message": "OK"
},
"url": "https://oauth.reddit.com/api/hide/?raw_json=1"
"url": "https://oauth.reddit.com/api/hide?raw_json=1"
}
}
],
Expand Down
78 changes: 37 additions & 41 deletions tests/integration/cassettes/TestSubmission.test_hide_multiple.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"http_interactions": [
{
"recorded_at": "2017-01-13T01:15:09",
"recorded_at": "2026-04-13T20:49:06",
"request": {
"body": {
"encoding": "utf-8",
Expand All @@ -11,38 +11,38 @@
"Accept": "*/*",
"Accept-Encoding": "identity",
"Authorization": "Basic <BASIC_AUTH>",
"Connection": "keep-alive",
"Content-Length": "53",
"Connection": "close",
"Content-Length": "71",
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": "<USER_AGENT> PRAW/4.2.0dev0 prawcore/0.6.0"
"User-Agent": "<USER_AGENT> PRAW/7.8.2.dev0 prawcore/2.4.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\": 3600, \"scope\": \"*\"}"
"string": "{\"access_token\": \"<ACCESS_TOKEN>\", \"token_type\": \"bearer\", \"expires_in\": 86400, \"scope\": \"*\"}"
},
"headers": {
"Accept-Ranges": "bytes",
"Connection": "keep-alive",
"Content-Length": "105",
"Content-Type": "application/json; charset=UTF-8",
"Date": "Fri, 13 Jan 2017 01:15:07 GMT",
"Connection": "close",
"Content-Length": "846",
"Date": "Mon, 13 Apr 2026 20:49:06 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": "loid=i5oVu2uodL82AHTuIk; Domain=reddit.com; Max-Age=63071999; Path=/; secure",
"Strict-Transport-Security": "max-age=15552000; includeSubDomains; preload",
"Set-Cookie": "edgebucket=<REDACTED>; 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-Cache": "MISS",
"X-Cache-Hits": "0",
"X-Moose": "majestic",
"X-Served-By": "cache-lax8629-LAX",
"X-Timer": "S1484270107.205347,VS0,VE424",
"cache-control": "max-age=0, must-revalidate",
"x-content-type-options": "nosniff",
"x-frame-options": "SAMEORIGIN",
"x-xss-protection": "1; mode=block"
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "SAMEORIGIN",
"X-XSS-Protection": "1; mode=block",
"cache-control": "private, s-maxage=0, max-age=0, must-revalidate, no-store",
"content-type": "application/json; charset=UTF-8",
"expires": "-1",
"server-timing": "reddit-ct;desc=\"dn=FT,p=DFW,cs=MISS\""
},
"status": {
"code": 200,
Expand All @@ -52,7 +52,7 @@
}
},
{
"recorded_at": "2017-01-13T01:15:09",
"recorded_at": "2026-04-13T20:49:06",
"request": {
"body": {
"encoding": "utf-8",
Expand All @@ -65,11 +65,11 @@
"Connection": "keep-alive",
"Content-Length": "48",
"Content-Type": "application/x-www-form-urlencoded",
"Cookie": "loid=i5oVu2uodL82AHTuIk; loidcreated=1484270107000",
"User-Agent": "<USER_AGENT> PRAW/4.2.0dev0 prawcore/0.6.0"
"Cookie": "edgebucket=<REDACTED>",
"User-Agent": "<USER_AGENT> PRAW/7.8.2.dev0 prawcore/2.4.0"
},
"method": "POST",
"uri": "https://oauth.reddit.com/api/hide/?raw_json=1"
"uri": "https://oauth.reddit.com/api/hide?raw_json=1"
},
"response": {
"body": {
Expand All @@ -80,31 +80,27 @@
"Accept-Ranges": "bytes",
"Connection": "keep-alive",
"Content-Length": "2",
"Content-Type": "application/json; charset=UTF-8",
"Date": "Fri, 13 Jan 2017 01:15:08 GMT",
"Date": "Mon, 13 Apr 2026 20:49:06 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",
"Strict-Transport-Security": "max-age=15552000; includeSubDomains; preload",
"Strict-Transport-Security": "max-age=31536000; includeSubdomains",
"Via": "1.1 varnish",
"X-Cache": "MISS",
"X-Cache-Hits": "0",
"X-Moose": "majestic",
"X-Served-By": "cache-lax8625-LAX",
"X-Timer": "S1484270107.939195,VS0,VE110",
"cache-control": "private, s-maxage=0, max-age=0, must-revalidate, max-age=0, must-revalidate",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "SAMEORIGIN",
"X-XSS-Protection": "1; mode=block",
"cache-control": "private, s-maxage=0, max-age=0, must-revalidate, no-store",
"content-type": "application/json; charset=UTF-8",
"expires": "-1",
"x-content-type-options": "nosniff",
"x-frame-options": "SAMEORIGIN",
"x-ratelimit-remaining": "599.0",
"x-ratelimit-reset": "293",
"x-ratelimit-used": "1",
"x-ua-compatible": "IE=edge",
"x-xss-protection": "1; mode=block"
"server-timing": "reddit-ct;desc=\"dn=FT,p=DFW,cs=MISS\"",
"set-cookie": "loid=<REDACTED>; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Wed, 12-Apr-2028 20:49:06 GMT; secure",
"x-ua-compatible": "IE=edge"
},
"status": {
"code": 200,
"message": "OK"
},
"url": "https://oauth.reddit.com/api/hide/?raw_json=1"
"url": "https://oauth.reddit.com/api/hide?raw_json=1"
}
}
],
Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/integration/cassettes/TestSubmission.test_unhide.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"User-Agent": "<USER_AGENT> PRAW/4.0.0b8 prawcore/0.0.10"
},
"method": "POST",
"uri": "https://oauth.reddit.com/api/unhide/?raw_json=1"
"uri": "https://oauth.reddit.com/api/unhide?raw_json=1"
},
"response": {
"body": {
Expand Down Expand Up @@ -94,7 +94,7 @@
"code": 200,
"message": "OK"
},
"url": "https://oauth.reddit.com/api/unhide/?raw_json=1"
"url": "https://oauth.reddit.com/api/unhide?raw_json=1"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"http_interactions": [
{
"recorded_at": "2017-01-13T01:15:10",
"recorded_at": "2026-04-13T20:49:24",
"request": {
"body": {
"encoding": "utf-8",
Expand All @@ -11,38 +11,38 @@
"Accept": "*/*",
"Accept-Encoding": "identity",
"Authorization": "Basic <BASIC_AUTH>",
"Connection": "keep-alive",
"Content-Length": "53",
"Connection": "close",
"Content-Length": "71",
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": "<USER_AGENT> PRAW/4.2.0dev0 prawcore/0.6.0"
"User-Agent": "<USER_AGENT> PRAW/7.8.2.dev0 prawcore/2.4.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\": 3600, \"scope\": \"*\"}"
"string": "{\"access_token\": \"<ACCESS_TOKEN>\", \"token_type\": \"bearer\", \"expires_in\": 86400, \"scope\": \"*\"}"
},
"headers": {
"Accept-Ranges": "bytes",
"Connection": "keep-alive",
"Content-Length": "105",
"Content-Type": "application/json; charset=UTF-8",
"Date": "Fri, 13 Jan 2017 01:15:08 GMT",
"Connection": "close",
"Content-Length": "846",
"Date": "Mon, 13 Apr 2026 20:49:24 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": "loid=pw5Q7hU6oFcM5OJpQx; Domain=reddit.com; Max-Age=63071999; Path=/; secure",
"Strict-Transport-Security": "max-age=15552000; includeSubDomains; preload",
"Set-Cookie": "edgebucket=<REDACTED>; 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-Cache": "MISS",
"X-Cache-Hits": "0",
"X-Moose": "majestic",
"X-Served-By": "cache-lax8646-LAX",
"X-Timer": "S1484270108.339275,VS0,VE429",
"cache-control": "max-age=0, must-revalidate",
"x-content-type-options": "nosniff",
"x-frame-options": "SAMEORIGIN",
"x-xss-protection": "1; mode=block"
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "SAMEORIGIN",
"X-XSS-Protection": "1; mode=block",
"cache-control": "private, s-maxage=0, max-age=0, must-revalidate, no-store",
"content-type": "application/json; charset=UTF-8",
"expires": "-1",
"server-timing": "reddit-ct;desc=\"dn=FT,p=DFW,cs=MISS\""
},
"status": {
"code": 200,
Expand All @@ -52,7 +52,7 @@
}
},
{
"recorded_at": "2017-01-13T01:15:10",
"recorded_at": "2026-04-13T20:49:24",
"request": {
"body": {
"encoding": "utf-8",
Expand All @@ -65,11 +65,11 @@
"Connection": "keep-alive",
"Content-Length": "48",
"Content-Type": "application/x-www-form-urlencoded",
"Cookie": "loid=pw5Q7hU6oFcM5OJpQx; loidcreated=1484270108000",
"User-Agent": "<USER_AGENT> PRAW/4.2.0dev0 prawcore/0.6.0"
"Cookie": "edgebucket=<REDACTED>",
"User-Agent": "<USER_AGENT> PRAW/7.8.2.dev0 prawcore/2.4.0"
},
"method": "POST",
"uri": "https://oauth.reddit.com/api/unhide/?raw_json=1"
"uri": "https://oauth.reddit.com/api/unhide?raw_json=1"
},
"response": {
"body": {
Expand All @@ -80,31 +80,27 @@
"Accept-Ranges": "bytes",
"Connection": "keep-alive",
"Content-Length": "2",
"Content-Type": "application/json; charset=UTF-8",
"Date": "Fri, 13 Jan 2017 01:15:09 GMT",
"Date": "Mon, 13 Apr 2026 20:49:24 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",
"Strict-Transport-Security": "max-age=15552000; includeSubDomains; preload",
"Strict-Transport-Security": "max-age=31536000; includeSubdomains",
"Via": "1.1 varnish",
"X-Cache": "MISS",
"X-Cache-Hits": "0",
"X-Moose": "majestic",
"X-Served-By": "cache-lax8622-LAX",
"X-Timer": "S1484270109.011793,VS0,VE102",
"cache-control": "private, s-maxage=0, max-age=0, must-revalidate, max-age=0, must-revalidate",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "SAMEORIGIN",
"X-XSS-Protection": "1; mode=block",
"cache-control": "private, s-maxage=0, max-age=0, must-revalidate, no-store",
"content-type": "application/json; charset=UTF-8",
"expires": "-1",
"x-content-type-options": "nosniff",
"x-frame-options": "SAMEORIGIN",
"x-ratelimit-remaining": "598.0",
"x-ratelimit-reset": "291",
"x-ratelimit-used": "2",
"x-ua-compatible": "IE=edge",
"x-xss-protection": "1; mode=block"
"server-timing": "reddit-ct;desc=\"dn=FT,p=IAH,cs=MISS\"",
"set-cookie": "loid=<REDACTED>; Domain=reddit.com; Max-Age=63071999; Path=/; expires=Wed, 12-Apr-2028 20:49:24 GMT; secure",
"x-ua-compatible": "IE=edge"
},
"status": {
"code": 200,
"message": "OK"
},
"url": "https://oauth.reddit.com/api/unhide/?raw_json=1"
"url": "https://oauth.reddit.com/api/unhide?raw_json=1"
}
}
],
Expand Down
Loading
Loading