Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INGRESS_INTEL_PAYLOAD_V 其实是被写在ingress的js脚本里头的…… #1

Open
blackgear opened this issue Aug 28, 2014 · 3 comments

Comments

@blackgear
Copy link

def fetch_payload_v(self):
    headers = {
    'referer': 'https://www.ingress.com/intel',
    'user-agent': 'balabalabala',
    }
    request = requests.post('https://www.ingress.com/jsc/gen_dashboard.js', headers=headers, verify=False)
    offset = request.text.index('b.v="') + 5
    v = request.text[offset:offset + 40]
    return v

就像这样……

最开始运行的时候调用一次,等js版本更新之后v值改变的时候会返回{'error':'out of date'},这个时候重新调用一次就好了。

@blackgear
Copy link
Author

看起来还是正则匹配‘[\da-f]{40}’比较安全……

@mitnk
Copy link
Owner

mitnk commented Sep 1, 2014

Can you send a Pull Request for this? (Please follow PEP8). Thanks. I'm AFK these days

@tapionx
Copy link

tapionx commented Oct 15, 2014

url = 'http://www.ingress.com/jsc/gen_dashboard.js'
http = urllib3.PoolManager()
response = http.request('GET', 'http://www.ingress.com/jsc/gen_dashboard.js')
body = response.data
a = re.search(r'c.v="(.*)";e=ud.g', body)
version = a.group(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants