From c54cf20cc3b7799a6ac5dd36b58f9659dfa58f76 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 01:43:36 +0000 Subject: [PATCH 1/8] Bump pillow from 9.3.0 to 9.4.0 Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.3.0 to 9.4.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.3.0...9.4.0) --- updated-dependencies: - dependency-name: pillow dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ad99acf..fd93be3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ pymongo==4.3.3 boto3==1.26.37 requests==2.28.1 -Pillow==9.3.0 +Pillow==9.4.0 Flask==2.2.2 Flask-Cors==3.0.10 yt-dlp==2022.7.18 \ No newline at end of file From e8cef7de888ba26c54590dbce9735d7b1e983012 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 01:43:53 +0000 Subject: [PATCH 2/8] Bump boto3 from 1.26.37 to 1.26.45 Bumps [boto3](https://github.com/boto/boto3) from 1.26.37 to 1.26.45. - [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.37...1.26.45) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ad99acf..db8d9e7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ pymongo==4.3.3 -boto3==1.26.37 +boto3==1.26.45 requests==2.28.1 Pillow==9.3.0 Flask==2.2.2 From 978272554a220dd80989083c9a04cef3013dff3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 02:10:11 +0000 Subject: [PATCH 3/8] Bump requests from 2.28.1 to 2.28.2 Bumps [requests](https://github.com/psf/requests) from 2.28.1 to 2.28.2. - [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.1...v2.28.2) --- updated-dependencies: - dependency-name: requests dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 318e1ab..b24ac52 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ pymongo==4.3.3 boto3==1.26.45 -requests==2.28.1 +requests==2.28.2 Pillow==9.4.0 Flask==2.2.2 Flask-Cors==3.0.10 From 54d900b70c6b1d573963197f62b7429da66d76f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 4 Feb 2023 23:21:36 +0000 Subject: [PATCH 4/8] Bump boto3 from 1.26.45 to 1.26.64 Bumps [boto3](https://github.com/boto/boto3) from 1.26.45 to 1.26.64. - [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.45...1.26.64) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b24ac52..ffa84fc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ pymongo==4.3.3 -boto3==1.26.45 +boto3==1.26.64 requests==2.28.2 Pillow==9.4.0 Flask==2.2.2 From 8f6e4a0a0950ae138159b1600cdc92ae072d7b5a Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 4 Feb 2023 23:25:54 +0000 Subject: [PATCH 5/8] Combine multiple tweet images by default (#40) --- twitfix.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/twitfix.py b/twitfix.py index 9703b1a..fc7043e 100644 --- a/twitfix.py +++ b/twitfix.py @@ -78,17 +78,6 @@ def twitfix(sub_path): else: print(" ➤ [ R ] Redirect to MP4 using d.fxtwitter.com") return dir(sub_path) - elif request.url.startswith("https://c.vx") or request.url.endswith('/all'): - twitter_url = sub_path - - if match.start() == 0: - twitter_url = "https://twitter.com/" + sub_path - - if user_agent in generate_embed_user_agents: - return embedCombined(twitter_url) - else: - print(" ➤ [ R ] Redirect to " + twitter_url) - return redirect(twitter_url, 301) elif request.url.endswith(".mp4") or request.url.endswith("%2Emp4"): twitter_url = "https://twitter.com/" + sub_path @@ -122,7 +111,7 @@ def twitfix(sub_path): twitter_url = "https://twitter.com/" + sub_path if user_agent in generate_embed_user_agents: - res = embed_video(twitter_url) + res = embedCombined(twitter_url) return res else: From 40a736f9d7409ccdbf6cf78c9b815343939d30b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Feb 2023 02:56:08 +0000 Subject: [PATCH 6/8] Bump boto3 from 1.26.64 to 1.26.69 Bumps [boto3](https://github.com/boto/boto3) from 1.26.64 to 1.26.69. - [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.64...1.26.69) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ffa84fc..97306a6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ pymongo==4.3.3 -boto3==1.26.64 +boto3==1.26.69 requests==2.28.2 Pillow==9.4.0 Flask==2.2.2 From ae6774f126a9b52b1d6c69b4af1d90658bb85853 Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 13 Feb 2023 23:36:03 +0000 Subject: [PATCH 7/8] Revert "Lowered loop time based on feedback" This reverts commit c08013d14115b24092010d7c8bf95dfc4b5588c9. --- gifConvert/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gifConvert/__init__.py b/gifConvert/__init__.py index 5e099f9..6f08ebb 100644 --- a/gifConvert/__init__.py +++ b/gifConvert/__init__.py @@ -73,7 +73,7 @@ def lambda_handler(event, context): videoLocation = tempfile.mkstemp(suffix=".mp4")[1] subprocess.call(["wget","-O",videoLocation,url],stdout=subprocess.DEVNULL,stderr=subprocess.STDOUT) - videoLocationLooped = loop_video_until_length(videoLocation, 15) + videoLocationLooped = loop_video_until_length(videoLocation, 30) if videoLocationLooped != videoLocation: os.remove(videoLocation) videoLocation = videoLocationLooped From 3717430c3f99fd84391a91316e30124cca5d5a29 Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 17 Feb 2023 18:10:23 +0000 Subject: [PATCH 8/8] Increased description limit for tweets --- msgs.py | 6 ++++-- test_vx.py | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/msgs.py b/msgs.py index eb85a51..b9cffdc 100644 --- a/msgs.py +++ b/msgs.py @@ -3,6 +3,8 @@ failedToScanExtra = "\n\nTwitter gave me this error: " tweetNotFound="Tweet not found." tweetSuspended="This Tweet is from a suspended account." +tweetDescLimit=340 + def genLikesDisplay(vnf): return ("\n\n💖 " + str(vnf['likes']) + " 🔁 " + str(vnf['rts'])) @@ -38,9 +40,9 @@ def formatEmbedDesc(type,body,qrt,pollDisplay,likesDisplay): output= body+pollDisplay+likesDisplay else: output= body + likesDisplay - if len(output)>248: + if len(output)>tweetDescLimit: # find out how many characters we need to remove - diff = len(output)-248 + diff = len(output)-tweetDescLimit # remove the characters from body, add ellipsis body = body[:-(diff+1)]+"…" return formatEmbedDesc(type,body,qrt,pollDisplay,likesDisplay) diff --git a/test_vx.py b/test_vx.py index 38c3b45..1a51140 100644 --- a/test_vx.py +++ b/test_vx.py @@ -165,6 +165,14 @@ def test_embedFromCache(): resp = client.get(testMultiMediaTweet.replace("https://twitter.com",""),headers={"User-Agent":"test"}) assert resp.status_code==200 +def test_veryLongEmbed(): + cache.clearCache() + cache.setCache({'https://twitter.com/TEST/status/1234': + {"description":"A"*1024,"hits":0,"images":["","","","",""],"likes":1234,"nsfw":False,"pfp":"","qrt":{},"rts":1234,"screen_name":"TEST","thumbnail":"","time":"","tweet":"https://twitter.com/TEST/status/1234","type":"Text","uploader":"Test","url":""} + }) + resp = client.get('https://twitter.com/TEST/status/1234'.replace("https://twitter.com",""),headers={"User-Agent":"test"}) + assert resp.status_code==200 + def test_embedFromOutdatedCache(): # presets a cache that has VNF's with missing fields; there's probably a better way to do this cache.setCache({"https://twitter.com/Twitter/status/1118295916874739714":{"description":"On profile pages, we used to only show someone’s replies, not the original Tweet 🙄 Now we’re showing both so you can follow the conversation more easily! https://t.co/LSBEZYFqmY","hits":0,"images":["https://pbs.twimg.com/media/D4TS4xeX4AA02DI.jpg","","","","1"],"likes":5033,"nsfw":False,"pfp":"http://pbs.twimg.com/profile_images/1488548719062654976/u6qfBBkF_normal.jpg","qrt":{},"rts":754,"screen_name":"Twitter","thumbnail":"https://pbs.twimg.com/media/D4TS4xeX4AA02DI.jpg","time":"Tue Apr 16 23:31:38 +0000 2019","tweet":"https://twitter.com/Twitter/status/1118295916874739714","type":"Image","uploader":"Twitter","url":""}, "https://twitter.com/Twitter/status/1263145271946551300":{"description":"Testing, testing...\n\nA new way to have a convo with exactly who you want. We’re starting with a small % globally, so keep your 👀 out to see it in action. https://t.co/pV53mvjAVT","hits":0,"images":["","","","",""],"likes":61584,"nsfw":False,"pfp":"http://pbs.twimg.com/profile_images/1488548719062654976/u6qfBBkF_normal.jpg","qrt":{},"rts":17138,"screen_name":"Twitter","thumbnail":"http://pbs.twimg.com/media/EYeX7akWsAIP1_1.jpg","time":"Wed May 20 16:31:15 +0000 2020","tweet":"https://twitter.com/Twitter/status/1263145271946551300","type":"Video","uploader":"Twitter","url":"https://video.twimg.com/amplify_video/1263145212760805376/vid/1280x720/9jous8HM0_duxL0w.mp4?tag=13"},