summaryrefslogtreecommitdiffstats
path: root/player/lua/ytdl_hook.lua
diff options
context:
space:
mode:
authorChrisK2 <spam@kalania.de>2014-11-26 17:17:05 +0100
committerChrisK2 <spam@kalania.de>2014-11-26 17:17:05 +0100
commit07ddfd4f8afd6047c9d22249a9b1923ea6221643 (patch)
tree6773644fba2071359adc1647902e0258f34a086d /player/lua/ytdl_hook.lua
parenta6056c52fe465f90cb00f1705eb12832178f18e1 (diff)
downloadmpv-07ddfd4f8afd6047c9d22249a9b1923ea6221643.tar.bz2
mpv-07ddfd4f8afd6047c9d22249a9b1923ea6221643.tar.xz
ytdl: When using DASH, print actual duration
prints the actual duration as reported by youtube-dl to the terminal when available
Diffstat (limited to 'player/lua/ytdl_hook.lua')
-rw-r--r--player/lua/ytdl_hook.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
index 143ca4fe7a..5fece5bbea 100644
--- a/player/lua/ytdl_hook.lua
+++ b/player/lua/ytdl_hook.lua
@@ -120,7 +120,11 @@ mp.add_hook("on_load", 10, function ()
-- DASH?
if not (json["requested_formats"] == nil) then
- msg.info("NOTE: Using DASH, expect inaccurate duration.")
+ msg.info("Using DASH, expect inaccurate duration.")
+ if not (json.duration == nil) then
+ msg.info("actual duration: " .. mp.format_time(json.duration))
+ end
+
-- video url
streamurl = json["requested_formats"][1].url