login.py 550 B

12345678910111213141516171819202122232425
  1. """
  2. 登录接口
  3. """
  4. from flask import Blueprint
  5. from flask import request
  6. import api
  7. import instagram
  8. login_opt = Blueprint('login', __name__)
  9. @login_opt.route('/createPage', methods=["POST"])
  10. def create_page():
  11. """
  12. 登录接口
  13. """
  14. request_body = request.json
  15. account = request_body.get('account')
  16. if not api.contain_browser(account):
  17. browser = instagram.InstagramBrowser(account)
  18. browser.__init_browser__(playwright=None)
  19. browser.close()
  20. api.add_account(account)
  21. return api.success()