dylanpdx / BetterTwitFix

Fix Twitter video embeds in Discord (and Telegram!)
Do What The F*ck You Want To Public License
1.17k stars 48 forks source link

Twitter escaped HTML chars in API text #152

Closed Scrxtchy closed 1 year ago

Scrxtchy commented 1 year ago

twitter would convert some chars like & > and < to their HTML-safe counterparts in tweet text as a security measure on itself or third party sites. Tweets that are embeded from the VNF data on BTF don't have this issue, but when fetched over the BTF API, then this issue starts to appear https://github.com/dylanpdx/BetterTwitFix/blob/main/twitfix.py#L226

from the tweetdeck source, if it's easier to process these in code rather than fetching the expected text from the server

        var HTML_ENTITIES = {
            '&': '&amp;',
            '>': '&gt;',
            '<': '&lt;',
            '"': '&quot;',
            '\'': '&#39;'
        };
dylanpdx commented 1 year ago

This should be fixed now! Sorry for the delay

Scrxtchy commented 1 year ago

Data's looking great now, thanks Dylan