clean ups, fixes, and additions

- cleaned up unused imports
- fix circular import occuring with util
- add queue refreshing
This commit is contained in:
muskit
2023-08-18 18:20:53 -07:00
parent 45461954e3
commit a5119ae298
9 changed files with 130 additions and 81 deletions
+3 -3
View File
@@ -6,11 +6,9 @@ import traceback
from datetime import datetime
from dotenv import dotenv_values
import tweepy
import pytz
import twint
import twapi
from tweetcapture import TweetCapture
import tweepy
from recrop import fix_aspect_ratio
import talent_lists
@@ -52,6 +50,7 @@ def get_key_from_value(d: dict, val):
return keys[0]
return None
# FIXME: web_auth_token under rate-limitation will fail to screenshot
async def create_ttweet_image(ttweet):
tc = TweetCapture()
tc.cookies = [{'name': 'auth_token', 'value': dotenv_values()['web_auth_token']}]
@@ -100,6 +99,7 @@ def get_username_local(id: int):
# Retrieve username via API v2 (tweepy)
def get_username_online(id, default=None):
import twapi
try:
resp = twapi.TwAPI.instance.client.get_user(id=id)
return resp.data.username