rhming / UnicomDailyTask

联通日常任务 腾讯云函数定时执行
MIT License
152 stars 77 forks source link

华为云部署失败 #13

Closed gitiray closed 2 years ago

gitiray commented 3 years ago

您好,运行出现了这个情况

Handler 'handler' not found in module 'index'(module 'index' has no attribute 'handler')
Traceback (most recent call last):
AttributeError: module 'index' has no attribute 'handler'
rhming commented 3 years ago

函数执行入口需改成index.main_handler

gitiray commented 3 years ago

谢谢,可以使用了

成功执行的日志里夹杂着一些 读取Cookie失败 保存Cookie失败 请问这个是正常的吗

rhming commented 3 years ago

pythonanywhere仓库搭建的数据存储接口可能没搭好 看一下后台是否有数据保存成功

gitiray commented 3 years ago

多谢,确实是数据存储那边出了点问题,已搞定

另外:

rhming commented 3 years ago

话费抵扣卷那个活动公众号已经下架了,券码可以从日志中自定义时间搜索到 券码领取完成那一行有个 code 就是券码 公众号回复 话费兑换 可以使用券码 image

会考虑增加

gitiray commented 3 years ago

您好,今天收到的推送很多项目显示未获取到日志,看了函数那边的日志发现很多报错。 不知道怎么回事,基本上都是这两个文件的错误。

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/opt/function/runtime/python3.6/rtsp/python/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/opt/function/runtime/python3.6/rtsp/python/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/function/code/activity/unicom/superSimpleTask.py", line 89, in run
    for item in self.getTask('superEasy'):
  File "/opt/function/code/activity/unicom/superSimpleTask.py", line 34, in getTask
    return data['data']
KeyError: 'data'
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/opt/function/runtime/python3.6/rtsp/python/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/opt/function/runtime/python3.6/rtsp/python/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/function/code/activity/unicom/dailySign.py", line 108, in run
    if not self.getContinuous():
  File "/opt/function/code/activity/unicom/dailySign.py", line 60, in getContinuous
    data = result['data']  # ['daySignList']
KeyError: 'data'
rhming commented 3 years ago

应该是登录了多台设备,只能一个设备登录其它的会被挤下线,在utils/config.py配置常用的的设备ID,删掉pythonanywhere后台的手机号WoGame这个数据,重新执行一遍

gitiray commented 3 years ago

有点奇怪,APPID 我都有配置,反复确认与常用设备一致,IMEI我也弄了。 我再研究研究吧,辛苦大佬解答。

gitiray commented 3 years ago

您好,我看最近更新加上了tg推送和微博活动,有两个问题

rhming commented 3 years ago

清除微博数据,第一次打开会根据设备信息初始化唯一的设备id 进行游客登录 guest/login请求 请求data包含android_id和device_id 响应的内容中获取到uid image

联通营业厅打开微博任务 会有一个guest/cardlist请求 s字段就是sign 这个sign每台设备固定 image

将获取到的deviceId androidId 替换掉 但不支持多账号 每个设备一天只能被使用一次

deviceId = "xxx"
androidId = "xxx"

image

多账号需要 模拟设备deviceId frida调试获取 或者多台设备

rhming commented 3 years ago

您好,我看最近更新加上了tg推送和微博活动,有两个问题

  • chat_id 因为我是用的频道,所以是 -100xxxxx 这样的,但实际测试报错 {'ok': False, 'error_code': 400, 'description': 'Bad Request: chat not found'},看了下您的代码,貌似-1有额外处理导致失败,但是没太看懂,请求解释
  • 微博的那个sign需要抓哪个包呢

tg-api问题已修复

gitiray commented 2 years ago

最近忙,才看到,感谢您的详细指导,这个issue基本上都解决了,就先关闭了