if m_simpleTV.Control.ChangeAddress ~= 'No' then return end
local inAdr =  m_simpleTV.Control.CurrentAddress

if not string.match( inAdr, 'https://1tv%.ru/live' )  then return end
m_simpleTV.Control.ChangeAddress = 'Yes'
m_simpleTV.Control.CurrentAddress = 'error'

if m_simpleTV.Control.MainMode == 0 then
   m_simpleTV.Control.ChangeChannelName(  'Первый канал' , m_simpleTV.Control.ChannelID, true )
   m_simpleTV.Control.ChangeChannelLogo( 'https://static.1tv.ru/assets/web/logo-ac67852f1625b338f9d1fb96be089d03557d50bfc5790d5f48dc56799f59dec6.svg'
										 , m_simpleTV.Control.ChannelID )   
end


local session = m_simpleTV.Http.New()
if session==nil then return end
local rc = m_simpleTV.Http.Request(session,{url="https://1tv.ru/live"})
if rc~=200 then
  m_simpleTV.Http.Close(session)
  return
end 
local cc = m_simpleTV.Http.GetCookies(session,"","s")
m_simpleTV.Http.Close(session)
if cc==nil then return end
m_simpleTV.Control.CurrentAddress = 'https://mobdrm.1tv.ru/hls-live10/streams/1tv/1tv5.m3u8?cdn=edge4.1internet.tv&s=' 
								     .. m_simpleTV.Common.toPersentEncoding(cc)
