limoxi / aliyun_ddns Goto Github PK
View Code? Open in Web Editor NEW基于阿里云解析的动态域名解析
License: MIT License
基于阿里云解析的动态域名解析
License: MIT License
打开ip.txt 用 w+的方式,好像把之前存储的数据删除了, 是不是应该用 r+
如题
requests.get(REQUEST_URL, get_params) 这句遇到:
Traceback (most recent call last): File "aliyun_ddns.py", line 123, in update_yun(ip) File "aliyun_ddns.py", line 76, in update_yun get_resp = requests.get(REQUEST_URL, get_params) TypeError: get() takes exactly 1 argument (2 given)
REQUEST_URL: https://alidns.aliyuncs.com/
get_params: {'SignatureVersion': '1.0', 'DomainName': u'xxx', 'Timestamp': 'xxx', 'Format': 'json', 'SignatureMethod': 'HMAC-SHA1', 'AccessKeyId': u'xxx', 'TypeKeyWord': 'A', 'Version': '2015-01-09', 'Signature': 'xxx', 'Action': 'DescribeDomainRecords', 'SignatureNonce': UUID('xxx')}
rt:
我修改了一下解析的地址,修改get_curr_ip 方法如下
def get_curr_ip():
headers = {
'content-type': 'text/html',
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0'
}
resp = requests.get('http://ip.tool.chinaz.com/', headers=headers)
soup = BS(resp.content, 'html.parser')
return soup.select('.fz24')[0].string
update remote record...
get_records============
{u'Code': u'Forbidden.RAM', u'Message': u"User not authorized to operate on the specified resource, or this API doesn't support RAM.", u'HostId': u'alidns.aliyuncs.com', u'RequestId': u'3AFE62CC-8458-46C7-811A-BA0B60299256'}
Traceback (most recent call last):
File "aliyun_ddns.py", line 124, in
update_yun(ip)
File "aliyun_ddns.py", line 78, in update_yun
for record in records['DomainRecords']['Record']:
KeyError: 'DomainRecords'
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.