diff --git a/requirements.txt b/requirements.txt index 0ea1ad7..650227c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,16 +3,16 @@ pytelegrambotapi==4.10.0 beautifulsoup4==4.11.2 tgbot-ping==1.0.7 redis==4.5.1 -apscheduler==3.10.0 +apscheduler==3.10.1 pymongo==4.3.3 tornado==6.2 captcha==0.4 passlib==1.7.4 -fakeredis==2.9.2 +fakeredis==2.10.0 pytz==2022.7.1 filetype==1.2.0 requests[socks] -tqdm==4.64.1 +tqdm==4.65.0 retry==0.9.2 pymysql==1.0.2 git+https://github.com/tgbot-collection/python-akismet diff --git a/yyetsweb/sync.py b/yyetsweb/sync.py index cb2e703..abde8f8 100644 --- a/yyetsweb/sync.py +++ b/yyetsweb/sync.py @@ -197,6 +197,7 @@ class YYSub(BaseSync): return int(x.ul.li.div.a["href"].split("/")[-1]) def run(self): + logging.info("Starting to sync YYSub...") structure = deepcopy(self.structure) end = self.get_lastest_id() + 1 # end = 41566 @@ -225,7 +226,8 @@ class YYSub(BaseSync): logging.info("YYsub Finished") def insert_data(self, data): - self.yyets.insert_one(data) + rid = data["data"]["info"]["id"] + self.yyets.update_one({"data.info.id": rid}, {"$set": data}, upsert=True) if __name__ == '__main__':