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: