anerycoft / autoxgp Goto Github PK
View Code? Open in Web Editor NEW自动为您的微软账户订阅XGP
Home Page: https://www.xbox.com/zh-HK/xbox-game-pass/pc-game-pass
License: GNU General Public License v3.0
自动为您的微软账户订阅XGP
Home Page: https://www.xbox.com/zh-HK/xbox-game-pass/pc-game-pass
License: GNU General Public License v3.0
C:\Users\Administrator\Desktop\AutoXGP-main>python AutoXGP.py
[16:28:16] 已设置Xbox玩家代号为:drdcohCJ0otRzCd
Exception in thread Thread-3 (assign_account):
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1073, in _bootstrap_inner
self.run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Administrator\Desktop\AutoXGP-main\AutoXGP.py", line 814, in assign_account
getXGP(account)
File "C:\Users\Administrator\Desktop\AutoXGP-main\AutoXGP.py", line 595, in getXGP
addressId = addresses.json()["id"]
~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'id'
签约支付宝后显示已订阅xgp但是没有扣款信息
Reason:
因为微软账号没有设置姓名,导致请求addresses时报Bad Requests
Solutions:
①使用设置了姓名的微软账号
②在请求addresses之前请求设置姓名的profiles
Possible version:
# 确认使用支付宝订阅
url = f"https://paymentinstruments.mp.microsoft.com/v6.0/users/me/paymentInstrumentsEx/{payment_instrument_id}?language=zh-CHT&partner=webblends&country=hk&completePrerequisites=True"
add_alipay = client.get(url=url, headers=headers)
# ===========================================================================
# setname
url = "https://paymentinstruments.mp.microsoft.com/v6.0/users/me/profiles"
body = {
"profileType":"consumerprerequisites",
"profileCountry":"hk",
"profileOperation":"add",
"type":"consumer",
"first_name":"fix",
"last_name":"fix",
"email_address":ms_email,
"culture":"EN"
}
setname = client.post(url=url, json=body, headers=headers)
# ===========================================================================
# 添加地址信息
# url = "https://jcmsfd.account.microsoft.com/JarvisCM/me/addresses"
url = "https://paymentinstruments.mp.microsoft.com/v6.0/users/me/addresses"
body = {
"addressCountry": "hk",
"addressType": "billing",
"address_line1": "b",
"address_line2": "",
"city": "a",
"country": "hk"
}
addresses = client.post(url=url, json=body, headers=headers)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.