Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
hung319 authored Jan 14, 2025
1 parent d9c7e1f commit 7ea57fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ <h1>Tải ảnh NSFW</h1>
<label for="apiSelector">Chọn API:</label>
<select id="apiSelector">
<option value="waifu.pics">Waifu.pics</option>
<option value="nekosapi.com">Nekosapi.com</option>
<option value="konachan(questionable)">Konachan.net(questionable)</option>
<option value="konachan(explicit)">Konachan.net(explicit)</option>
<option value="yande.re(questionable)">Yande.re(questionable)</option>
Expand Down Expand Up @@ -247,6 +248,7 @@ <h1>Tải ảnh NSFW</h1>
const PROXY_URL = 'https://proxy.h4rs.io.vn/cors?url=';
const API_URLS = {
'waifu.pics': 'https://waifu.pics/api/nsfw/waifu',
'nekosapi.com': 'https://api.nekosapi.com/v4/images/random?rating=explicit&limit=1',
'konachan(questionable)': 'https://konachan.net/post.json?tags=order:random+rating:questionable&limit=1',
'konachan(explicit)': 'https://konachan.net/post.json?tags=order:random+rating:explicit&limit=1',
'yande.re(questionable)': 'https://yande.re/post.json?tags=order:random+rating:questionable&limit=1',
Expand All @@ -272,7 +274,7 @@ <h1>Tải ảnh NSFW</h1>
try {
const response = await fetchWithRetry(apiUrl);
const data = await response.json();
const imageUrl = selectedApi === 'waifu.pics' ? data.url : data[0].file_url;
const imageUrl = (selectedApi === 'waifu.pics' || selectedApi === 'nekosapi.com') ? data.url : data[0].file_url;
const imageResponse = await fetchWithRetry(imageUrl);
const imageBlob = await imageResponse.blob();
const fileName = imageUrl.split('/').pop();
Expand Down

0 comments on commit 7ea57fc

Please sign in to comment.