From 90da3b27d939b3b7af1cf7fed10dfaaa7e271622 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Thu, 30 Oct 2025 14:40:08 -0400 Subject: Fixes from testing sink change, document things Signed-off-by: Andrew Opalach --- src/portal/py/modules/patreon.py | 1 + src/portal/py/modules/twitter.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'src/portal/py/modules') diff --git a/src/portal/py/modules/patreon.py b/src/portal/py/modules/patreon.py index bf2f0df..8ef9ad1 100644 --- a/src/portal/py/modules/patreon.py +++ b/src/portal/py/modules/patreon.py @@ -75,6 +75,7 @@ class PatreonUser(PatreonBase): # image_file: https://www.patreon.com/posts/emma-again-29391136 # text_only: https://www.patreon.com/posts/hello-update-29391184 # tags + # Query doesn't complete. def create_post(self, data: ParsedJson, hash: str) -> Optional[Post]: #if 'access_rules' in data['relationships']: diff --git a/src/portal/py/modules/twitter.py b/src/portal/py/modules/twitter.py index f756d13..79e7f31 100644 --- a/src/portal/py/modules/twitter.py +++ b/src/portal/py/modules/twitter.py @@ -110,6 +110,25 @@ class TwitterModule(Module): self.parser: QueryParser = QueryParser(self, 'user') self.parser.add_command('user', TwitterUser) # @TODO: Cookie import from browser. + self.headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; rv:128.0) Gecko/20100101 Firefox/128.0' + self.headers['Accept'] = '*/*' + self.headers['Accept-Language'] = 'en-US,en;q=0.5' + self.headers['Accept-Encoding'] = 'gzip, deflate, br, zstd' + self.headers['content-type'] = 'application/json' + self.headers['x-twitter-auth-type'] = 'OAuth2Session' + self.headers['x-csrf-token'] = '' + self.headers['x-twitter-client-language'] = 'en' + self.headers['x-twitter-active-user'] = 'yes' + self.headers['x-client-transaction-id'] = '' + self.headers['x-xp-forwarded-for'] = '' + self.headers['DNT'] = '1' + self.headers['Sec-Fetch-Dest'] = 'empty' + self.headers['Sec-Fetch-Mode'] = 'cors' + self.headers['Sec-Fetch-Site'] = 'same-origin' + self.headers['authorization'] = '' + self.headers['Connection'] = 'keep-alive' + self.headers['Cookie'] = '' + self.headers['TE'] = 'trailers' #if cookies_path: # cookie_jar = http.cookiejar.MozillaCookieJar() # cookie_jar.load(filename=cookies_path, ignore_expires=True) -- cgit v1.2.3-101-g0448