redlib icon indicating copy to clipboard operation
redlib copied to clipboard

🐛 Bug Report: `tl` query param broken

Open mattfbacon opened this issue 9 months ago • 0 comments

Describe the bug

Some search engines add the tl query parameter indicating a translated post into the given language. This somehow changes the returned JSON which causes a parse failure in redlib.

Steps to reproduce the bug

  1. Go to https://reddit.com/r/cats/comments/1jfi4vm/after_a_long_long_day?tl=de (the exact post doesn't matter) with a redlib instance.

What's the expected behavior?

I think the tl parameter should be removed entirely, i.e., reply with a redirect to remove the parameter if it is present. I hate these machine translations. Alternatively we could investigate why the JSON is different and handle it.

Additional context / screenshot

Error message:

Failed to parse page JSON data: expected value at line 2 column 5 | /r/cats/comments/1jfi4vm/after_a_long_long_day.json?tl=de&sort=confidence&raw_json=1
  • [x] I checked that the instance that this was reported on is running the latest git commit, or I can reproduce it locally on the latest git commit

mattfbacon avatar Mar 20 '25 18:03 mattfbacon