douyin_cookie_update.py 843 B

1234567891011121314151617181920212223242526272829
  1. # Author renyupeng
  2. # coding=utf-8
  3. # @Time : 2023/2/27 2:16 下午
  4. # @Site :
  5. # @File : cookie_update.py
  6. # @Software: PyCharm
  7. # @contact: renyupeng@c-top.com.cn
  8. # @Tel 1501435553
  9. from utils.mysql_utils import MysqlUtils
  10. class douyin_cookie_update:
  11. @staticmethod
  12. def get_cookie_handler():
  13. sql = "select cookie ,phone_num from kwai_promoter.douyin_supply_chain_cookie where status =0"
  14. result = MysqlUtils().QueryOne(sql)
  15. print(result)
  16. return result
  17. @staticmethod
  18. def update_cookie_handler(phone_num):
  19. sql = "update kwai_promoter.douyin_supply_chain_cookie set status=2 where phone_num={phone_num}".format(
  20. phone_num=phone_num)
  21. MysqlUtils().Operate(sql=sql, params=None, DML=True)
  22. if __name__ == '__main__':
  23. douyin_cookie_update().get_cookie_handler()