a lil oopsie
This commit is contained in:
@@ -2306,7 +2306,7 @@
|
|||||||
async function checkServerStatus(ip, isDeployed = false) {
|
async function checkServerStatus(ip, isDeployed = false) {
|
||||||
statusIndicator.textContent = "Connecting...";
|
statusIndicator.textContent = "Connecting...";
|
||||||
statusIndicator.className = "status-indicator connecting";
|
statusIndicator.className = "status-indicator connecting";
|
||||||
const url = isDeployed ? "/identify" : `http://{ip}:7275/identify`;
|
const url = isDeployed ? "/identify" : `https://{ip}:7275/identify`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
|
|||||||
@@ -527,7 +527,7 @@
|
|||||||
// --- State ---
|
// --- State ---
|
||||||
const getServerUrl = () => {
|
const getServerUrl = () => {
|
||||||
const extensionServerIp = localStorage.getItem("extension_server_ip") || "localhost";
|
const extensionServerIp = localStorage.getItem("extension_server_ip") || "localhost";
|
||||||
const url = "http://" + extensionServerIp + ":7275";
|
const url = "";
|
||||||
console.log("[manga-info] serverUrl=", url);
|
console.log("[manga-info] serverUrl=", url);
|
||||||
return url;
|
return url;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -661,7 +661,7 @@
|
|||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
const getServerUrl = () => {
|
const getServerUrl = () => {
|
||||||
const extensionServerIp = localStorage.getItem("extension_server_ip") || "localhost";
|
const extensionServerIp = localStorage.getItem("extension_server_ip") || "localhost";
|
||||||
const url = "http://" + extensionServerIp + ":7275";
|
const url = "";
|
||||||
console.log("[manga] serverUrl=", url);
|
console.log("[manga] serverUrl=", url);
|
||||||
return url;
|
return url;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -560,7 +560,7 @@
|
|||||||
let currentGenre = { id: null, name: null };
|
let currentGenre = { id: null, name: null };
|
||||||
let allSearchResults = [];
|
let allSearchResults = [];
|
||||||
let searchTimeout;
|
let searchTimeout;
|
||||||
const serverUrl = `http://${localStorage.getItem("extension_server_ip") || "localhost"}:7275`;
|
const serverUrl = ``;
|
||||||
|
|
||||||
// --- View Management ---
|
// --- View Management ---
|
||||||
function updateToggleIndicator() {
|
function updateToggleIndicator() {
|
||||||
|
|||||||
@@ -1139,7 +1139,7 @@
|
|||||||
<script>
|
<script>
|
||||||
let currentMalId = new URLSearchParams(window.location.search).get("id");
|
let currentMalId = new URLSearchParams(window.location.search).get("id");
|
||||||
const extensionIp = localStorage.getItem("extension_server_ip") || "localhost";
|
const extensionIp = localStorage.getItem("extension_server_ip") || "localhost";
|
||||||
let serverUrl = `http://${extensionIp}:7275`;
|
let serverUrl = ``;
|
||||||
|
|
||||||
// Assumes the Python backend is available at port 7275 on the extension server or localhost.
|
// Assumes the Python backend is available at port 7275 on the extension server or localhost.
|
||||||
const THEMES_API = serverUrl + "/api/themes";
|
const THEMES_API = serverUrl + "/api/themes";
|
||||||
|
|||||||
@@ -904,11 +904,7 @@
|
|||||||
const extensionServerItem = document.getElementById("extensionServerItem");
|
const extensionServerItem = document.getElementById("extensionServerItem");
|
||||||
|
|
||||||
function getApiUrl(path) {
|
function getApiUrl(path) {
|
||||||
const isDeployed = window.location.protocol.startsWith("http");
|
return "";
|
||||||
if (isDeployed) return path;
|
|
||||||
const ip = localStorage.getItem("extension_server_ip");
|
|
||||||
if (!ip) { console.error("Extension IP not found."); return null; }
|
|
||||||
return `http://${ip}:7275${path}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function initialize() {
|
async function initialize() {
|
||||||
|
|||||||
@@ -379,7 +379,7 @@
|
|||||||
const [jikanInfoResp, jikanEpisodesResp, kitsuMapResp] = await Promise.all([
|
const [jikanInfoResp, jikanEpisodesResp, kitsuMapResp] = await Promise.all([
|
||||||
fetch(`https://api.jikan.moe/v4/anime/${jikanId}`),
|
fetch(`https://api.jikan.moe/v4/anime/${jikanId}`),
|
||||||
fetch(`https://api.jikan.moe/v4/anime/${jikanId}/episodes`),
|
fetch(`https://api.jikan.moe/v4/anime/${jikanId}/episodes`),
|
||||||
fetch(`http://${serverIp}:7275/map/mal/${jikanId}`)
|
fetch(`/map/mal/${jikanId}`)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (jikanInfoResp.ok) {
|
if (jikanInfoResp.ok) {
|
||||||
@@ -430,7 +430,7 @@
|
|||||||
|
|
||||||
async function populateSourceChanger() {
|
async function populateSourceChanger() {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`http://${serverIp}:7275/modules/streaming`);
|
const response = await fetch(`/modules/streaming`);
|
||||||
if (!response.ok) throw new Error('Failed to fetch streaming modules');
|
if (!response.ok) throw new Error('Failed to fetch streaming modules');
|
||||||
const modules = await response.json();
|
const modules = await response.json();
|
||||||
|
|
||||||
@@ -499,7 +499,7 @@
|
|||||||
loadingContainer.style.display = 'flex';
|
loadingContainer.style.display = 'flex';
|
||||||
}
|
}
|
||||||
|
|
||||||
let iframeSrcURL = `http://${serverIp}:7275/iframe-src?mal_id=${jikanId}&episode=${episode}&dub=${dub}`;
|
let iframeSrcURL = `/iframe-src?mal_id=${jikanId}&episode=${episode}&dub=${dub}`;
|
||||||
if (preferModule && preferModule !== 'default') {
|
if (preferModule && preferModule !== 'default') {
|
||||||
iframeSrcURL += `&prefer_module=${encodeURIComponent(preferModule)}`;
|
iframeSrcURL += `&prefer_module=${encodeURIComponent(preferModule)}`;
|
||||||
}
|
}
|
||||||
|
|||||||
2
app.py
2
app.py
@@ -892,7 +892,7 @@ async def download_manga_chapter_as_pdf_full(source: str, manga_id: str, chapter
|
|||||||
total_h = 0
|
total_h = 0
|
||||||
width = 595
|
width = 595
|
||||||
for u in urls:
|
for u in urls:
|
||||||
full_u = u if u.startswith("http") else f"http://localhost:7275{u}"
|
full_u = u if u.startswith("http") else f"https://localhost{u}"
|
||||||
res = await tunnel_request("GET", full_u)
|
res = await tunnel_request("GET", full_u)
|
||||||
img = Image.open(io.BytesIO(base64.b64decode(res["body"]))).convert("RGB")
|
img = Image.open(io.BytesIO(base64.b64decode(res["body"]))).convert("RGB")
|
||||||
new_h = int(width * (img.height / img.width))
|
new_h = int(width * (img.height / img.width))
|
||||||
|
|||||||
@@ -368,7 +368,7 @@
|
|||||||
let source, mangaId, chapterId;
|
let source, mangaId, chapterId;
|
||||||
let chapterData = null;
|
let chapterData = null;
|
||||||
const serverIp = localStorage.getItem("extension_server_ip") || "localhost";
|
const serverIp = localStorage.getItem("extension_server_ip") || "localhost";
|
||||||
const serverUrl = `http://${serverIp}:7275`;
|
const serverUrl = ``;
|
||||||
const READER_MODE_KEY = "reader_view_mode";
|
const READER_MODE_KEY = "reader_view_mode";
|
||||||
const HISTORY_KEY = "reading_history";
|
const HISTORY_KEY = "reading_history";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user