diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2025-05-20 07:50:24 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2025-05-20 08:39:39 -0700 |
commit | 5df562dbadb762ee66a09fdd633a44d0fc1c1260 (patch) | |
tree | 0761c45afa5b45a9ea060424cd47986ad0f5c464 | |
parent | 2d3255abec72cb5a0eb540672b2adafff0d06d20 (diff) | |
download | mpv-iptv-menu-5df562dbadb762ee66a09fdd633a44d0fc1c1260.tar.gz mpv-iptv-menu-5df562dbadb762ee66a09fdd633a44d0fc1c1260.tar.xz |
ability to play movie trailers from youtube
-rw-r--r-- | main.lua | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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, |