--script for wink.rt.ru VOD (07/10/2020) --примеры адресов для запуска --https://wink.rt.ru/media_items?category_id=17&vod_genres=49253936 --https://wink.rt.ru/search?query=%D0%A2%D0%BE%D0%BC%20%D0%9A%D1%80%D1%83%D0%B7 --https://wink.rt.ru/collections/118?category_id=17 ------------------------------------------------------------------------------ if m_simpleTV.Control.ChangeAddress_UTF8 ~= 'No' then return end local inAdr = m_simpleTV.Control.CurrentAddress_UTF8 if inAdr==nil then return end if not string.match( inAdr, '^https://wink%.rt%.ru/media_items?.+' ) and not string.match( inAdr, '^https://wink%.rt%.ru/search?.+' ) and not string.match( inAdr, '^https://wink%.rt%.ru/collections/.+' ) then return end --------------------------------------------------------------------------- local masshtab = m_simpleTV.User.paramScriptForSkin_masshtab or 1 if m_simpleTV.User.paramScriptForSkin_background_chanel then background_chanel = m_simpleTV.User.paramScriptForSkin_background_chanel else background_chanel = 'https://radio-stream-1.obozrevatel.com/radiorelaxfm128.mp3' end if m_simpleTV.User.paramScriptForSkin_background1 then background1 = m_simpleTV.User.paramScriptForSkin_background1 else background1 = '' end if m_simpleTV.User.paramScriptForSkin_background2 then background2 = m_simpleTV.User.paramScriptForSkin_background2 else background2 = '' end local titul_rezka = '' local titul_hevc = '' local titul_rezka_tor = '' local titul_lostfilm = '' local titul_yt = '' local titul_wink = '' dataEN = os.date ("%a %d %b %Y %H:%M") dataRU = dataEN:gsub('Sun', 'Вс'):gsub('Mon', 'Пн'):gsub('Tue', 'Вт'):gsub('Wed', 'Ср'):gsub('Thu', 'Чт'):gsub('Fri', 'Пт'):gsub('Sat', 'Сб') dataRU = dataRU:gsub('Jan', 'Янв'):gsub('Feb', 'Фев'):gsub('Mar', 'Мар'):gsub('Apr', 'Апр'):gsub('May', 'Май'):gsub('Jun', 'Июн'):gsub('Jul', 'Июл'):gsub('Aug', 'Авг'):gsub('Sep', 'Сен'):gsub('Oct', 'Окт'):gsub('Nov', 'Ноя'):gsub('Dec', 'Дек') if m_simpleTV.Interface.GetLanguage() == 'ru' then data = dataRU else data = dataEn end if Weather and Weather.Param.enabled==1 then local pogoda = Weather.api.GetCurTemp() if type(pogoda)=="table" then -- m_simpleTV.OSD.ShowMessage_UTF8( pogoda.cur_temp .. pogoda.letter .. '\n' .. pogoda.cur_icon) pogoda_cur_temp = pogoda.cur_temp pogoda_letter = pogoda.letter pogoda_cur_icon = pogoda.cur_icon pogoda_str = '

' .. pogoda_cur_temp .. pogoda_letter .. '

' else m_simpleTV.OSD.ShowMessage_UTF8("NULL") pogoda_str = '' end else m_simpleTV.OSD.ShowMessage_UTF8("дополнение ПОГОДА не установлено") pogoda_str = '' end portal_str = '' .. pogoda_str .. '

' .. titul_rezka_tor .. titul_hevc .. titul_lostfilm ..' ' .. data .. ' ' .. titul_yt .. titul_rezka .. titul_wink .. '


' portal1_str = '

' .. titul_rezka_tor .. titul_hevc .. titul_lostfilm .. titul_yt .. titul_rezka .. titul_wink .. '


' --------------------------------------------------------------------------- m_simpleTV.Control.ChangeAddress_UTF8='Yes' m_simpleTV.Control.CurrentAddress_UTF8 = 'error' if inAdr:match('https://wink%.rt%.ru/search?') then inAdr = 'https://wink.rt.ru/search?' .. m_simpleTV.Common.fromPercentEncoding(inAdr:gsub('https://wink%.rt%.ru/search%?', '')) end debug_in_file(inAdr .. '\n') local userAgent = "okhttp/3.14.4" local session = m_simpleTV.Http.New(userAgent, nil, false) if session == nil then return end local rc,answer = m_simpleTV.Http.Request(session,{url=inAdr}) if rc~=200 then return end local logo = answer:match('"(/sdp/nc%-snapshot.-%.jpg)"') logo = 'https://s26037.cdn.ngenix.net' .. logo title = answer:match('(.-)<') title = title:gsub(' смотреть онлайн в хорошем качестве 1080p.-$', '') local pars, j, kj, desc = {}, 1, 1, '' for media in answer:gmatch('<a data%-type="media_item"(.-)</a>') do pars[j] = {} pars[j].poster = media:match('loading="lazy" srcSet="(.-) 2x"') or 'https://wink.rt.ru/assets/fa4f2bd16b18b08e947d77d6b65e397e.svg' pars[j].adr = media:match('href="(.-)"') pars[j].adr = 'https://wink.rt.ru' .. pars[j].adr pars[j].rating = media:match('<div class="ratings_r1x6jaa5">(.-)</div>') pars[j].rating = tonumber(pars[j].rating) if not pars[j].rating or pars[j].rating == '' then pars[j].rating = 0 end pars[j].name1 = media:match('<h4 class="root_r1ru04lg.-">(.-)</h4>') if kj == 7 then desc = desc .. '</tr><tr>' kj = 1 end desc = desc .. '<td style="padding: 0px 5px 5px; color: #EBEBEB;" width="' .. masshtab*150 .. '"><a href = "simpleTVLua:m_simpleTV.Control.PlayAddress(\'' .. pars[j].adr .. '\')" style="color: #7FFFD4; text-decoration: none;"><center><img src="' .. pars[j].poster .. '" height = "' .. 210*masshtab .. '" width = "' .. 140*masshtab .. '"><h5><center><img src="simpleTVImage:./luaScr/user/westSide/stars/' .. pars[j].rating .. '.png" height="' .. masshtab*24 .. '" align="top"></h5><h5><center><font color=#00FA9A>' .. pars[j].name1 .. '</font></h5></a></td>' j = j + 1 kj = kj + 1 end desc = '<html><body bgcolor="#434750" ' .. background1 .. '>' .. portal_str .. '<table width="' .. masshtab*920 .. '"><tr><td style="padding: 0px 5px 5px; color: #EBEBEB; vertical-align: middle;"><h1><center><font color=#6495ED>' .. title .. '</h1></td></tr></table><table width="' .. masshtab*920 .. '"><tr>' .. desc .. '</td></tr></table></body></html>' --debug_in_file(answer .. '\n') local poster='./luaScr/user/westSide/icons/Channels.jpg' if m_simpleTV.Control.CurrentTitle_UTF8~=nil then m_simpleTV.Control.CurrentTitle_UTF8 = title end if m_simpleTV.Control.MainMode == 0 then m_simpleTV.Interface.SetBackground({BackColor = 0, PictFileName = logo, TypeBackColor = 0, UseLogo = 4, Once = 1}) m_simpleTV.Control.ChangeChannelLogo(poster, m_simpleTV.Control.ChannelID, 'CHANGE_IF_NOT_EQUAL') end local retAdr = background_chanel m_simpleTV.Control.CurrentAddress_UTF8 = retAdr ----------------------------------------------------------multiaddress local tm = {} tm[1] = {} tm[1].Id = 1 tm[1].Name = title tm[1].Address = background_chanel tm[1].InfoPanelTitle = title tm[1].InfoPanelName = title tm[1].InfoPanelShowTime = 60000 tm[1].InfoPanelLogo = poster tm[1].InfoPanelDesc = desc tm[1].InfoPanelDesc = tm[1].InfoPanelDesc:gsub('"', '\"') tm[1].InfoPanelTitle = tm[1].InfoPanelTitle:gsub('"', '%%22') m_simpleTV.OSD.ShowSelect_UTF8('Wink', 0, tm, 8000, 32 + 64 + 128) m_simpleTV.Control.ExecuteAction(108,0) m_simpleTV.Control.ExecuteAction(108,1)