Giter VIP home page Giter VIP logo

autoupdatejdcookie's Introduction

MyJdCOOKIE

介绍

  • 用来自动化更新青龙面板的失效JD_COOKIE, 主要有三步
    • 自动化获取青龙面板的失效JD_COOKIE
    • 基于失效JD_COOKIE,自动化登录JD,包括滑块验证和二次形状验证码,拿到key
    • 基于key, 自动化更新青龙面板的失效JD_COOKIE
  • python >= 3.9 (playwright依赖的typing,在3.7和3.8会报错typing.NoReturn的BUG)
  • 基于windows
  • 整体效果如下图

GIF

使用文档

安装依赖

pip install -r requirements.txt

安装chromium插件

playwright install chromium

添加配置config.py

  • 复制config_example.py, 重命名为config.py, 我们基于这个config.py运行程序;

  • user_datas为JD用户数据,按照实际信息填写;

  • qinglong_data为QL数据,按照实际信息填写;

    • 建议优先选择用client_id和client_secret,获取方法如下:
    1、在系统设置 -> 应用设置 -> 添加应用,进行添加
    2、需要【环境变量】的权限
    3、此功能支持青龙2.9+
    
    • 其次选择用token,需要在浏览器上,F12上获取Authorization的请求头。
    • 账号密码为最次选择, 这种方式会抢占QL后台的登录。
  • auto_move为自动识别并移动滑块验证码的开关, 有时不准就关了;

  • slide_difference为滑块验证码的偏差, 如果一直滑过了, 或滑不到, 需要调节下;

  • auto_shape_recognition为二次图形状验证码的开关;

  • headless设置浏览器是否启用无头模式,即是否展示整个登录过程,建议调试时False,稳定后True

  • cron_expression基于cron的表达式,用于schedule_main.py定期进行更新任务

  • 消息类的配置下面会说明

配置消息通知

1、如果不需要发消息,请关掉消息开关,忽略消息配置

# 是否开启发消息
is_send_msg = False

2、成功消息和失败消息也可以开关

# 更新成功后是否发消息的开关
is_send_success_msg = True
# 更新失败后是否发消息的开关
is_send_fail_msg = True

3、可以发企微、钉钉、飞书机器人,其它的就自写webhook

# 配置发送地址
send_info = {
    "send_wecom": [
        "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key="
    ],
    "send_webhook": [
        "http://127.0.0.1:3000/webhook",
        "http://127.0.0.1:4000/webhook"
    ],
    "send_dingtalk": [
    ],
    "send_feishu": [
    ]
}

运行脚本

1、单次手动执行

python main.py

2、常驻进程

进程会读取config.py里的cron_expression,定期进行更新任务

python schedule_main.py

特别感谢

autoupdatejdcookie's People

Contributors

www avatar zhuoyanzhe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

autoupdatejdcookie's Issues

滑块一直调整都是失败

滑块验证码的偏差, 如果一直滑过了, 或滑不到, 可以调节下

slide_difference = 6

以上参数1-15都调整了 还是出错,不知道是哪一步出问题了

image

大佬能否支持下2.11.3的青龙

测试2.15.6青龙正常使用。
京东都在2.11.3上使用,但会报错:
微信截图_20240617145313

因为很菜,所以猜测是没有支持该版本的青龙所出现的报错。请大佬指点,谢谢~

二次验证图形的问题

当cookie失效时,需要重新登录验证。在滑块验证后,有时会出现二次验证,即问图形形状或选择颜色的方式,请问这种情况能否通过代码解决实现自动验证?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.