Bugfixes in Client, Cloudflare page example

This commit is contained in:
DarkCat09 2022-07-26 10:07:12 +04:00
parent 3fa3b592a2
commit 3c972c83f0
2 changed files with 241 additions and 3 deletions

225
cloudflare.html Normal file
View file

@ -0,0 +1,225 @@
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Please Wait... | Cloudflare</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" /><![endif]-->
<style>body{margin:0;padding:0}</style>
<!--[if gte IE 10]><!-->
<script>
if (!navigator.cookieEnabled) {
window.addEventListener('DOMContentLoaded', function () {
var cookieEl = document.getElementById('cookie-alert');
cookieEl.style.display = 'block';
})
}
</script>
<!--<![endif]-->
<script>
//<![CDATA[
(function(){
window._cf_chl_opt={
cvId: "2",
cType: "managed",
cNounce: "60603",
cRay: "7302b406cd228696",
cHash: "d4e6954950a219e",
cUPMDTk: "\/go?__cf_chl_tk=kWYv_tRIC92k7YH4y2DjHk8cG6NxqiqrNFuOqRK8Fu8-1658729119-0-gaNycGzNBz0",
cFPWv: "b",
cTTimeMs: "1000",
cLt: "n",
cRq: {
ru: "aHR0cHM6Ly9hdGVybm9zLm9yZy9nbw==",
ra: "cHl0aG9uLXJlcXVlc3RzLzIuMjguMQ==",
rm: "R0VU",
d: "G2POstLbRi/mO4xX+XzRkyogW3AfxXQUGCScenji3bfh+Gf0fkmJhvO2MowSatfqGliJ6f2H5ImzWa6d81NiobXdtTyoMSI6SOKJhA1yEwnB0lK2vynRDfPlOnBg3DLD9ajpnwbdChhAW6VJJpNcknw4DjY3Xw6QrapPwPcNviXh2L36o8Q64RdNrmsU2E/dX/bdO93AnNCYELqZNSk5LxR9Mk6nx69h2OlTujAywh6RNNznAb4VIMG98OPs8ezG/uyJT0IMDAi0hxX2XLQMgJpZmH9Fq9mOxdQb4u0yNelPMBmydSH8eY06+T8igX9Gl+KO1GwncGXNJiiuSkzRFyeEmqH1s7BAM8RonqSLmY/QlQBpKfXA7fVz3ZXx3kz/FZ5mymbNQM4Px0H8t70Fr/cBvb3ouURH/auflic15vYcTxJVF0Bhcwixm9kaU0idAJ3D7QVmekRCYAuQFoR/WILD3f1izZeIw/OjRyMCMulbXKlts/r/DnEuGB58L/0yanKluI1NOzWYwfHnRX98+EbGwsUZtysTA0gASgIHkkTUDJ2jR62ttWzksiTMs5L86RQrU+GNAFdct5Duy1RNMYS57xvSLLSfBFU0L/20OCogWsOnX1JTAV3uDaIRpzkBdA/71c9CQYnFhPwXd0CVCXknnVjRsZ9qnS30ajgBleqiw7EBYAFjpmOJcvb7ngRH",
t: "MTY1ODcyOTExOS44MTEwMDA=",
m: "ebYu94kEblPB33GnXq/UkQwZzAYGEz384g11FsTA2/E=",
i1: "7RZsHiXQtnE3zcV5NeyZiw==",
i2: "kRVJdWyzuDqPITricsrSgA==",
zh: "QOULi3+m02zThjEHsshmSiTQdvN0z3mb6EpEHHD4wUE=",
uh: "SLdVolODg++SO356HusO5I/hbfOpiiOxQXj62i/MUkA=",
hh: "/sR0/WeF9SUzF+YeTskjqNWaIcUj72REMvL1SD3B2cE=",
}
};
}());
//]]>
</script>
<style>
#cf-wrapper #spinner {width:69px; margin: auto;}
#cf-wrapper #cf-please-wait{text-align:center}
.attribution {margin-top: 32px;}
.bubbles { background-color: #f58220; width:20px; height: 20px; margin:2px; border-radius:100%; display:inline-block; }
#cf-wrapper #challenge-form { padding-top:25px; padding-bottom:25px; }
#cf-hcaptcha-container { text-align:center;}
#cf-hcaptcha-container iframe { display: inline-block;}
@keyframes fader { 0% {opacity: 0.2;} 50% {opacity: 1.0;} 100% {opacity: 0.2;} }
#cf-wrapper #cf-bubbles { width:69px; }
@-webkit-keyframes fader { 0% {opacity: 0.2;} 50% {opacity: 1.0;} 100% {opacity: 0.2;} }
#cf-bubbles > .bubbles { animation: fader 1.6s infinite;}
#cf-bubbles > .bubbles:nth-child(2) { animation-delay: .2s;}
#cf-bubbles > .bubbles:nth-child(3) { animation-delay: .4s;}
</style>
</head>
<body>
<div id="cf-wrapper">
<div class="cf-alert cf-alert-error cf-cookie-error" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>
<div id="cf-error-details" class="cf-error-details-wrapper">
<div class="cf-wrapper cf-header cf-error-overview">
<h1 data-translate="managed_challenge_headline">Please wait...</h1>
<h2 class="cf-subheadline"><span data-translate="managed_checking_msg">We are checking your browser...</span> aternos.org</h2>
</div>
<div class="cf-section cf-highlight cf-captcha-container">
<div class="cf-wrapper">
<div class="cf-columns two">
<div class="cf-column">
<div class="cf-highlight-inverse cf-form-stacked">
<form id="challenge-form" class="challenge-form managed-form" action="/go?__cf_chl_f_tk=kWYv_tRIC92k7YH4y2DjHk8cG6NxqiqrNFuOqRK8Fu8-1658729119-0-gaNycGzNBz0" method="POST" enctype="application/x-www-form-urlencoded">
<div id='cf-please-wait'>
<div id='spinner'>
<div id="cf-bubbles">
<div class="bubbles"></div>
<div class="bubbles"></div>
<div class="bubbles"></div>
</div>
</div>
<p data-translate="please_wait" id="cf-spinner-please-wait">Please stand by, while we are checking your browser...</p>
<p data-translate="redirecting" id="cf-spinner-redirecting" style="display:none">Redirecting...</p>
</div>
<input type="hidden" name="md" value="T6wr36AHkZr.tdd5QxXPJrVtTgcyCpukpRLSzX85Gzk-1658729119-0-AU4sNK9LmhvpfyhJLVO7FKIPeYP_q3546w6eG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fCbn2DVqLBiG1m+On9e0FjO/cSLMN16qUFe+PuA3+4+30c7ahr0Gl2f9gKGNaozoFOnjEYm1/MYw65BHPu+/curMrU+PsFK7KPmT9lmUw+SR+XMTW0IL+uRuVFuGAkXmeflC1cwlawQRupaTSStxadeWPI9YA3X6gSItKECQEcOaPII4p0bGoNbHiKYNtcOOFMGb4HO4WolF7IuqsGH7S8C5GK8ynVq8RT9/Qb+xe0wVI4fqIHjFSTW0ZyCcJnw5O5bXBwez/hrkmflM7g1G3G7Dm3bSH5EnnLXOsd1cWQfxb3sKA6nmnQGwnCE6HsTZUPhgsOuHfXAG8phyC/zMhyEONnOrBMhLNpSwHlLx86LtbB7OYk+eDn2gI61fjS8u1qh7wBRc/mJIq7W9JC5hh4l32VUWGg==">
<input type="hidden" name="vc" value="b1c5dfed78a36a966ad5eb7fc136a067">
<noscript id="cf-captcha-bookmark" class="cf-captcha-info">
<h1 data-translate="turn_on_js" style="color:#bd2426;">Please turn JavaScript on and reload the page.</h1>
</noscript>
<div id="no-cookie-warning" class="cookie-warning" data-translate="turn_on_cookies" style="display:none">
<p data-translate="turn_on_cookies" style="color:#bd2426;">Please enable Cookies and reload the page.</p>
</div>
<script>
//<![CDATA[
var a = function() {try{return !!window.addEventListener} catch(e) {return !1} },
b = function(b, c) {a() ? document.addEventListener("DOMContentLoaded", b, c) : document.attachEvent("onreadystatechange", b)};
b(function(){
var cookiesEnabled=(navigator.cookieEnabled)? true : false;
if(!cookiesEnabled){
var q = document.getElementById('no-cookie-warning');q.style.display = 'block';
}
});
//]]>
</script>
<div id="trk_captcha_js" style="background-image:url('/cdn-cgi/images/trace/captcha/nojs/transparent.gif?ray=7302b406cd228696')"></div>
</form>
<script>
//<![CDATA[
(function(){
var isIE = /(MSIE|Trident\/|Edge\/)/i.test(window.navigator.userAgent);
var trkjs = isIE ? new Image() : document.createElement('img');
trkjs.setAttribute("src", "/cdn-cgi/images/trace/managed/js/transparent.gif?ray=7302b406cd228696");
trkjs.id = "trk_managed_js";
trkjs.setAttribute("alt", "");
document.body.appendChild(trkjs);
var cpo=document.createElement('script');
cpo.type='text/javascript';
cpo.src = '/cdn-cgi/challenge-platform/h/b/orchestrate/managed/v1?ray=7302b406cd228696';
window._cf_chl_opt.cOgUHash = location.hash === '' && location.href.indexOf('#') !== -1 ? '#' : location.hash;
window._cf_chl_opt.cOgUQuery = location.search === '' && location.href.slice(0, -window._cf_chl_opt.cOgUHash.length).indexOf('?') !== -1 ? '?' : location.search;
if (window._cf_chl_opt.cUPMDTk && window.history && window.history.replaceState) {
var ogU = location.pathname + window._cf_chl_opt.cOgUQuery + window._cf_chl_opt.cOgUHash;
history.replaceState(null, null, "\/go?__cf_chl_rt_tk=kWYv_tRIC92k7YH4y2DjHk8cG6NxqiqrNFuOqRK8Fu8-1658729119-0-gaNycGzNBz0" + window._cf_chl_opt.cOgUHash);
cpo.onload = function() {
history.replaceState(null, null, ogU);
};
}
document.getElementsByTagName('head')[0].appendChild(cpo);
}());
//]]>
</script>
</div>
</div>
<div class="cf-column">
<div class="cf-screenshot-container">
<span class="cf-no-screenshot"></span>
</div>
</div>
</div>
</div>
</div>
<div class="cf-section cf-wrapper">
<div class="cf-columns two">
<div class="cf-column">
<h2 data-translate="why_captcha_headline">Why do I have to complete a CAPTCHA?</h2>
<p data-translate="why_captcha_detail">Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.</p>
</div>
<div class="cf-column">
<h2 data-translate="resolve_captcha_headline">What can I do to prevent this in the future?</h2>
<p data-translate="resolve_captcha_antivirus">If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.</p>
<p data-translate="resolve_captcha_network">If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.</p>
</div>
</div>
</div>
<div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">
<p class="text-13">
<span class="cf-footer-item sm:block sm:mb-1">Cloudflare Ray ID: <strong class="font-semibold">7302b406cd228696</strong></span>
<span class="cf-footer-separator sm:hidden">&bull;</span>
<span id="cf-footer-item-ip" class="cf-footer-item hidden sm:block sm:mb-1">
Your IP:
<button type="button" id="cf-footer-ip-reveal" class="cf-footer-ip-reveal-btn">Click to reveal</button>
<span class="hidden" id="cf-footer-ip">35.239.37.39</span>
<span class="cf-footer-separator sm:hidden">&bull;</span>
</span>
<span class="cf-footer-item sm:block sm:mb-1"><span>Performance &amp; security by</span> <a rel="noopener noreferrer" href="https://www.cloudflare.com/5xx-error-landing" id="brand_link" target="_blank">Cloudflare</a></span>
</p>
<script>(function(){function d(){var b=a.getElementById("cf-footer-item-ip"),c=a.getElementById("cf-footer-ip-reveal");b&&"classList"in b&&(b.classList.remove("hidden"),c.addEventListener("click",function(){c.classList.add("hidden");a.getElementById("cf-footer-ip").classList.remove("hidden")}))}var a=document;document.addEventListener&&a.addEventListener("DOMContentLoaded",d)})();</script>
</div><!-- /.error-footer -->
</div>
</div>
<script>
window._cf_translation = {};
</script>
</body>
</html>

View file

@ -193,7 +193,11 @@ class Client:
serverstree = lxml.html.fromstring(serverspage.content)
servers = serverstree.xpath(
<<<<<<< HEAD
'/html/body/div[1]/main/div[3]/section/div[1]/div[2]/div'
=======
'//div[@class="servers"]/div'
>>>>>>> f731f1b (Bugfixes in Client, Cloudflare page example)
'/div[@class="server-body"]/@data-id'
)
self.refresh_servers(servers)
@ -232,6 +236,15 @@ class Client:
return AternosServer(servid, self.atconn)
def logout(self) -> None:
"""Logouts from Aternos account"""
self.atconn.request_cloudflare(
'https://aternos.org/panel/ajax/account/logout.php',
'GET', sendtoken=True
)
def change_username(self, value: str) -> None:
"""Changes a username in your Aternos account
@ -242,7 +255,7 @@ class Client:
self.atconn.request_cloudflare(
'https://aternos.org/panel/ajax/account/username.php',
'POST', data={'username': value}
'POST', data={'username': value}, sendtoken=True
)
def change_email(self, value: str) -> None:
@ -263,7 +276,7 @@ class Client:
self.atconn.request_cloudflare(
'https://aternos.org/panel/ajax/account/email.php',
'POST', data={'email': value}
'POST', data={'email': value}, sendtoken=True
)
def change_password(self, old: str, new: str) -> None:
@ -283,5 +296,5 @@ class Client:
'POST', data={
'oldpassword': old,
'newpassword': new
}
}, sendtoken=True
)