chauduyphanvu / reddit-markdown

MIT License
34 stars 6 forks source link

images of posts (which also have text) #9

Closed PurposeRefined1179 closed 1 year ago

PurposeRefined1179 commented 1 year ago

Hey @chauduyphanvu , I tried this script today, it's great. In posts where there are both images and text, the link (see image below) generated in the file contains "&" instead of just "&", hence giving the 403 forbidden page when clicked

image image

Reddit post url provided to the program:

https://www.reddit.com/r/ObsidianMD/comments/104k0om/script_save_reddit_posts_to_obsidian/

I am new on github (and new to programming js and rb), so I don't know if I am posting this in the right place, thanks!

chauduyphanvu commented 1 year ago

Hey, thanks for the report—you posted it to the right place :) I will take a look and circle back.

chauduyphanvu commented 1 year ago

Hello, I checked this out and it appears to be an issue from Reddit itself. If you download the post directly via the browser by appending .json to the post URL so that it is https://www.reddit.com/r/ObsidianMD/comments/104k0om/script_save_reddit_posts_to_obsidian/.json, you can see the JSON response contains that weird encoding issue already.

For example:

https://preview.redd.it/qtl3p2hcjcaa1.png?width=2832&format=png&auto=webp&v=enabled&s=11b50f9134119a9bcbe7b29ce9477b873f0b79ae

Regardless, I've added additional safeguards for that in the v1.4.0 released in https://github.com/chauduyphanvu/reddit-markdown/releases/tag/1.4.0. Check it out and let me know if the issue persists!