twintproject / twint

An advanced Twitter scraping & OSINT tool written in Python that doesn't use Twitter's API, allowing you to scrape a user's followers, following, Tweets and more while evading most API limitations.
MIT License
15.66k stars 2.72k forks source link

Is there a way to put a cookie in the Twint module? #560

Closed kentaro989 closed 4 years ago

kentaro989 commented 4 years ago

Issue Template

my twitter cookies sample cookies = {'personalization_id': '"vxxxxxxxx=="', 'guest_id': 'v1%000000', 'ct0': '300...ac', 'dnt': '1', 'ads_prefs': '"HBISAAA="', 'kdt': 'YooC...fasdfGUyvM', .......}

Here's how I first tried. run.py 57 line

response = await get.RequestUrl(self.config, self.init, headers=[("User-Agent", self.user_agent),("Cookie",cookies)]) OR response = await get.RequestUrl(self.config, self.init, headers=[("User-Agent", self.user_agent),("Cookies",cookies)])

But that didn't work.

The second way is as follows. get.py

156 line in def Request async with aiohttp.ClientSession(cookies=cookies) as session:

But, the second method the following error. CRITICAL:root:twint.run:Twint:Feed:noDataExpecting value: line 1 column 1 (char 0) How can I put cookies? I want to get sensitive content.

pielco11 commented 4 years ago

Now I added headers for every Request function, if it still does not work, maybe the issue is not related to Twint. I'd like to underline that Twitter might (most probably, afaik) suspend your account