diff options
Diffstat (limited to 'src/portal')
| -rw-r--r-- | src/portal/py/modules/patreon.py | 1 | ||||
| -rw-r--r-- | src/portal/py/modules/twitter.py | 19 | ||||
| -rwxr-xr-x | src/portal/scripts/run_py.sh | 2 |
3 files changed, 21 insertions, 1 deletions
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) diff --git a/src/portal/scripts/run_py.sh b/src/portal/scripts/run_py.sh index e745a72..87045ff 100755 --- a/src/portal/scripts/run_py.sh +++ b/src/portal/scripts/run_py.sh @@ -1,5 +1,5 @@ #! /usr/bin/env sh -export CURL_CA_BUNDLE=/etc/ssl/certs/ca-bundle.crt +#export CURL_CA_BUNDLE=/etc/ssl/certs/ca-bundle.crt export PYTHONDONTWRITEBYTECODE=1 export PYTHONOPTIMIZE=2 export PYTHONPATH=$HOME/c/camu/src/portal/vendor/vendor |