Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out how to handle shortened share links #8

Open
dgw opened this issue Sep 25, 2023 · 1 comment · May be fixed by #16
Open

Figure out how to handle shortened share links #8

dgw opened this issue Sep 25, 2023 · 1 comment · May be fixed by #16
Labels
enhancement New feature or request
Milestone

Comments

@dgw
Copy link
Member

dgw commented Sep 25, 2023

Reddit's gone full dumb with shareable links that look like https://reddit.com/r/comics/s/95j2GYWoSR.

This format seems to come only from their mobile apps, but it's damned useless for parsing in a chat bot. There's no obvious relationship between (any part of) the short "keyword" and the submission/comment ID it links to.

It's possible to handle these by using a Host: www.reddit.com header to skip an unnecessary redirect and then parse the Location header returned by https://www.reddit.com/r/comics/s/95j2GYWoSR for the actual submission/comment ID, but that's pretty obnoxious.

@dgw dgw added the help wanted Extra attention is needed label Sep 25, 2023
@dgw
Copy link
Member Author

dgw commented Nov 10, 2023

praw-dev/praw#1994 added this, though there'll be some control-flow issues to solve in this plugin whenever that feature is available in a new praw release.

The implementation depends on passing a share link to either reddit.submission or reddit.comment, but if the share link points to the wrong type of item, praw.exceptions.ClientException is raised. There is no way to tell in advance what type of item one of these share links points to (thanks, Reddit).

@dgw dgw added enhancement New feature or request and removed help wanted Extra attention is needed labels Nov 10, 2023
@dgw dgw added this to the 1.1.0 milestone Nov 10, 2023
@dgw dgw modified the milestones: 1.1.0, 1.2.0 Mar 20, 2024
@half-duplex half-duplex linked a pull request Sep 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant