mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
use largest resolution mp4 video available
This commit is contained in:
parent
0633ec2c39
commit
e2b8e17f85
4 changed files with 29 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
import strutils, sequtils, strformat, options
|
||||
import strutils, sequtils, strformat, options, algorithm
|
||||
import karax/[karaxdsl, vdom, vstyles]
|
||||
from jester import Request
|
||||
|
||||
|
|
@ -105,8 +105,11 @@ proc renderVideo*(video: Video; prefs: Prefs; path: string): VNode =
|
|||
img(src=thumb)
|
||||
renderVideoDisabled(video, path)
|
||||
else:
|
||||
let vid = video.variants.filterIt(it.contentType == playbackType)
|
||||
let source = if prefs.proxyVideos: getVidUrl(vid[0].url) else: vid[0].url
|
||||
let
|
||||
vars = video.variants.filterIt(it.contentType == playbackType)
|
||||
vidUrl = vars.sortedByIt(it.resolution)[^1].url
|
||||
source = if prefs.proxyVideos: getVidUrl(vidUrl)
|
||||
else: vidUrl
|
||||
case playbackType
|
||||
of mp4:
|
||||
if prefs.muteVideos:
|
||||
|
|
|
|||
Loading…
Reference in a new issue