commitaae42b88c9Merge:f2cec85ab59881Author: Dylan <dylanpdx@gmail.com> Date: Thu Jun 15 09:16:46 2023 +0100 Merge branch 'main' of github.com:dylanpdx/BetterTwitFix commitf2cec8521fAuthor: Dylan <dylanpdx@gmail.com> Date: Thu Jun 15 09:16:41 2023 +0100 Very very quick fix for API changes commitab5988148cMerge:16f133a1511551Author: Dylan <dylanpdx@gmail.com> Date: Sat Jun 3 15:04:23 2023 +0100 Merge pull request #98 from dylanpdx/dependabot/pip/boto3-1.26.146 Bump boto3 from 1.26.133 to 1.26.146 commit1511551719Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Jun 3 13:34:51 2023 +0000 Bump boto3 from 1.26.133 to 1.26.146 Bumps [boto3](https://github.com/boto/boto3) from 1.26.133 to 1.26.146. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.26.133...1.26.146) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> commit16f133a11bMerge:9f8f3ea6b884d4Author: Dylan <dylanpdx@gmail.com> Date: Sat Jun 3 14:34:10 2023 +0100 Merge pull request #96 from dylanpdx/dependabot/pip/requests-2.31.0 Bump requests from 2.30.0 to 2.31.0 commit6b884d42b0Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon May 29 02:00:29 2023 +0000 Bump requests from 2.30.0 to 2.31.0 Bumps [requests](https://github.com/psf/requests) from 2.30.0 to 2.31.0. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.30.0...v2.31.0) --- updated-dependencies: - dependency-name: requests dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> commit9f8f3ea41eMerge:cda291fa710867Author: Dylan <dylanpdx@gmail.com> Date: Tue May 16 15:44:07 2023 +0100 Merge branch 'prod' into main commitcda291fe9eAuthor: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue May 16 15:42:18 2023 +0100 Bump boto3 from 1.26.129 to 1.26.133 (#92) Bumps [boto3](https://github.com/boto/boto3) from 1.26.129 to 1.26.133. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.26.129...1.26.133) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit5cb8d479f5Author: Dylan <dylanpdx@gmail.com> Date: Tue May 16 15:40:34 2023 +0100 Fixed QRTs sometimes failing to embed commitb7f285c2cdMerge:66c004449ec005Author: Dylan <dylanpdx@gmail.com> Date: Tue May 16 15:32:28 2023 +0100 Merge branch 'main' of github.com:dylanpdx/BetterTwitFix commit66c004453bAuthor: Dylan <dylanpdx@gmail.com> Date: Sun May 14 22:04:35 2023 +0100 Increased timeout to 15 commit49ec0059cdAuthor: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue May 9 16:53:02 2023 +0100 Bump boto3 from 1.26.127 to 1.26.129 (#90) Bumps [boto3](https://github.com/boto/boto3) from 1.26.127 to 1.26.129. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.26.127...1.26.129) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commitc395c00a11Author: Dylan <dylanpdx@gmail.com> Date: Fri May 5 14:08:23 2023 +0100 Fix text trimming with images and text posts commitc6840ad093Author: Dylan <dylanpdx@gmail.com> Date: Fri May 5 13:56:45 2023 +0100 Revert "Fix text trimming w/ old limits" This reverts commit9d9c32b797. commit9d9c32b797Author: Dylan <dylanpdx@gmail.com> Date: Fri May 5 13:46:42 2023 +0100 Fix text trimming w/ old limits commitdda1187f4aMerge:14c9426f0065ceAuthor: Dylan <dylanpdx@gmail.com> Date: Thu May 4 23:48:42 2023 +0100 Merge branch 'prod' into main commit14c942645cMerge:d621bfce895e4cAuthor: Dylan <dylanpdx@gmail.com> Date: Thu May 4 23:45:19 2023 +0100 Merge pull request #84 from dylanpdx/dependabot/pip/requests-2.30.0 Bump requests from 2.28.2 to 2.30.0 commite895e4c876Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu May 4 22:44:08 2023 +0000 Bump requests from 2.28.2 to 2.30.0 Bumps [requests](https://github.com/psf/requests) from 2.28.2 to 2.30.0. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.28.2...v2.30.0) --- updated-dependencies: - dependency-name: requests dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> commitd621bfc8a8Merge:727d14498e006bAuthor: Dylan <dylanpdx@gmail.com> Date: Thu May 4 23:43:28 2023 +0100 Merge pull request #86 from dylanpdx/dependabot/pip/boto3-1.26.127 Bump boto3 from 1.26.104 to 1.26.127 commit727d144eceMerge:1a698c1618a644Author: Dylan <dylanpdx@gmail.com> Date: Thu May 4 23:42:04 2023 +0100 Merge pull request #87 from dylanpdx/dependabot/npm_and_yarn/simple-git-3.18.0 Bump simple-git from 3.7.1 to 3.18.0 commit618a644070Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu May 4 22:40:58 2023 +0000 Bump simple-git from 3.7.1 to 3.18.0 Bumps [simple-git](https://github.com/steveukx/git-js/tree/HEAD/simple-git) from 3.7.1 to 3.18.0. - [Release notes](https://github.com/steveukx/git-js/releases) - [Changelog](https://github.com/steveukx/git-js/blob/main/simple-git/CHANGELOG.md) - [Commits](https://github.com/steveukx/git-js/commits/simple-git@3.18.0/simple-git) --- updated-dependencies: - dependency-name: simple-git dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> commit98e006b31cAuthor: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu May 4 22:39:39 2023 +0000 Bump boto3 from 1.26.104 to 1.26.127 Bumps [boto3](https://github.com/boto/boto3) from 1.26.104 to 1.26.127. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.26.104...1.26.127) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> commit1a698c1d6fMerge:a6eb39e8205ef2Author: Dylan <dylanpdx@gmail.com> Date: Thu May 4 23:38:58 2023 +0100 Merge pull request #71 from dylanpdx/dependabot/pip/pillow-9.5.0 Bump pillow from 9.4.0 to 9.5.0 commita6eb39e545Author: Dylan <dylanpdx@gmail.com> Date: Thu May 4 23:35:52 2023 +0100 Fix tweet not found test commitd84938ee08Author: Dylan <dylanpdx@gmail.com> Date: Thu May 4 23:29:12 2023 +0100 Fixed tweet not found error commit69b99dcc9bAuthor: Dylan <dylanpdx@gmail.com> Date: Thu May 4 23:08:11 2023 +0100 Revert "Add info message for #74" This reverts commit39490a49b9. commit8674c8d828Author: Dylan <dylanpdx@gmail.com> Date: Thu May 4 23:07:15 2023 +0100 Fix/workarounds for failing tests commit3127fff1aeAuthor: Dylan <dylanpdx@gmail.com> Date: Thu May 4 22:45:55 2023 +0100 Update gitignore commit6244c875c4Author: Dylan <dylanpdx@gmail.com> Date: Sun Apr 9 23:11:31 2023 +0100 Fix small embed sizes commitedfeefbc00Author: Dylan <dylanpdx@gmail.com> Date: Sun Apr 9 22:26:38 2023 +0100 Fix NSFW video embeds commitdd961df082Author: Dylan <dylanpdx@gmail.com> Date: Sat Apr 8 18:11:14 2023 +0100 Update deploy workflow commit8205ef2400Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Apr 8 16:59:27 2023 +0000 Bump pillow from 9.4.0 to 9.5.0 Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.4.0 to 9.5.0. - [Release notes](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst) - [Commits](https://github.com/python-pillow/Pillow/compare/9.4.0...9.5.0) --- updated-dependencies: - dependency-name: pillow dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
vxTwitter
(A fork of TwitFix) Basic flask server that serves fixed twitter video embeds to desktop discord by using either the Twitter API or Youtube-DL to grab tweet video information. This also automatically embeds the first link in the text of non video tweets (API Only)
Differences from fxtwitter
fxtwitter exposed all recently processed tweets publicly via a "latest" and "top" page.
Even though Tweets are public, it was a personal concern for me that a tweet with potentially sensitive information in it could suddenly be shown to however many people were browsing the latest tweets page, and could be used as a tool for harassment. This was removed in The following commit
How to use (discord side)
just put the url to the server, and directly after, the full URL to the tweet you want to embed
I now have a copy of this running on a Linode server, you can use it via the following url
https://vxtwitter.com/[twitter video url] or [last half of twitter url] (everything past twitter.com/)
You can also simply type out 'vx' directly before 'twitter.com' in any valid twitter video url, and that will convert it into a working vxTwitter url, for example:
Note: If you enjoy this service, please considering donating via Ko-Fi to help cover server costs
I do not monitor any tweets processed by this server. Additionally, if you plan on hosting the code yourself and are concerned about this, be sure to check how to disable logging on the web server you are using (i.e Nginx)
How to run (server side)
this script uses the youtube-dl python module, along with flask, twitter and pymongo, so install those with pip (you can use pip install -r requirements.txt) and start the server with python twitfix.py
I have included some files to give you a head start on setting this server up with uWSGI, though if you decide to use uWSGI I suggest you set up mongoDB link caching
Config
vxTwitter generates a config.json in its root directory the first time you run it, the options are:
API - This will be where you put the credentials for your twitter API if you use this method
database - This is where you put the URL to your mongoDB database if you are using one
link_cache - (Options: db, json)
- db: Caches all links to a mongoDB database. This should be used if you are using uWSGI and are not just running the script on its own as one worker
- json: This saves cached links to a local links.json file
- dynamodb: Saves cached links to a DynamoDB database - set
tableto the table name to cache links to. - none: Does not cache requests. Not reccomended as you can easily use up your Twitter API credits with this. Intended for use with another cache system (i.e NGINX uwsgi_cache)
color - Accepts a hex formatted color code, can change the embed color
appname - Can change the app name easily wherever it's shown
repo - used to change the repo url that some links redirect to
url - used to tell the user where to look for the oembed endpoint, make sure to set this to your public facing url
combination_method - using c.vxtwitter as the url causes vxTwitter to combine all images in the post into one. This is CPU intensive, so you might not want it running on the same machine that's serving requests. When combination_method is set to local, it will use the local machine to combine the images. This requires pillow to be installed. If you want to use another server, replace local with the URL to the endpoint which combines images. Both methods use the code in the combineImg module. Inside, there's also a Dockerfile intended to be deployed as a combination endpoint on an AWS Lambda function.
Other stuff
We check for t.co links in non video tweets, and if one is found, we direct the discord useragent to embed that link directly, this means that twitter links containing youtube / vimeo links will automatically embed those as if you had just directly linked to that content
This project is licensed under the Do What The Fuck You Want Public License