s9e / TextFormatter

Text formatting library that supports BBCode, HTML and other markup via plugins. Handles emoticons, censors words, automatically embeds media and more.
MIT License
232 stars 35 forks source link

Amazon media embed not working (removes parameters) #116

Closed rookey closed 5 years ago

rookey commented 5 years ago

Hello,

it seems that since a few months, the a9a/mediaembed plugin isn't working for Amazon links anymore.

Example link as posted by the user: https://www.amazon.de/Neue-Antidepressiva-atypische-Neuroleptika-Niedrigdosierung/dp/3925931686/ref=as_li_ss_tl?ie=UTF8&linkCode=ll1&tag=rlf&linkId=52cca62ff5aea79f228a5e519566bb5e&language=de_DE

The preview image of Amazon displays fine, it also contains the link - only the &tag=rlf parameter is truncated to an empty one (&tag=).

Looking at the source, the code for the preview frame created is <span data-s9e-mediaembed="amazon" style="display:inline-block;width:100%;max-width:120px"><span style="display:block;overflow:hidden;position:relative;padding-bottom:200%"><iframe allowfullscreen="" scrolling="no" style="background:url(https://www.amazon.com/favicon.ico) center no-repeat;border:0;height:100%;left:0;position:absolute;width:100%" src="//ws-eu.assoc-amazon.com/widgets/cm?l=as1&amp;f=ifr&amp;o=3&amp;t=&amp;asins=3925931686"></iframe></span></span> which looks to me as if the "t=…" parameter is supposed to hold the "associates tag", but it is empty.

Is there any way to preserve the &tag= parameter if one is already there?

JoshyPHP commented 5 years ago

The plugin works as intended. The Amazon associate tag of the original link is ignored and only the Amazon associate tags set during configuration are used. The template parameter AMAZON_ASSOCIATE_TAG_DE can be used to set an Amazon associate tag for their .de site. Other template parameters are listed below.