LXK0301京东签到脚本-自动提交互助码

LXK0301京东签到脚本-自动提交互助码

orzlee
2021-02-24 / 233 评论 / 8,972 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2021年05月08日,已超过1054天没有更新,若内容或图片失效,请留言反馈。

telegram.jpg

前言

今天24号,刚好是LXK0301助力码清除日期,晚上给忘记了,到中午才发现今天互助码重置。

瞬间感觉错误一个亿,之前就想过要折腾个自动提交互助码的脚本,就是太懒了。今天亡羊补牢,折腾折腾。有兴趣可以用阅读我之前的文章QuantumultX-京东签到撸京东豆openwrt-docker部署lxk0301京东自动签到脚本

安装Telegram-Cli

此安装环境是VPS,openwrt上安装用docker,当然VPS也可以使用docker!

科学上网必备,没有一个良好的网络环境为前提都是白折腾!!!

  • docker安装(推荐,省去一大堆麻烦事):
    镜像地址:ugeek/telegram-cli

    1. 安装镜像:

       docker create --name telegram-cli -e TZ=Asia/Shanghai -v 挂载本地目录:/root/.telegram-cli ugeek/telegram-cli:amd64
    2. 启动docker:

       docker start telegram-cli
    3. 执行telegram-cli命令行交互(先执行一次登陆,输入telegram注册的手机号码,号码记得加区号。)

       docker exec -it telegram-cli telegram-cli -N -W
  • 以下为编译安装步骤(docker或者编译二选一即可):

    1. 克隆telegram-cli:

       cd /root/work/telegram  ### 或者你自己想要存放的目录
       git clone --recursive https://github.com/vysheng/tg.git && cd tg
    2. 编译安装

       ### ubuntu
       sudo apt-get update
       sudo apt-get -y install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make
       ./configure
       make

      如果编译安装出现如下错误:
      telegram-cil-error.png
      解决方法:

       apt-get install -y libgcrypt20-dev libssl-dev
       ./configure --disable-openssl --prefix=/usr CFLAGS="$CFLAGS -w"
       make

    申请Telegram APP Key并且登陆telegram-cli

    1. 首先到telegram-apps里申请一个telegram App key(登陆时电话号码记得加国际区号)。
      telegram-app-login.png

    2. 复制Public keys:
      app-key.png

    3. 创建一个文件保存Public keys:

       nano /root/work/telegram/bot_key.pub
       ###鼠标右键粘贴
       ctrl+o ##保存 按完记得敲车键
       ctrl+x ##退出
    4. 登陆telegram-cil

       /root/work/telegram/tg/bin/telegram-cli -k /root/work/telegram/bot_key.pub
       ###输入账号绑定的手机号码,记得加区号
       ###输入telegram App收到的验证码

      telegram-cil-login.png
      IOS锁屏就会提示offline,打开手机telegram app就会提示online。

    5. 测试一下命令:
      telegram-cil频道名称如果有空格用下划线代替。
      发送命令格式/root/work/telegram/tg/bin/telegram-cli -W -e "msg 频道名称 命令"

       ### 发送一条统计当前互助码池命令
       /root/work/telegram/tg/bin/telegram-cli -W -e "msg Turing_Lab_Bot /count_activity_codes"

      回显信息比较乱,自己看手机或PC telegram APP Turing_Lab_Bot机器人 消息就好了。

编写脚本

把互助码准备好,编写脚本:

### 创建一个文件,保存脚本
nano /root/work/telegram/submit_activity_codes.sh

2021-05-08 优化加载会话列表,resolve_username 只加载需要发送命令的两个BOT,避免会话太多出现奇奇怪怪的问题。

2021-03-08 优化了定时任务脚本,速度更快,不会中断了,之前的脚本有问题,会经常中断(原因是因为脚本中执行发送消息命令太快-W参数加载消息会话列表没有完成就已经发出命令,导致命令出错!)。

复制以下内容,互助码自己替换,其他活动互助码自己添加(多个互助码用&拼接):

#!/bin/bash

telegramPath=TG Path #记得替换你telegram-cli目录/xxx/tg/bin

(
  echo "resolve_username TuringLabbot"
  echo "resolve_username LvanLamCommitCodebot"
  sleep 5
  ### @Turing_Lab_Bot
  ###京喜财富岛
  echo "msg Turing_Lab_Bot /submit_activity_codes jxcfd 互助码"
  ###京东闪购盲盒
  echo "msg Turing_Lab_Bot /submit_activity_codes sgmh 互助码"
  ###京东环球挑战赛
  echo "msg Turing_Lab_Bot /submit_activity_codes jdglobal 互助码"
  ###惊喜工厂
  echo "msg Turing_Lab_Bot /submit_activity_codes jxfactory 互助码"
  ###东东工厂
  echo "msg Turing_Lab_Bot /submit_activity_codes ddfactory 互助码"
  ###东东萌宠
  echo "msg Turing_Lab_Bot /submit_activity_codes pet 互助码"
  ##种豆得豆
  echo "msg Turing_Lab_Bot /submit_activity_codes bean 互助码"
  ###东东农场
  echo "msg Turing_Lab_Bot /submit_activity_codes farm 互助码"
  ### @Commit_Code_Bot
  ###JD签到领现金 提交助力码
  echo "msg Commit_Code_Bot /jdcash 互助码"
  ###JD签到领现金 提交助力码
  echo "msg Commit_Code_Bot /jdcrazyjoy 互助码"
  echo "safe_quit"
) | ${telegramPath}telegram-cli -D

-D参数关闭了输出,调试的时候可以删除该参数(虽然没什么用,因为你命令发出去还没有等回显就已经结束命令了)。

docker 用户将最后一行脚本替换成) | docker exec -i telegram-cli telegram-cli -N,删除telegramPath=TG Path #记得替换你telegram-cli目录/xxx/tg/bin即可

保存脚本

ctrl+o ##保存 按完记得敲回车键
ctrl+x ##退出

赋予脚本可执行权限

chmod +x /root/work/telegram/submit_activity_codes.sh

测试的时候记得注释大部分命令,留一到两个就行了,频繁提交小心被Bot Ban号。

bash /root/work/telegram/submit_activity_codes.sh

看看手机接收到的通知,一般接收到通知无非就是提交成功或助力池已满。

添加crontab定时任务

助力池每次清空日期为每月1,8,16,24号,延迟10分钟后执行:

crontab -e
10 0 1,8,16,24 * * bash /root/work/telegram/submit_activity_codes.sh

结语

其他Bot签到什么的可以举一反三。

这下一劳永逸,省的忘记错过一个亿。最近京东活动也比较多,没有助力活动任务很难完成,助力才是京东活动的灵魂。

6
取消
扫码打赏
支付金额随意哦!

评论 (233)

取消
  1. 头像
    悉茗
    Windows 10 · Google Chrome

    大佬,你的 telegram-cli 还能正常使用不,最近发现好像很久没自动提交了。登上去看了下错误“FAIL: 38: can not parse arg #1”

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ 悉茗

      不知道你有多久没上去看了,lxk0301早就没玩了!

      回复
      1. 头像
        悉茗
        Windows 10 · Google Chrome
        @ orzlee

        那不是啦,毕竟后来用了 HelloWorld 的库了~只是这个自动提交挂了呢

        回复
  2. 头像
    我是djj
    Android Oreo · Google Chrome

    大佬,telegram api申请不是要填表格吗,这个要怎么填啊?直接点击提交显示[object Object]

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ 我是djj

      我不是都写了吗?

      回复
  3. 头像
    菜欢
    Windows 10 · Google Chrome

    大佬,如果是那种互助码每天都变的脚本,有没有什么办法自动提取互助码,然后再自动提交?

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ 菜欢

      自己写脚本,我一般只提交固定的互助码

      回复
      1. 头像
        菜欢
        Windows 10 · Google Chrome
        @ orzlee

        就是不会,菜鸟来的,所以看看大佬有没有好办法表情

        回复
        1. 头像
          orzlee 作者
          Linux · Google Chrome
          @ 菜欢

          最近很忙,没有时间!

          回复
  4. 头像
    kiko
    Windows 10 · QQ Browser

    请问下动物联萌jd_zoo的火爆问题可以修复吗?

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ kiko

      你这个问题要问作者,我不是jd脚本作者!

      回复
  5. 头像
    benn
    Windows 7 · Google Chrome

    容器telegram-cli的内存占用有2个G,占用了50%的内存。为什么这么占内存?有什么方法可以解决?

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ benn

      脚本每次发完命令关掉容器

      回复
  6. 头像
    123
    Windows 10 · Google Chrome

    如果能精确到秒就好了,现在看来前后有几秒钟的偏差

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ 123

      脚本sleep设置啦

      回复
      1. 头像
        123
        Windows 10 · Google Chrome
        @ orzlee

        要不然我把sleep5 多改点,保证时间的准确

        回复
        1. 头像
          orzlee 作者
          Linux · Google Chrome
          @ 123

          这个随意

          回复
  7. 头像
    benn
    Windows 7 · Google Chrome

    FAIL: 38: can not parse arg #1
    这是什么意思?

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ benn

      没有加载对话框,科学上网了吗

      回复
  8. 头像
    legofans
    Windows 7 · Google Chrome

    请教多用户,多个互助码自动提交需要如何改动脚本呢?

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ legofans

      多容器,一个容器一个tg号

      回复
  9. 头像
    xz123
    Windows 10 · Google Chrome

    脚本运行提示错误,也不知道为什么,我是完全按照你的模板复制的啊,path路径也改了,不知道这$'\r'是个什么意思
    root@srv18538:~# bash /root/telegram/tg1.sh
    /root/telegram/tg1.sh: line 2: $'\r': command not found
    /root/telegram/tg1.sh: line 4: $'\r': command not found
    telegram-cli: No such file or directoryg/bin/
    /root/telegram/tg1.sh: line 5: $'\r': command not found

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ xz123

      看看你脚本第5行

      回复
  10. 头像
    123
    Windows 7 · Google Chrome

    老板,这个能不能增加一个 代理 ip和端口的模式呢

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ 123

      没看懂什么意思!

      回复
      1. 头像
        123
        Windows 7 · Google Chrome
        @ orzlee

        就是我的 机器不是全局代理,是走的 ip+端口的模式 出国的,我的意思就是增加一个 走代理的端口,因为我的机器不是全局代理

        回复
        1. 头像
          orzlee 作者
          Linux · Google Chrome
          @ 123

          没试过,估计很麻烦!随便弄台国外的vps,腾讯云轻量一个月也就二十几,双向gia,30M,便宜又实惠,何必折腾呢!

          回复
          1. 头像
            123
            Windows 7 · Google Chrome
            @ orzlee

            https://pic.sevesum.com/2021/05/26/399de62d10410.png

            老板,看下这个图,创建文件保存Public keys ctrl+o 后弹出这个 ,怎么解决呢

            回复
            1. 头像
              orzlee 作者
              Linux · Google Chrome
              @ 123

              telegram目录不存在

              回复
              1. 头像
                123
                Windows 7 · Google Chrome
                @ orzlee

                这怎么解决呢,老大,是要手动创建吗还是

                回复
                1. 头像
                  orzlee 作者
                  Linux · Google Chrome
                  @ 123

                  嗯,建一个

                  回复
                  1. 头像
                    123
                    Windows 7 · Google Chrome
                    @ orzlee

                    https://pic.sevesum.com/2021/05/26/5e595169c750d.png

                    老大,又遇到个问题,为啥会提示 没有此目录呢,这个也是要手动吗

                    回复
                    1. 头像
                      orzlee 作者
                      Linux · Google Chrome
                      @ 123

                      把文章看一遍再操作,这命令是自己编译后使用的,你应该是docker吧

                      回复
                      1. 头像
                        123
                        Windows 7 · Google Chrome
                        @ orzlee

                        https://pic.sevesum.com/2021/05/26/7431b13bf6505.png

                        老大,这样是不是就没啥问题了,编辑一个 SH文件,和定时就可以了, 还有就是,这个定时可以定位到秒吗

                        回复
                        1. 头像
                          orzlee 作者
                          Linux · Google Chrome
                          @ 123

                          能不能到秒取决你系统,脚本里面sleep 就是暂停多少秒

                          回复
                          1. 头像
                            123
                            Windows 10 · Google Chrome
                            @ orzlee

                            https://pic.sevesum.com/2021/05/26/da49b5021490d.png

                            老大看看这个是什么情况,我是docker文件 编写的文件没啥问题呀,为啥会报错

                            回复
                            1. 头像
                              orzlee 作者
                              Linux · Google Chrome
                              @ 123

                              docker没装,先安装docker,再创建容器,然后使用脚本!

                              回复
                              1. 头像
                                123
                                Windows 10 · Google Chrome
                                @ orzlee

                                https://pic.sevesum.com/2021/05/26/c5ee0379edd23.png

                                装了呀 不知道是撒情况

                                回复
                                1. 头像
                                  orzlee 作者
                                  Linux · Google Chrome
                                  @ 123

                                  你不是容器里面跑脚本吧?

                                  回复
                          2. 头像
                            123
                            Windows 7 · Google Chrome
                            @ orzlee

                            明白了 感谢

                            回复
  11. 头像
    菜欢
    Windows 10 · Google Chrome

    大佬,请问我已经在VPS上配置好了lxk大佬的脚本,也在TG上配置好了机器人,是不是一样按照上面的方法另外安装服务器版TG再跑一遍上面的脚本?

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ 菜欢

      这和lxk脚本没有任何关系,也不会相互影响。照着做就好了!

      回复
      1. 头像
        菜欢
        Windows 10 · Google Chrome
        @ orzlee

        就是说我单独准备一个docker环境或者VPS照你上面的做一遍就行了是吧

        回复
        1. 头像
          orzlee 作者
          Linux · Google Chrome
          @ 菜欢

          回复
  12. 头像
    发发发
    Windows 10 · Google Chrome

    vps重启,telegram-cli也得手动启动一次,怎么让它自动重启?

    回复
    1. 头像
      orzlee 作者
      Windows 10 · Google Chrome
      @ 发发发

      弄成systemctl系统服务,随开机启动!

      回复
  13. 头像
    qqqq
    Windows 10 · Google Chrome

    问下,,我是OPenwrt.最后那布定时我直接计划任务里这么填 10 0 1,8,16,24 bash /root/work/telegram/submit_activity_codes.sh 行吗

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ qqqq

      是的

      回复
  14. 头像
    呜呜呜呜23
    MacOS · Safari

    大佬,为什么配置好了,结果发送不到tg去?

    [root@instance-20210427-0941 ~]# bash /docker/telegram-cli/submit_activity_codes.sh
    change_user_group: can't find the user telegramd to switch to
    Telegram-cli version 1.4.1, Copyright (C) 2013-2015 Vitaly Valtman
    Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type show_license'. This is free software, and you are welcome to redistribute it under certain conditions; typeshow_license' for details.
    Telegram-cli uses libtgl version 2.1.0
    Telegram-cli includes software developed by the OpenSSL Project
    for use in the OpenSSL Toolkit. (http://www.openssl.org/)
    I: config dir=[/root/.telegram-cli]

    resolve_username TuringLabbot
    resolve_username LvanLamCommitCodebot
    Commit Code Bot
    Turing Lab Bot
    telegram-cli: tgl/queries.c:471: tglq_query_result: Assertion `0' failed.
    1621160182.408586 Skipped 11 int out of 6869 (type updates.Difference) (query type get difference)
    1621160182.408618 0x00000000 0xa8fb1981 0x1cb5c415 0x00000046
    SIGNAL received
    htelegram-cli(print_backtrace+0x20)[0x55d05e8ae6e0]
    telegram-cli(termination_signal_handler+0x64)[0x55d05e8ae764]
    /lib/x86_64-linux-gnu/libc.so.6(+0x37840)[0x7f7d68dc9840]
    /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x10b)[0x7f7d68dc97bb]
    /lib/x86_64-linux-gnu/libc.so.6(abort+0x121)[0x7f7d68db4535]
    /lib/x86_64-linux-gnu/libc.so.6(+0x2240f)[0x7f7d68db440f]
    /lib/x86_64-linux-gnu/libc.so.6(+0x30102)[0x7f7d68dc2102]
    telegram-cli(tglq_query_result+0x3da)[0x55d05e8d800a]
    telegram-cli(+0x98bb5)[0x55d05e8d0bb5]
    telegram-cli(+0xbc50a)[0x55d05e8f450a]
    /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6(+0x229ba)[0x7f7d69d5b9ba]
    /usr/lib/x86_64-linux-gnu/libevent-2.1.so.6(event_base_loop+0x5a7)[0x7f7d69d5c537]
    telegram-cli(net_loop+0xf5)[0x55d05e8afc35]
    telegram-cli(loop+0x183)[0x55d05e8b0f43]
    telegram-cli(main+0x23d)[0x55d05e8ace2d]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb)[0x7f7d68db609b]
    telegram-cli(_start+0x2a)[0x55d05e8acfca]
    [root@instance-20210427-0941 ~]#

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ 呜呜呜呜23

      什么环境?

      回复
      1. 头像
        呜呜呜23
        iPhone · Safari
        @ orzlee

        甲骨文Centos7
        我重装容器,重新设置之后又可以了
        其实我刚开始测试是成功了的,不知道什么原因后面一直失败

        回复
        1. 头像
          orzlee 作者
          Linux · Google Chrome
          @ 呜呜呜23

          之前也有人遇到过,具体原因不明!

          回复
        2. 头像
          orzlee 作者
          Linux · Google Chrome
          @ 呜呜呜23

          哦!

          回复
          1. 头像
            hanzhicool
            Windows 7 · Google Chrome
            @ orzlee

            解决了么,我也是突然会出现这情况。不知道怎么解决

            回复
            1. 头像
              orzlee 作者
              Linux · Google Chrome
              @ hanzhicool

              什么问题?

              回复
  15. 头像
    山寨太灰狠
    Windows 10 · Google Chrome

    卡在这步了,telegramPath=TG Path #记得替换你telegram-cli目录/xxx/tg/bin
    为啥我没有这个目录啊“telegram-cli目录下没有后面的/xxx/tg/bin”,我是软路由,刷的高大全的固件

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ 山寨太灰狠

      替换你的本地目录,你自己建或者找个已存在的!

      回复
  16. 头像
    coofee
    MacOS · Google Chrome

    顺序执行若干消息,每条指令间中间不需要sleep 1秒吗?会不会容易被识别为恶意发消息?

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ coofee

      你担心可以加上!

      回复
      1. 头像
        ttt
        iPhone · Safari
        @ orzlee

        大佬怎么添加这种命令?

        回复
        1. 头像
          orzlee 作者
          Linux · Google Chrome
          @ ttt

          什么命令

          回复
  17. 头像
    白老头
    Windows 7 · Google Chrome

    大佬请教下
    docker create --name telegram-cli -e TZ=Asia/Shanghai -v ~/docker/telegram-cli:/root/.telegram-cli ugeek/telegram-cli:arm
    我是在openwrt下操作的,容器启动后自动关闭!LOGS提示standard_init_linux.go:211: exec user process caused "exec format error"!请问要怎么解决!谢谢

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ 白老头

      x86平台最后ugeek/telegram-cli:arm
      改成ugeek/telegram-cli:amd64!

      回复
      1. 头像
        白老头
        Windows 7 · Google Chrome
        @ orzlee

        你好,amd64也试过了,也是这个问题。我的openwrt是在arm的pi上面安装的。

        回复
        1. 头像
          orzlee 作者
          Linux · Google Chrome
          @ 白老头

          那怕是要自己编译了!

          回复
          1. 头像
            白老头
            Windows 7 · Google Chrome
            @ orzlee

            好吧。这对我来说有点难了。谢谢!

            回复
            1. 头像
              orzlee 作者
              Linux · Google Chrome
              @ 白老头

              也不难,文章也有写!

              回复
              1. 头像
                白老头
                Windows 7 · Google Chrome
                @ orzlee

                好的,我试试。以前试过编译别的东西。总是遇到各种问题,自己又不懂得解决

                回复
                1. 头像
                  orzlee 作者
                  Linux · Google Chrome
                  @ 白老头

                  试试吧!

                  回复
  18. 头像
    小白
    Windows 10 · Google Chrome

    大佬请教下
    把public keys 全部复制到了pub文件中,并执行
    root@aml:/usr/local/src/tg# bin/telegram-cli -k server.pub
    change_user_group: can't find the user telegramd to switch to
    Telegram-cli version 1.4.1, Copyright (C) 2013-2015 Vitaly Valtman
    Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type show_license'. This is free software, and you are welcome to redistribute it under certain conditions; typeshow_license' for details.
    Telegram-cli uses libtgl version 2.1.0
    Telegram-cli includes software developed by the OpenSSL Project
    for use in the OpenSSL Toolkit. (http://www.openssl.org/)
    I: config dir=[/root/.telegram-cli]
    [/root/.telegram-cli] created
    [/root/.telegram-cli/downloads] created

    始终卡在这不,不提示输入手机号码
    请问这不怎么操作

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ 小白

      需要国外网络环境!

      回复
      1. 头像
        小白
        Windows 10 · Google Chrome
        @ orzlee

        执行
        curl www.google.com
        是有返回的html
        public keys 是右侧所有的密钥都复制到pub文件中对吗

        回复
        1. 头像
          orzlee 作者
          Linux · Google Chrome
          @ 小白

          密钥不用也可以,默认用docker作者的!不知道你科学上网环境,不好判断!最好是弄台国外vps能少折腾!

          回复
  19. 头像
    lemon
    Windows 7 · FireFox

    最后一步的定时任务不生效。不对,确切的说是生效了不执行。
    X86 Linux下的采用docker方式

    手动可以bash脚本,正常运行。
    设置定时任务,测试不成功。
    求指点迷津

    回复
    1. 头像
      orzlee 作者
      Linux · Google Chrome
      @ lemon

      开cron日志看看!

      回复
  20. 头像
    S.
    iPhone · Safari

    测试的时候记得注释大部分命令,留一到两个就行了,频繁提交小心被Bot Ban号。

    这句话是啥意思呀,新手不是很懂
    还有就是定时任务10 0 1,8,16,24 bash /
    那个开头的10就是延迟10分钟执行吗,不是说10分钟太慢了,作者你是调成几分钟了

    回复