mirror of
https://github.com/torappinfo/uweb.git
synced 2024-08-14 23:54:59 +00:00
Compare commits
2 commits
eb328d7609
...
54c1db0255
Author | SHA1 | Date | |
---|---|---|---|
|
54c1db0255 | ||
|
f8529dc7de |
2 changed files with 11 additions and 8 deletions
|
@ -1,7 +1,16 @@
|
||||||
<!DOCTYPE html><html lang="en"><head>
|
<!DOCTYPE html><html lang="en"><head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
<base href="https://jamesfengcao.codeberg.page/en/searchurl/bingAI/">
|
||||||
<title id="docTitle">Draw</title>
|
<title id="docTitle">Draw</title>
|
||||||
<link rel="stylesheet" href="./css/DrawImg.css">
|
<link rel="stylesheet" href="./css/DrawImg.css">
|
||||||
|
<script>
|
||||||
|
function getMagicUrl() {
|
||||||
|
let v = localStorage.GoGoUrl;
|
||||||
|
if(v && v.startsWith("http")) return v;
|
||||||
|
return "https://mybing2.xn--xyza.top/";
|
||||||
|
}
|
||||||
|
const magicUrl = getMagicUrl();
|
||||||
|
</script>
|
||||||
<script type="text/javascript" src="./js/generateImages.js"></script>
|
<script type="text/javascript" src="./js/generateImages.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -15,12 +24,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
async function getMagicUrl() {
|
|
||||||
let v = localStorage.GoGoUrl;
|
|
||||||
if(v && v.startsWith("http")) return v;
|
|
||||||
return "https://mybing2.xn--xyza.top/";
|
|
||||||
}
|
|
||||||
const magicUrl = getMagicUrl();
|
|
||||||
const inputDraw = document.getElementById('inputDraw');
|
const inputDraw = document.getElementById('inputDraw');
|
||||||
const imgsDiv = document.getElementById('imgs');
|
const imgsDiv = document.getElementById('imgs');
|
||||||
async function draw() {
|
async function draw() {
|
||||||
|
|
|
@ -18,7 +18,7 @@ async function generateImages(text,requestId,countF){
|
||||||
let theUrl = magicUrl+`images/create?${theUrls.toString()}`;
|
let theUrl = magicUrl+`images/create?${theUrls.toString()}`;
|
||||||
let response = await fetch(theUrl);
|
let response = await fetch(theUrl);
|
||||||
let html = (await response.text());
|
let html = (await response.text());
|
||||||
let cookieID = response.headers.get('cookieID');
|
//let cookieID = response.headers.get('cookieID');
|
||||||
|
|
||||||
//如果返回的是有错误的页面
|
//如果返回的是有错误的页面
|
||||||
let urr = new RegExp('class="gil_err_mt">([^<>]*)</div>').exec(html);
|
let urr = new RegExp('class="gil_err_mt">([^<>]*)</div>').exec(html);
|
||||||
|
@ -47,7 +47,7 @@ async function generateImages(text,requestId,countF){
|
||||||
await sleep(3000);
|
await sleep(3000);
|
||||||
let imgPageHtml;
|
let imgPageHtml;
|
||||||
try{
|
try{
|
||||||
imgPageHtml = (await (await fetch(imgPageHtmlUrl,{headers:{"cookieID":cookieID}})).text());
|
imgPageHtml = (await (await fetch(imgPageHtmlUrl)).text());
|
||||||
}catch(e){
|
}catch(e){
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue