Coder Social home page Coder Social logo

-python's People

Contributors

zeng-coder avatar

Stargazers

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

Watchers

 avatar

-python's Issues

sign/doSign.json返回 “服务出错(500)”。

import requests

headers = {
'Host': 'student.wozaixiaoyuan.com',
'Connection': 'keep-alive',
'Content-Length': '214',
'cookie': '',
'charset': 'utf-8',
'token': 'nnnnnnnn-nnnnnnnn-nnnn-nnnnnnnn',
'content-type': 'application/json',
'User-Agent': 'Mozilla/5.0 (Linux; Android 5.1.1; SM-G9350 Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.100 Safari/537.36 MicroMessenger/7.0.12.1620(0x27000C34) Process/appbrand0 NetType/WIFI Language/zh_CN ABI/arm32',
'Accept-Encoding': 'gzip,compress,br,deflate',
'Referer': 'https://servicewechat.com/wxce6d08f781975d91/114/page-frame.html'
}

data = {
"id": "000000000000000",
"signId": "0000000000000000",
"latitude": 00.00000,
"longitude": 00.000000,
"country": "**",
"province": "nn省",
"city": "nn市",
"district": "nn区",
"township": "nn街道"
}

response = requests.post('https://student.wozaixiaoyuan.com/sign/doSign.json', data=data, headers=headers,).json()
print(response['code'])
print(response['message'])

我参照了你的form,做了data的修改......
但是出现了一个问题......
为啥【健康打卡】'https://student.wozaixiaoyuan.com/health/save.json'可以正常post,
到了【签到】'https://student.wozaixiaoyuan.com/sign/doSign.json'就不行了.....返回 “服务出错(500)”。这两个有啥不一样么?

qq

你的qq群搜不到

你好,能否请教下问题

大佬你好,我们学校是每日的健康打卡,只有一个选项和定位,抓包的那个answer = '[0]',其次就是定位了,这样的话我是用location还是form呢?
我用过另一位作者写的token打卡的源码,他的data里面除了answer就是经纬度和具体地址,他的地址是直接用汉字的,请问和您的编码表示有什么区别?

下面附上那一位大佬的源码,我略有改动过,但是忘了在哪改了,云函数每日执行一次正常运行,其中个人信息被我删掉望理解

import json
import logging
import requests, time, random
import datetime

logger = logging.getLogger()
logger.setLevel(logging.INFO)


def get_status(self):
    if self['code'] == 0:
        return "好耶!已经自动打卡成功了!"
    elif self['code'] == 1:
        return "今日已打卡或未在打卡时间"
    elif self['code'] == -10:
        return "Token已失效,请及时更换Token值"
    else:
        return "发生未知错误!!!"


class Do:
    def __init__(self):
        # 喵提醒通知
        self.notifytoken = '此处为喵提醒token,我已删掉'

        self.api = "https://student.wozaixiaoyuan.com/health/save.json"
        self.headers = {
            "Host": "student.wozaixiaoyuan.com",
            "Content-Type": "application/x-www-form-urlencoded",
            "Accept-Encoding": "gzip, deflate, br",
            "Connection": "keep-alive",
            "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 MicroMessenger/7.0.9.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat",
            "Referer": "https://servicewechat.com/wxce6d08f781975d91/165/page-frame.html",
            "token": "此处是token,被我删掉了",
            "Content-Length": "292",
        }

        # 健康打卡数据
        self.data = {
            "answers": '["0"]',
            "latitude": "经纬度被我删掉了",
            "longitude": "经纬度被我删掉了",
            "country": "**",
            "city": "保定市",
            "district": "定兴县",
            "province": "河北省",
            "township": "具体地址被我删掉了",
            "street": "具体地址被我删掉了",
            "areacode": "地区编码被我删掉了",
        }

    def run(self):
        res = requests.post(self.api, headers=self.headers, data=self.data, ).json()  # 健康打卡提交
        msg = {
            "id": self.notifytoken,
            "text": datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') + "\n" + "小v为你进行云端自动打卡" + "\n" + get_status(res),
            "type": "json"
        }
        print(type(msg))
        requests.post("http://miaotixing.com/trigger?id=此处为喵提醒token,我已删掉", data=msg)
        return True


if __name__ == "__main__":
    Do().run()


def main_handler(event, context):
    logger.info('got event{}'.format(event))
    return Do().run()

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.