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

reddit: handle image preview links #2245

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

half-duplex
Copy link
Member

@half-duplex half-duplex commented Feb 4, 2022

Description

The reddit plugin currently does not handle preview links like this, which users sometimes mistakenly post ("Copy image link" instead of "Copy link").
https://preview.redd.it/rgcetuc1rmf81.jpg?width=576&auto=webp&s=61de9945ce109cefe95cda589c18d434b2d23553

It falls through to url.py, which fails to find a title.
This changes the reddit.py image link handling to also catch preview links, and show both the comment and full-res links in that case.

pytest is currently exploding on master and I don't know why so uh. CI is doing my QA for me

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
  • I have tested the functionality of the things this change touches

Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grudgingly, I have to admit these are worth handling. Reddit is awful for making it so hard to get at the original media, but it's not users' fault. Just got a style comment.

sopel/modules/reddit.py Outdated Show resolved Hide resolved
@dgw dgw added this to the 7.1.8 milestone Feb 5, 2022
Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought this was approved, whoops.

@dgw dgw merged commit 9279220 into sopel-irc:master Feb 10, 2022
dgw added a commit that referenced this pull request Feb 10, 2022
reddit: handle image preview links
@half-duplex half-duplex deleted the reddit-preview-links branch February 11, 2022 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants