diff --git a/twitter_scraper/config.py b/twitter_scraper/config.py index 64f0b7e..4a9de54 100644 --- a/twitter_scraper/config.py +++ b/twitter_scraper/config.py @@ -1,4 +1,6 @@ -"""Configuration constants for TwitterDataScraper.""" +from __future__ import annotations + +import os TWITTER_LOGIN_URL = "https://twitter.com/i/flow/login" TWITTER_BASE_URL = "https://twitter.com" @@ -24,8 +26,6 @@ PROFILE_HREF_PATTERN = r"^/[A-Za-z0-9_]{1,15}$" # User agent (Chrome 131 - January 2025) -USER_AGENT = ( - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " - "AppleWebKit/537.36 (KHTML, like Gecko) " - "Chrome/131.0.0.0 Safari/537.36" -) +USER_AGENT_ENV_VAR = os.getenv('TWITTER_USER_AGENT', "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36") + +USER_AGENT = USER_AGENT_ENV_VAR \ No newline at end of file