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
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: