summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2025-05-20 07:50:24 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2025-05-20 08:39:39 -0700
commit5df562dbadb762ee66a09fdd633a44d0fc1c1260 (patch)
tree0761c45afa5b45a9ea060424cd47986ad0f5c464
parent2d3255abec72cb5a0eb540672b2adafff0d06d20 (diff)
downloadmpv-iptv-menu-5df562dbadb762ee66a09fdd633a44d0fc1c1260.tar.gz
mpv-iptv-menu-5df562dbadb762ee66a09fdd633a44d0fc1c1260.tar.xz
ability to play movie trailers from youtube
-rw-r--r--main.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/main.lua b/main.lua
index 7d62c3b..09b0936 100644
--- a/main.lua
+++ b/main.lua
@@ -842,7 +842,9 @@ local function play_stream(stream)
-- add a per-file option containing the stream id, allowing it to be
-- retrieved when a start-file event is received
local url
- if stream.stream_type == 'series' then
+ if stream.stream_url then
+ url = stream.stream_url
+ elseif stream.stream_type == 'series' then
url = xc_server .. '/series/' .. xc_user .. '/' .. xc_pass ..
'/' .. stream.stream_id .. '.vod'
else
@@ -1077,6 +1079,17 @@ local function open_option_movie_info(opt)
end
end
+ if info.youtube_trailer and info.youtube_trailer ~= '' then
+ local url = 'https://youtu.be/' .. info.youtube_trailer
+ options[#options+1] = {name=' '}
+ options[#options+1] = {
+ name='Trailer: ' .. url,
+ type='stream',
+ id='youtube:' .. info.youtube_trailer,
+ stream_url=url,
+ }
+ end
+
local m = {
options=options,
title='Movie Info: ' .. opt.name,