dylanpdx / bettertwitfix Goto Github PK
View Code? Open in Web Editor NEWThis project forked from daisyuniverse/twitfix
Fix Twitter video embeds in Discord (and Telegram!)
License: Do What The F*ck You Want To Public License
This project forked from daisyuniverse/twitfix
Fix Twitter video embeds in Discord (and Telegram!)
License: Do What The F*ck You Want To Public License
Since Twitter is changing its domain to x.com, how can I use this tool with x,com?
https://vxtwitter.com/rockstargames/status/1689969964923432960
The text cuts off after "Today, we are proud to announce that".
Hello, I'm not sure how hard this would be, the literal only "complaint" that I have for this site/code is that the kind of animations that I often see are about 1 to 6 seconds, and I would love to see an option to have them continually loop. Seems like a potential addition to links ending in mp4
Here is a wonderful example: https://twitter.com/Kekeflipnote/status/1584464315662602240
Investigating this issue where Tweets are not embedding properly.
So far, I have found that Twitter is returning an empty response when I ask for info about a Tweet
So recently Twitter/X updated how you share on mobile, replacing Twitter links with X links instead, e.g. https://x.com/sorainu1211EAKA/status/1702276756944851399
vxTwitter doesn't seem to work with X links at this moment.
EDIT: I should elaborate. You can change X to vxtwitter and it will work, but it is quite a hassle to do so in my opinion.
Today I tried to use vxtwitter but the website returns error 502. Is the server currently offline?
I am getting the following error after trying to bring the containers up with docker compose up -d
:
------
> [deps 5/5] RUN pip install -r requirements.txt:
#0 2.270 ERROR: Could not find a version that satisfies the requirement pymongo==4.3.3 (from versions: 0.1rc0, 0.1.1rc0, 0.1.2rc0, 0.2rc0, 0.3rc0, 0.3.1rc0, 0.4rc0, 0.5rc0, 0.5.1rc0, 0.5.2rc0, 0.5.3rc0, 0.6, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.9, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 0.9.7, 0.10, 0.10.1, 0.10.2, 0.10.3, 0.11, 0.11.1, 0.11.2, 0.11.3, 0.12, 0.13, 0.14, 0.14.1, 0.14.2, 0.15, 0.15.1, 0.15.2, 0.16, 1.0, 1.1, 1.1.1, 1.1.2, 1.2, 1.2.1, 1.3, 1.4, 1.5, 1.5.1, 1.5.2, 1.6, 1.7, 1.8, 1.8.1, 1.9, 1.10, 1.10.1, 1.11, 2.0, 2.0.1, 2.1, 2.1.1, 2.2, 2.2.1, 2.3, 2.4, 2.4.1, 2.4.2, 2.5, 2.5.1, 2.5.2, 2.6, 2.6.1, 2.6.2, 2.6.3, 2.7, 2.7.1, 2.7.2, 2.8, 2.8.1, 2.9, 2.9.1, 2.9.2, 2.9.3, 2.9.4, 2.9.5, 3.0, 3.0.1, 3.0.2, 3.0.3, 3.1, 3.1.1, 3.2, 3.2.1, 3.2.2, 3.3.0, 3.3.1, 3.4.0, 3.5.0, 3.5.1, 3.6.0, 3.6.1, 3.7.0, 3.7.1, 3.7.2, 3.8.0, 3.9.0, 3.10.0, 3.10.1, 3.11.0, 3.11.1, 3.11.2, 3.11.3, 3.11.4, 3.12.0, 3.12.1, 3.12.2, 3.12.3, 3.13.0, 4.0, 4.0.1, 4.0.2, 4.1.0, 4.1.1)
#0 2.270 ERROR: No matching distribution found for pymongo==4.3.3
------
failed to solve: process "/bin/sh -c pip install -r requirements.txt" did not complete successfully: exit code: 1
Hi! I use IFTTT in order to post tweets to a Discord channel via a webhook.
My issue is, IFTTT doesn't allow arbitrary rewriting of parameters without Pro+. The link to the tweet is provided as a parameter called {{LinkToTweet}}
whose value is "https://twitter.com/Twitter/status/1492120137205526528"
in its entirety. Because of this, there's no way to replace twitter with vxtwitter without a JS filter, which requires the highest subscription tier of IFTTT.
However, another option would be to prepend it like so: https://vxtwitter.com/{{LinkToTweet}}
which would expand to "https://vxtwitter.com/https://twitter.com/Twitter/status/1492120137205526528"
. This currently generates a link that has a correct-looking embed, but clicking the link sends you to a redirect loop that eventually 400s. The redirects go:
...and so on. Can the nginx config be changed, please, to support this use case?
Not an issue, but but could you please provide the steps so someone like me, who has no linux knowledge, can deploy your bot on an ubuntu droplet?
Much appreciated if possible!
It appears that the embed description is trimmed to about 240 characters. It would be nice if this limit could be increased, maybe to 500 characters?
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 = {
'&': '&',
'>': '>',
'<': '<',
'"': '"',
'\'': '''
};
Please add the possibly_sensitive flag to the API
At the moment https://vxtwitter.com/relativityspace/status/1532069087718699008 returns
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
Date: Wed, 01 Jun 2022 21:19:09 GMT
Server: nginx/1.18.0 (Ubuntu)
Transfer-Encoding: chunked
<!DOCTYPE html>
<html lang="en">
<head>
<title>vxTwitter</title>
<meta content="vxTwitter" property="og:title" />
<meta content="Failed to scan your link! This may be due to an incorrect link, private account, or the twitter API itself might be having issues (Check here: https://api.twitterstat.us/)" property="og:description" />
<meta content="https://github.com/dylanpdx/BetterTwitFix" property="og:url" />
<meta content="#43B581" name="theme-color" />
<meta http-equiv = "refresh" content = "0; url = https://github.com/dylanpdx/BetterTwitFix" />
</head>
<body>
You will be redirected to this projects github page in a moment. <a href="https://github.com/dylanpdx/BetterTwitFix">Or click here.</a>
</body>
</html>
Though https://twitter.com/relativityspace/status/1532069087718699008 is a valid, public, and active tweet, and https://api.twitterstat.us/ nor https://status.linode.com/ reports any issues. Other tweets like https://vxtwitter.com/CosmicalChief/status/1531994523156549635 results in correct embed
vxtwitter:
https://i.imgur.com/6GVXFMJ.png
original twitter:
https://i.imgur.com/06iIQJC.png
Original twitter has a youtube link in it, but vxtwitter doesn't.
Hey there
When using a vxtwitter link in telegram, it just shows the video, but not the text. Is it possible for it to show both the video and the text, or is this a limitation on telegram's side?
At the moment, I see a lot of folks posting a twitter link and a vxtwitter link, or posting the vxtwitter link and copy-pasting the caption into the message or whatnot.
An example:
I'd like to do some major refactoring and generally improve code readability, then lead into #20
{
"id": 12345,
"text": "this is the tweet body",
"media": [
{
"url": "https://pbs.twimg.com/media/aaaaaaa.jpg",
"type": "image",
"size": {
"width": 1,
"height": 1
}
},
{
"url": "https://pbs.twimg.com/media/xxxxxxx.mp4",
"type": "video",
"size": {
"width": 1,
"height": 1
}
},
{
"url": "https://pbs.twimg.com/media/yyyyy.gif",
"type": "gif",
"size": {
"width": 1,
"height": 1
}
}
],
"likes": 123,
"nsfw": false,
"pfp": "url",
"qrtURL": null,
"rts": 456,
"views": 789,
"replies": 555,
"screen_name": "user",
"time": "2023-07-06T12:26:39.000Z",
"ttl": 1688800953,
"uploaderName": "User",
"verified": false,
"poll": null
}
Possibly an "edited" field will be needed as well.
This will allow for embeds consisting of all one type (i.e all images) to be combined, and embeds of mixed types to support a /1, /2, /3, or /4 path
General code refactoring
Code in general needs to be cleaned up. The cache/twExtract stuff was a good start but a lot is still a mess (my fault!)
Templates specifically could use some rewrites to only take in the VNF object and use that in the template HTML
Other misc. things to consider
Removing the Cache system: NGINX Content Caching or CloudFront/CloudFlare can be used for this. This makes setup more of a pain, however
Remove user agent check: Again, could probably be handled by NGINX or CloudFlare, but improves setup complexity.
Embed changes: Moving around which fields display where in an embed. Only issue is Video embeds which don't show description in Discord
Separating README into separate pages (or a wiki?)
Tests using VNF objects will probably have to be changed
Hello. I know this is the wrong place to ask but i couldn't figure out where to ask.
I saw you expanded the VX Service to TikTok and i was wondering if u planned to do it for 9GAG or Reddit aswell?
Greetings
I'm sure "GIFs" used to work before, but now I always get an error. Videos and images still work.
Example Link: https://vxtwitter.com/pixeljess/status/1569713891336126464
I hope this is easy fixable. Thank you for BetterTwitFix!
embeds don't load in whatsapp
The twitter app now gives me an x.com link when I copy from a tweet. fxtwitter has 'fixupx.com' . Could a second url be added so I don't need to type out vxtwitter every time?
I habitually share stuff from twitter to various groups in telegram, and it's always a hassle when the tweet has multiple images in it. Recently Telegram has gotten super unreliant in embedding Twitter posts (either shows the post, shows just the text "[Twitter in some language] / Twitter", or fails to embed entirely) so I've had to use vx if there's a single image or c.vx if there's multiple. The problem is Telegram likes to lower the quality of images, even embedded ones, so the combined image gets shrunken down to the point where if there's text (like in a comic) you can't read any of it.
So my request is: Please find a way to show all images as separate image embeds in the same link? Discord will sometimes support it (mostly on desktop I think?) and Telegram used to support it as well, so it's definitely possible somehow.
an image and a video can be on the same tweet like this one: https://twitter.com/lilillililXX/status/1578611365513547776
when doing something like https://fxtwitter.com/lilillililXX/status/1578611365513547776/video/2
, a embedded video is expected
but from my limited testing, the result is either the image in the 1st tab, just the tweet itself, or nothing at all
So apparently, some links are failing to embed, with them saying Unknown Error. I don't know what's going on.
https://www.ssllabs.com/ssltest/analyze.html?d=vxtwitter.com&s=44.214.7.93#whyNotTrusted
https://www.ssllabs.com/ssltest/analyze.html?d=vxtwitter.com&s=18.207.38.70#whyNotTrusted
browsers will now consider the https://vxtwitter.com as insecure / non trust-able domain
as result there is also lack of Strict-Transport-Security
and some other issues (headers etc.) most likely due to the same issue with certificate
When linking a Tweet containing a video the tweet and text embeds but the video is not present. This is likely due to recent changes in the Twitter API as I know some video download sites also broke recently after these changes.
Would it be possible to make URLs clickable?
Currently the only way to open links from vxtwitter embeds is to copy that part of the text manually. This is ever less convenient on mobile because only the entire tweet text can be copied through click-and-hold. Blue-underlined URLs would be a great addition
Hello!
When I use vxtwitter links on Discord, the embed works great, but when I click the link, I'm no longer directed to the actual Twitter page. I get the error message "502 Bad Gateway".
I think this is a very recent issue! It wasn't like this before, so perhaps something broke down the pipeline.
While a niche use case, I use a browser plugin that highlights links of tweets and accounts that I have added to archival programs. The default twitter embed includes a link to the account page, so that link is detected and highlighted by the plugin. However the vxtwitter embed has a link to the post, which isn't always highlighted as the archival programs don't frequently check for new posts (every few days/weeks).
I see this as a bit redundant, as the same post link is directly above the embed. I think it could just be changed to the account link, or if supported by web embeds the author url
parameter for discord could be used so the vxTwitter
would link to the account. Either way would make the link highlighting work for this program and let users see if they have an account archived at a glance.
This is said plugin for reference, sorry for no screenshots. It integrates with the later two links. No support is directly needed for these, just changing the link to point to the account page will work. I included these to show that while niche, there's still an amount of people that could benefit from this change.
https://gitgud.io/prkc/hydrus-companion
https://gitgud.io/thatfuckingbird/hydownloader
https://github.com/hydrusnetwork/hydrus
When using vxtwitter in the discord app on my 2 Android phones, embeds don't work, when I hit the play button on the video, it still opens in the external web browser.
But I've asked some other people and for them it works properly, as it plays the video from the tweet straight in their discord app on their phones, be it on Android or iphone.
Any idea why is this happening and is there anything I can do to make it work as intended on my phones?
FxTwitter has it, seems easy to implement
consider the following: https://vxtwitter.com/EsemicolonR/status/1578189293024997377
A default twitter embed will show the retweeted video (but still not be able to play it properly), while vxtwitter will not show it at all and will oblige you to instead link to both the tweet and the retweeted tweet in order to get both the 'retweet' and also the retweeted video
it would be nice if it instead was able to show the retweeted video directly, mirroring what twitter itself is doing
If this can be within the scope of this project... It's currently hit-or-miss whether a Twitter link will embed a preview correctly when sharing on Mastodon. And I presume other sites as well. I'm hoping the fediverse gains more traction, and if vxTwitter can be used the same way as on Discord, it could improve our ability to share.
When combining three pictures, vxtwitter uses
+---+---+
| A | B |
+---+---+
| C |
+---+---+
arrangement. This is totally fine, and when image C is portrait it would fit-to-height just fine, but when it is landscape sometimes for some reason it isn't set as fit-to-window.
There are still issues with empty space on combined images.
https://vxtwitter.com/datcravat/status/1679584240499847169
My guess for a while is, that the width calculation is wrong. The width of the biggest image seems to be applied to all the other images.
Like with these, too:
https://vxtwitter.com/IonicIsaac/status/1679212095500591104
https://vxtwitter.com/_oceaninspace/status/1677754863436832768
https://vxtwitter.com/HollyAndThorn/status/1676321471554093057
Any plans to set something up for nicovideo.jp?
When clicking a vxtwitter embed, the link for the tweet text goes to the account user's page.
When clicking the name of the user, it goes to the specific tweet.
This is kinda backwards from what one would expect it to be, and I think it might be a bug?
https://twitter.com/elonmusk/status/1586104694421659648
it has hit 2 millions 💖 and 228.6K Retweets 34.7K Quote Tweets and it said 💖 4713 🔁 592
https://twitter.com/elonmusk/status/1580350143445942272
the second one is not that much different
display: 💖 306060 🔁 19826
twitter: 19.8K Retweets 1,975 Quote Tweets 306K 💖
I just moved to android and so I know the issue is non existent on IOS but for some reason whenever I download a video it downloads as a .bin and I need to go into a file editor and manually change the extension to .mp4 to fix it, I dunno if there's any fix for it..
I can't open the http://vxtwitter.com/... link. It will give ERR_EMPTY_RESPONSE, and I need to manually change it to https to open the page. Tested on iOS Safari and Android Chrome. PC and Android Firefox can automatically jump to https and open the link however.
While fxtwitter can show vote results in Discord, vxtwitter and normal twitter can't do that at all.
All the examples I could fined are NSFW tagged by twitter. Maybe thats related?
This two links have the same output:
https://vxtwitter.com/EchoSaber1/status/1679566086549786625
https://vxtwitter.com/EchoSaber1/status/1679566088181370881
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.