Bug report: reddit now has amp links

🔨 Bug Report

##Bug report:

In this comment we had the link:

https://amp-reddit-com.cdn.ampproject.org/wp/s/amp.reddit.com/r/CombatFootage/comments/o765q4/russian_coast_guard_video_of_hms_defender/?usqp=mq331AQKKAFQArABIIACAw%3D%3D

AmputatorBot was summoned and it ended up with this link:

https://amp-reddit-com.cdn.ampproject.org/wp/s/reddit.com/r/CombatFootage/comments/o765q4/russian_coast_guard_video_of_hms_defender/?usqp=mq331AQKKAFQArABIIACAw%3D%3D

And this message:

Still AMP, but no longer cached - unable to process further

The canonical URL should be:

https://www.reddit.com/r/CombatFootage/comments/o765q4/russian_coast_guard_video_of_hms_defender/

##Suggested action:

Since this is happening on reddit itself, reddit amp links are probably going to be common. If a canonical URL cannot be extracted, I suggest hardcoding a regexp translation to produce canonical URLs.

Thank you.

Posted Jul 21, 2021, 3:23 PM UTC

179
aeon314159•

I think this is a good idea, and I have experienced this problem once before. I love summoning AmputatorBot.

2
kc2sykOP•

Thanks, I hope u/Killed_Mufasa agrees.

2
lemurrhino•

Hey, my friend made a PR fixing this issue on the github repo. It's up to the owner to accept it. We found this bug as well when migrating the code to work with our discord bot.

2
kc2sykOP•
2
Killed_Mufasa•
1
kc2sykOP•

Yay! Thank you!

2
Killed_Mufasa•

No worries, thank you for bringing this to our attention :)

1
lemurrhino•

Funny timing, we wrote our own a few weeks ago haha. Your's looks better though.

2