Skip to content

Commit

Permalink
py package update : change ticktick-py pointer to my fork
Browse files Browse the repository at this point in the history
  • Loading branch information
luutuankiet committed Nov 10, 2024
1 parent 961b23e commit 999870d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 41 deletions.
40 changes: 0 additions & 40 deletions app/ETL/loader.py
Original file line number Diff line number Diff line change
@@ -1,46 +1,9 @@
# a standalone job to run once and stay on for the duration of the machine.
# this helps retain one tick tick api call in the duration.

#%%
import secrets
from ticktick.oauth2 import OAuth2 # OAuth2 Manager
from ticktick.api import TickTickClient # Main Interface

USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0"
X_DEVICE_ = '{"platform":"web","os":"macOS 10.15","device":"Firefox 130.0","name":"","version":6060,"id":"66666db22ee6d03d8bb8def7","channel":"website","campaign":"","websocket":"66fc8e566740d02c0c53973a"}'

TickTickClient.HEADERS = {'User-Agent': USER_AGENT,
'x-device': X_DEVICE_}
# per this issue : https://github.com/lazeroffmichael/ticktick-py/issues/42
# additional_headers = {
# "Content-Type": "application/json",
# "Accept": "*/*",
# "Accept-Encoding": "gzip, deflate, br",
# "Connection": "keep-alive",
# }

# # https://github.com/lazeroffmichael/ticktick-py/issues/25
# additional_headers = {
# 'authority': 'api.ticktick.com',
# 'sec-ch-ua': '" Not;A Brand";v="99", "Google Chrome";v="97", "Chromium";v="97"',
# 'x-device-user-agent': USER_AGENT,
# 'x-requested-with': 'XMLHttpRequest',
# 'sec-ch-ua-mobile': '?0',
# 'content-type': 'application/json',
# 'User-Agent': USER_AGENT,
# 'sec-ch-ua-platform': '"Windows"',
# 'accept': '*/*',
# 'origin': 'https://ticktick.com',
# 'sec-fetch-site': 'same-site',
# 'sec-fetch-mode': 'cors',
# 'sec-fetch-dest': 'empty',
# 'referer': 'https://ticktick.com/',
# 'accept-language': 'es,en-US;q=0.9,en;q=0.8'
# }



# TickTickClient.HEADERS.update(additional_headers)


from os import environ
Expand All @@ -54,7 +17,6 @@
from helper.source_env import ETL_env_path,raw_path
import asyncio

#%%

logging.basicConfig(
level=logging.INFO,
Expand Down Expand Up @@ -92,7 +54,6 @@

def new_login(self, username, password):
url = self.BASE_URL + 'user/signon'
# url = self.BASE_URL + 'user/signon?wc=true&remember=true'
user_info = {
'username': username,
'password': password,
Expand All @@ -103,7 +64,6 @@ def new_login(self, username, password):
}

response = self.http_post(url, json=user_info, headers=self.HEADERS)
# response = self.http_post(url, json=user_info, params=parameters, headers=self.HEADERS)
self.access_token = response['token']
self.cookies['t'] = self.access_token

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ dagster-webserver==1.7.8
# st-gsheets-connection==0.0.4
# streamlit==1.35.0
humanize==4.9.0
ticktick-py==2.0.1
# ticktick-py==2.0.1
git+https://github.com/luutuankiet/ticktick-py.git
humanize
pytz
psycopg2-binary
Expand Down

0 comments on commit 999870d

Please sign in to comment.