From 69af1f42c6ab82117318339389d3953b82eaffd5 Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Wed, 16 Oct 2024 14:09:21 +0100 Subject: [PATCH] corrected video quality issue --- src/genpage.nim | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/genpage.nim b/src/genpage.nim index dd9741c..27923cf 100644 --- a/src/genpage.nim +++ b/src/genpage.nim @@ -42,16 +42,18 @@ proc parseThumbs(content: string): seq[string] = return thumbs proc setUpVideo(content: string, video_uri: string): (string, Urls, Thumbs) = - let rel_vids_re = re"""video_related=(.+)""" - let vid_url_re = re"""setVideoUrl(High|Low)(.*)""" - let vid_hls_re = re"""setVideoHLS(.*)""" - let vid_thumb_re = re"""setThumbUrl(.*)""" - let related_vids = collect: - for vid in content.findAll(rel_vids_re): - vid.replace(",","\n") - let videos = content.findAll(vid_url_re) - var video = videos[0].split("'")[1] - let video_low = videos[1].split("'")[1] + let + rel_vids_re = re"""video_related=(.+)""" + vid_h_url_re = re"""setVideoUrlHigh(.*)""" + vid_l_url_re = re"""setVideoUrlLow(.*)""" + vid_hls_re = re"""setVideoHLS(.*)""" + vid_thumb_re = re"""setThumbUrl(.*)""" + related_vids = collect: + for vid in content.findAll(rel_vids_re): + vid.replace(",","\n") + + var video = content.findAll(vid_h_url_re)[0].split("'")[1] + let video_low = content.findAll(vid_l_url_re)[0].split("'")[1] var video_hls: string var video_hls_matches = content.findAll(vid_hls_re) if video_hls_matches.len > 0: