1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| export my_cookie='xxx' add_domain() { domain_param=$1 curl 'https://dns.he.net/?hosted_dns_zoneid=1185512&menu=edit_zone&hosted_dns_editzone' \ -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \ -H 'Accept-Language: zh-CN,zh;q=0.9' \ -H 'Cache-Control: no-cache' \ -H 'Connection: keep-alive' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H "Cookie: $my_cookie" \ -H 'DNT: 1' \ -H 'Origin: https://dns.he.net' \ -H 'Pragma: no-cache' \ -H 'Referer: https://dns.he.net/?hosted_dns_zoneid=1185512&menu=edit_zone&hosted_dns_editzone' \ -H 'Sec-Fetch-Dest: document' \ -H 'Sec-Fetch-Mode: navigate' \ -H 'Sec-Fetch-Site: same-origin' \ -H 'Sec-Fetch-User: ?1' \ -H 'Upgrade-Insecure-Requests: 1' \ -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36' \ -H 'sec-ch-ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "macOS"' \ --data-raw "account=&menu=edit_zone&Type=A&hosted_dns_zoneid=1185512&hosted_dns_recordid=&hosted_dns_editzone=1&Priority=&Name=$domain_param&Content=114.3.1.184&TTL=300&dynamic=1&hosted_dns_editrecord=Submit" }
update_ddns() { domain_param=$1 curl 'https://dns.he.net/?hosted_dns_zoneid=1185512&menu=edit_zone&hosted_dns_editzone' \ -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \ -H 'Accept-Language: zh-CN,zh;q=0.9' \ -H 'Cache-Control: no-cache' \ -H 'Connection: keep-alive' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H "Cookie: $my_cookie" \ -H 'DNT: 1' \ -H 'Origin: https://dns.he.net' \ -H 'Pragma: no-cache' \ -H 'Referer: https://dns.he.net/?hosted_dns_zoneid=1185512&menu=edit_zone&hosted_dns_editzone' \ -H 'Sec-Fetch-Dest: document' \ -H 'Sec-Fetch-Mode: navigate' \ -H 'Sec-Fetch-Site: same-origin' \ -H 'Sec-Fetch-User: ?1' \ -H 'Upgrade-Insecure-Requests: 1' \ -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36' \ -H 'sec-ch-ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "macOS"' \ --data-raw "account=&menu=edit_zone&hosted_dns_zoneid=1185512&hosted_dns_recordid=&hosted_dns_editzone=1&Name=$domain_param&Key=$domain_param&Key2=$domain_param&generate_key=Submit" }
for domain in `cat /tmp/1.txt`; do echo "handle $domain" add_domain $domain >/dev/null update_ddns $domain >/dev/null sleep 1 done
|