diff --git a/Pimvidious b/Pimvidious index 9ec5856..f2efb29 100755 Binary files a/Pimvidious and b/Pimvidious differ diff --git a/src/Pimvidious.nim b/src/Pimvidious.nim index f35317b..288a443 100644 --- a/src/Pimvidious.nim +++ b/src/Pimvidious.nim @@ -41,6 +41,7 @@ proc createRouter(): Router = router.get("/", pageHandler) router.get("/new/*", pageHandler) router.get("/video.*/*", videoHandler) + router.get("/video.*/*/*", videoHandler) router.get("/video.*/*/*/*", videoHandler) router.get("/favicon.ico", staticFileHandler) router.get("/favicon.png", staticFileHandler) diff --git a/src/genpage.nim b/src/genpage.nim index 27923cf..d403d19 100644 --- a/src/genpage.nim +++ b/src/genpage.nim @@ -103,7 +103,11 @@ proc compilePage(content: string, video_uri: string = "", search_query: string = var vid_url, vid_thumb: string vid_url = url.replace("THUMBNUM","0") - vid_thumb = thumbs[idx].replace("THUMBNUM","1") + if thumbs.len > idx: + vid_thumb = thumbs[idx].replace("THUMBNUM","1") + else: + vid_url = url.replace("THUMBNUM","1") + vid_thumb = thumbs[^1].replace("THUMBNUM","1") let title = vid_url.split("/")[^1].replace("_"," ") page &= fmt"""
""" page &= ""