LucaTNT/telegram-bot-amazon

Messed up final URL when given a link to a promotion page

Closed this issue · 1 comments

I noticed that when the bot is given a link to a promotion page it results in a link that is not usable.

Is there a way that when give a link like this, the bot can avoid or correct the final resulting link?

I'm assuming that the bot is not able to find a proper ASIN because it is not a product page.

Example:
Bot is given a short link -> Expands URL -> If the result is "https://www.amazon.com/promotion/*" -> Return original link (even if it can't find the ASIN or switch the tag)

Example from bot:
Long URL https://amzn.to/3FghFhW -> ASIN https://www.amazon.com/promotion/psp/A3NGTCD7IZOQ2C?&linkCode=sl2&tag={TAG REMOVED}&linkId=39f0e7ec60dd32e40e61547061091777&language=en_US&ref_=as_li_ss_tl

When setting RAW_LINKS=true , everything works fine.

So it must be an issue with the URL Beautifier and product promotion pages