Skip to content

Commit

Permalink
Merge pull request #1 from gy6221/favourite-api-update
Browse files Browse the repository at this point in the history
Adapt API update
  • Loading branch information
EcchiClone authored Mar 15, 2024
2 parents 158f8fd + 42d74ea commit 3b532ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def get_user(self, user_id:str, service:str):
return None

def get_favorites(self, domain:str, fav_type:str, services:list = None):
fav_api = f'https://{domain}/api/v1/favorites?type={fav_type}'
fav_api = f'https://{domain}/api/v1/account/favorites?type={fav_type}'
logger.debug(f"Getting favorite json from {fav_api}")
response = self.session.get(url=fav_api, headers=self.headers, cookies=self.cookies, timeout=self.timeout)
if response.status_code == 401:
Expand Down Expand Up @@ -543,7 +543,7 @@ def write_archive(self, post:dict):
def skip_user(self, user:dict):
# check last update date
if self.user_up_datebefore or self.user_up_dateafter:
if check_date(datetime.datetime.strptime(user['updated'], r'%a, %d %b %Y %H:%M:%S %Z'), None, self.user_up_datebefore, self.user_up_dateafter):
if check_date(datetime.datetime.fromtimestamp(user['updated']), None, self.user_up_datebefore, self.user_up_dateafter):
logger.info("Skipping user | user updated date not in range")
return True
return False
Expand Down

0 comments on commit 3b532ff

Please sign in to comment.