Commit 853e546d authored by andytnt's avatar andytnt

Fix Target profile infos are scraped at each round

parent 5794bc49
......@@ -123,7 +123,7 @@ async def Tweet(url, config, conn):
except Exception as e:
print(str(e) + " [x] get.Tweet")
async def User(url, config, conn):
async def User(url, config, conn, user_id = False):
#loggin.info("[<] " + str(datetime.now()) + ':: get+User')
try:
response = await Request(url)
......@@ -132,6 +132,9 @@ async def User(url, config, conn):
except Exception as e:
print(str(e) + " [x] get.User")
if user_id:
return int(inf(soup, "id"))
def Limit(Limit, count):
#loggin.info("[<] " + str(datetime.now()) + ':: get+Limit')
if Limit is not None and count >= int(Limit):
......
......@@ -105,7 +105,8 @@ class Twint:
self.config.Username = await get.Username(self.config.User_id)
if self.config.Username is not None:
self.config.User_id = await get.UserId(self.config.Username)
url = f"http://twitter.com/{self.config.Username}?lang=en"
self.config.User_id = await get.User(url, self.config, self.conn, True)
if self.config.TwitterSearch and self.config.Since and self.config.Until:
_days = timedelta(days=int(self.config.Timedelta))
......@@ -126,8 +127,6 @@ class Twint:
while True:
if len(self.feed) > 0:
if self.config.Followers or self.config.Following:
url = f"http://twitter.com/{self.config.Username}?lang=en"
await get.User(url, self.config, self.conn)
await self.follow()
elif self.config.Favorites:
await self.favorite()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment