lax
This commit is contained in:
1 parent
eef1e2d743
commit
28dfc06d24
3 files changed
+7
-3
No files matched your search
@@ -21,9 +21,12 @@
|
||||
<button id="b2" class="btn reader-btn">Open / Next</button>
|
||||
<button id="b" class="btn reader-btn">Skip / Next</button>
|
||||
</div>
|
||||
<p style="margin-top: 10px; font-size: 0.8rem; color: #666">
|
||||
<p style="margin-block: 10px 0; color: #666">
|
||||
{{ queue_length }} items remaining
|
||||
</p>
|
||||
<p style="margin-block: 10px 0; color: #666">
|
||||
Return <a href="/">home</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/qrcode.js"></script>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
</p>
|
||||
|
||||
<div class="trail-hint">Tap anywhere to open & next</div>
|
||||
<div class="trail-hint">Return <a href="/">home</a></div>
|
||||
</div>
|
||||
<script>
|
||||
window.addEventListener("load", () => {
|
||||
|
||||
+2
-2
@@ -2,13 +2,13 @@
|
||||
|
||||
from collections import deque
|
||||
from itertools import islice
|
||||
from urllib.parse import urlsplit, urlunsplit
|
||||
|
||||
import uvicorn
|
||||
from fastapi import FastAPI, Form, Request
|
||||
from fastapi.responses import HTMLResponse, RedirectResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from pydantic import AnyHttpUrl
|
||||
|
||||
app = FastAPI()
|
||||
app.mount("/static", StaticFiles(directory="static"), name="static")
|
||||
@@ -19,7 +19,7 @@ queue: deque[str] = deque() # fifo ahh
|
||||
def link_extract_from_onetab(line: str) -> str:
|
||||
"link | title"
|
||||
link = line.split("|", 1)[0].strip()
|
||||
return AnyHttpUrl(link).unicode_string() # encoded is xn something
|
||||
return urlunsplit(urlsplit(link)) # encoded is xn something
|
||||
|
||||
|
||||
@app.get("/", response_class=HTMLResponse)
|
||||
|
||||
Reference in new issue
Block a user