You've already forked JapariArchive
Updated code to use X account id instead of name. Updated dependencies
This commit is contained in:
@@ -92,7 +92,7 @@ async def UpdateMediaPosts(account : x_accounts, botData : RuntimeBotData) -> li
|
|||||||
posts = []
|
posts = []
|
||||||
|
|
||||||
try:
|
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:
|
except (UserProtected, UserNotFound) as ex:
|
||||||
print("User dead: ", account.name, ex)
|
print("User dead: ", account.name, ex)
|
||||||
@@ -108,7 +108,7 @@ async def DownloadAllMediaPosts(account : x_accounts, botData : RuntimeBotData)
|
|||||||
posts = []
|
posts = []
|
||||||
|
|
||||||
try:
|
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:
|
if int(tweet.id) not in all_posts:
|
||||||
posts.append(tweet)
|
posts.append(tweet)
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class TweetyApi:
|
|||||||
except:
|
except:
|
||||||
return None
|
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):
|
def validate_tweet(tweet : Tweet):
|
||||||
tweet_id_num = int(tweet.id)
|
tweet_id_num = int(tweet.id)
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ class TweetyApi:
|
|||||||
|
|
||||||
while user == None:
|
while user == None:
|
||||||
try:
|
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:
|
except RateLimitReached as ex:
|
||||||
sleep_exponent = await self.sleep_wait(sleep_default, sleep_exponent)
|
sleep_exponent = await self.sleep_wait(sleep_default, sleep_exponent)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class TwitterContainer():
|
|||||||
posts = []
|
posts = []
|
||||||
|
|
||||||
try:
|
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)
|
posts.append(tweet)
|
||||||
|
|
||||||
except (UserProtected, UserNotFound) as ex:
|
except (UserProtected, UserNotFound) as ex:
|
||||||
|
|||||||
Submodule getPixivpyToken updated: 93544c23c7...a030675b1f
BIN
requirements.txt
BIN
requirements.txt
Binary file not shown.
Reference in New Issue
Block a user