From 9e7759a37e2f9c11f5f6bf1f7230eaa2b3b0e842 Mon Sep 17 00:00:00 2001 From: katboi01 Date: Sun, 10 May 2026 14:31:17 +0200 Subject: [PATCH] Updated code to use X account id instead of name. Updated dependencies --- Twitter/tweetHelper.py | 4 ++-- Twitter/tweetyapi.py | 4 ++-- Twitter/twitterContainer.py | 2 +- getPixivpyToken | 2 +- requirements.txt | Bin 344 -> 384 bytes 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Twitter/tweetHelper.py b/Twitter/tweetHelper.py index b8fff03..b987793 100644 --- a/Twitter/tweetHelper.py +++ b/Twitter/tweetHelper.py @@ -92,7 +92,7 @@ async def UpdateMediaPosts(account : x_accounts, botData : RuntimeBotData) -> li posts = [] try: - posts = [tweet async for tweet in botData.twApi.get_tweets(user_name = account.name, bottom_id = newest_post, all_posts = all_posts)] + posts = [tweet async for tweet in botData.twApi.get_tweets(user_id = account.id, bottom_id = newest_post, all_posts = all_posts)] except (UserProtected, UserNotFound) as ex: print("User dead: ", account.name, ex) @@ -108,7 +108,7 @@ async def DownloadAllMediaPosts(account : x_accounts, botData : RuntimeBotData) posts = [] try: - async for tweet in botData.twApi.get_tweets(user_name = account.name, bottom_id = 1, all_posts = []): + async for tweet in botData.twApi.get_tweets(user_id = account.id, bottom_id = 1, all_posts = []): if int(tweet.id) not in all_posts: posts.append(tweet) diff --git a/Twitter/tweetyapi.py b/Twitter/tweetyapi.py index c914df9..bfff8c5 100644 --- a/Twitter/tweetyapi.py +++ b/Twitter/tweetyapi.py @@ -26,7 +26,7 @@ class TweetyApi: except: return None - async def get_tweets(self, user_name, bottom_id, all_posts : list) -> AsyncIterator[Tweet]: + async def get_tweets(self, user_id, bottom_id, all_posts : list) -> AsyncIterator[Tweet]: def validate_tweet(tweet : Tweet): tweet_id_num = int(tweet.id) @@ -46,7 +46,7 @@ class TweetyApi: while user == None: try: - user = await self.app.get_user_info(username=user_name) + user = await self.app.get_user_info(username=user_id) except RateLimitReached as ex: sleep_exponent = await self.sleep_wait(sleep_default, sleep_exponent) except Exception as ex: diff --git a/Twitter/twitterContainer.py b/Twitter/twitterContainer.py index 48428d4..1e741cb 100644 --- a/Twitter/twitterContainer.py +++ b/Twitter/twitterContainer.py @@ -28,7 +28,7 @@ class TwitterContainer(): posts = [] try: - async for tweet in botData.twApi.get_tweets(user_name = self.name, bottom_id = newest_post, all_posts = all_posts): + async for tweet in botData.twApi.get_tweets(user_id = self.id, bottom_id = newest_post, all_posts = all_posts): posts.append(tweet) except (UserProtected, UserNotFound) as ex: diff --git a/getPixivpyToken b/getPixivpyToken index 93544c2..a030675 160000 --- a/getPixivpyToken +++ b/getPixivpyToken @@ -1 +1 @@ -Subproject commit 93544c23c75c462a43555c909640ac9f9c2cf40c +Subproject commit a030675b1f1159d278c371d9f242800de5409809 diff --git a/requirements.txt b/requirements.txt index e60da60b48217e36c96fe2e50ac556902db68f58..26a97366bfb136cdeb10b7fbcc6f6052fee665e7 100644 GIT binary patch delta 48 ycmcb?)WEzUf>DE)fr}xNA&;S$p@bokAqNQK847@8B10uZIYSXpE}bC*C