LucaTNT / telegram-bot-amazon

Telegram bot to replace Amazon affiliate tags in links
64 stars 50 forks source link

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

Closed jbridges28 closed 1 year ago

jbridges28 commented 1 year ago

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=enUS&ref=as_li_ss_tl

jbridges28 commented 1 year ago

When setting RAW_LINKS=true , everything works fine.

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