Skip to content

Commit

Permalink
Grabbing cookie from x.com if failing in twitter.com
Browse files Browse the repository at this point in the history
Related to #973
  • Loading branch information
Yomguithereal committed May 28, 2024
1 parent 299e2c3 commit 77537d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions minet/twitter/api_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,10 @@ def __init__(self, cookie: str):
cookie, TWITTER_PUBLIC_SEARCH_ENDPOINT
)

# NOTE: we might need to check the x.com domain for the cookie
if not is_cookie_valid(self.cookie):
self.cookie = coerce_cookie_for_url_from_browser(cookie, "https://x.com")

if not is_cookie_valid(self.cookie):
raise TwitterPublicAPIInvalidCookieError

Expand Down

0 comments on commit 77537d3

Please sign in to comment.