From 393a3c492f4f182bab89cf712714d5852e0a15c0 Mon Sep 17 00:00:00 2001 From: Chloe Date: Sat, 21 May 2022 00:25:58 +0100 Subject: [PATCH 1/6] Update twitfix.ini --- twitfix.ini | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/twitfix.ini b/twitfix.ini index 6f0bf18..f358b0c 100644 --- a/twitfix.ini +++ b/twitfix.ini @@ -2,7 +2,9 @@ module = wsgi:app master = true -processes = 5 +processes = 30 + +enable-threads = True socket = twitfix.sock chmod-socket = 660 From 18264bed1bb366339169d72f00116f11511ec67e Mon Sep 17 00:00:00 2001 From: Chloe Date: Sat, 21 May 2022 00:39:38 +0100 Subject: [PATCH 2/6] debugging --- twitfix.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/twitfix.py b/twitfix.py index d0c1220..9714cae 100644 --- a/twitfix.py +++ b/twitfix.py @@ -23,9 +23,6 @@ import urllib.parse import urllib.request from datetime import date -class TwitterUserProtected(Exception): - pass - app = Flask(__name__) CORS(app) @@ -488,8 +485,6 @@ def direct_video(video_link): # Just get a redirect to a MP4 link from any twee addVnfToLinkCache(video_link, vnf) return redirect(vnf["url"], 301) print(" ➤ [ D ] Redirecting to direct URL: " + vnf["url"]) - except TwitterUserProtected: - return message("This user is guarding their tweets!") except Exception as e: print(e) return message("Failed to scan your link!") @@ -508,8 +503,6 @@ def direct_video_link( addVnfToLinkCache(video_link, vnf) return vnf["url"] print(" ➤ [ D ] Redirecting to direct URL: " + vnf["url"]) - except TwitterUserProtected: - return message("This user is guarding their tweets!") except Exception as e: print(e) return message("Failed to scan your link!") @@ -599,10 +592,6 @@ def link_to_vnf_from_api(video_link): tweet = twitter_api.statuses.show(_id=twid, tweet_mode="extended") # For when I need to poke around and see what a tweet looks like # print(tweet) - protected = tweet['user']['protected'] - if protected: - raise TwitterUserProtected() - text = tweet["full_text"] nsfw = tweet.get("possibly_sensitive", False) qrt = {} @@ -687,9 +676,6 @@ def link_to_vnf(video_link): # Return a VideoInfo object or die trying if config["config"]["method"] == "hybrid": try: return link_to_vnf_from_api(video_link) - except TwitterUserProtected: - print(" ➤ [ X ] User is protected, stop.") - raise except Exception as e: print(" ➤ [ !!! ] API Failed") print(e) @@ -697,9 +683,6 @@ def link_to_vnf(video_link): # Return a VideoInfo object or die trying elif config["config"]["method"] == "api": try: return link_to_vnf_from_api(video_link) - except TwitterUserProtected: - print(" ➤ [ X ] User is protected, stop.") - raise except Exception as e: print(" ➤ [ X ] API Failed") print(e) From 21e2d9c306821dbeda68ec8f9074e31f355d1fb8 Mon Sep 17 00:00:00 2001 From: Chloe Date: Sat, 21 May 2022 01:02:28 +0100 Subject: [PATCH 3/6] Update twitfix.ini --- twitfix.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twitfix.ini b/twitfix.ini index f358b0c..27b2220 100644 --- a/twitfix.ini +++ b/twitfix.ini @@ -2,7 +2,7 @@ module = wsgi:app master = true -processes = 30 +processes = 25 enable-threads = True From 4a4afef3680e8ad907343e72d770258eb405b076 Mon Sep 17 00:00:00 2001 From: Chloe Date: Mon, 23 May 2022 01:11:43 +0100 Subject: [PATCH 4/6] Update twitfix.ini --- twitfix.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twitfix.ini b/twitfix.ini index 27b2220..8a42cdc 100644 --- a/twitfix.ini +++ b/twitfix.ini @@ -2,7 +2,7 @@ module = wsgi:app master = true -processes = 25 +processes = 10 enable-threads = True From 0f0098e6d796293e2a4c0f38c44b80a1ab151ed0 Mon Sep 17 00:00:00 2001 From: Chloe Date: Mon, 23 May 2022 01:12:31 +0100 Subject: [PATCH 5/6] Update twitfix.py --- twitfix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twitfix.py b/twitfix.py index 9714cae..b33c83c 100644 --- a/twitfix.py +++ b/twitfix.py @@ -434,7 +434,7 @@ def dl(sub_path): print(" ➤ [[ FILE DOES NOT EXIST, DOWNLOADING... ]]") addToStat("downloads") mp4file = urllib.request.urlopen(mp4link) - with open(("/srv/Twxtter-main/static/" + filename), "wb") as output: + with open(("/home/twitfix/Twxtter-main/static/" + filename), "wb") as output: output.write(mp4file.read()) print( From 34be8b01e93a45dced695b055e468359ef1f8577 Mon Sep 17 00:00:00 2001 From: Chloe Date: Mon, 23 May 2022 01:20:48 +0100 Subject: [PATCH 6/6] Create img.html --- templates/img.html | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 templates/img.html diff --git a/templates/img.html b/templates/img.html new file mode 100644 index 0000000..b121089 --- /dev/null +++ b/templates/img.html @@ -0,0 +1,28 @@ +{% extends 'base.html' %} + +{% block head %} + + + + + + + +{% endblock %} + +{% block body %} + Redirecting you to the tweet in a moment. Or click here. +{% endblock %}