ytdl: When using DASH, print actual duration

prints the actual duration as reported by youtube-dl to the
terminal when available
This commit is contained in:
ChrisK2 2014-11-26 17:17:05 +01:00
parent a6056c52fe
commit 07ddfd4f8a
1 changed files with 5 additions and 1 deletions

View File

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