corrected video quality issue

This commit is contained in:
Paul Wilde 2024-10-16 14:09:21 +01:00
parent 58cca7afca
commit 69af1f42c6

View file

@ -42,16 +42,18 @@ proc parseThumbs(content: string): seq[string] =
return thumbs return thumbs
proc setUpVideo(content: string, video_uri: string): (string, Urls, Thumbs) = proc setUpVideo(content: string, video_uri: string): (string, Urls, Thumbs) =
let rel_vids_re = re"""video_related=(.+)""" let
let vid_url_re = re"""setVideoUrl(High|Low)(.*)""" rel_vids_re = re"""video_related=(.+)"""
let vid_hls_re = re"""setVideoHLS(.*)""" vid_h_url_re = re"""setVideoUrlHigh(.*)"""
let vid_thumb_re = re"""setThumbUrl(.*)""" vid_l_url_re = re"""setVideoUrlLow(.*)"""
let related_vids = collect: vid_hls_re = re"""setVideoHLS(.*)"""
vid_thumb_re = re"""setThumbUrl(.*)"""
related_vids = collect:
for vid in content.findAll(rel_vids_re): for vid in content.findAll(rel_vids_re):
vid.replace(",","\n") vid.replace(",","\n")
let videos = content.findAll(vid_url_re)
var video = videos[0].split("'")[1] var video = content.findAll(vid_h_url_re)[0].split("'")[1]
let video_low = videos[1].split("'")[1] let video_low = content.findAll(vid_l_url_re)[0].split("'")[1]
var video_hls: string var video_hls: string
var video_hls_matches = content.findAll(vid_hls_re) var video_hls_matches = content.findAll(vid_hls_re)
if video_hls_matches.len > 0: if video_hls_matches.len > 0: