-- скрапер TVS для плейлистов сайта https://filmix.co от west_side (30/06/20) module('filmix_WS_pls', package.seeall) local my_src_name = 'FILMIX WS' local filmixsite = 'https://filmix.co' function GetSettings() return {name = my_src_name, sortname = '', scraper = '', m3u = 'out_' .. my_src_name .. '.m3u', logo = 'https://filmix.co/templates/Filmix/media/img/filmix.png', TypeSource = 1, TypeCoding = 1, DeleteM3U = 0, RefreshButton = 0, AutoBuild = 0, AutoBuildDay = {0, 0, 0, 0, 0, 0, 0}, LastStart = 0, TVS = {add = 0, FilterCH = 0, FilterGR = 0,GetGroup = 0, LogoTVG = 0}, STV = {add = 1, ExtFilter = 1, FilterCH = 0, FilterGR = 0, GetGroup = 1, HDGroup = 0, AutoSearch = 0, AutoNumber = 0, NumberM3U = 0, GetSettings = 1, NotDeleteCH = 0, TypeSkip = 1, TypeFind = 1, TypeMedia = 2}} end function GetVersion() return 2, 'UTF-8' end local function LoadFromPage() -- в секции можно изменить ссылки на интересующие плейлисты согласно шаблону local str, page_all, page_in = '', 1, 17 while page_all <= 139 do local sessionFilmix = m_simpleTV.Http.New('Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36', prx, false) if not sessionFilmix then return end m_simpleTV.Http.SetTimeout(sessionFilmix, 30000) local playlist, txt = '', '' if page_all < 18 then playlist = 'top250' txt = '🎥 Filmix: Top 250' page = page_all elseif page_all >= 18 and page_all < 35 then playlist = 'top250/kp' txt = '🎥 Кинопоиск: Top 250' page = page_all - 17 elseif page_all >= 35 and page_all < 52 then playlist = 'top250/imdb' txt = '🎥 IMDB: Top 250' page = page_all - 34 elseif page_all >= 52 and page_all < 69 then playlist = 'top250s' txt = '📺 Filmix: Top 250' page = page_all - 51 elseif page_all >= 69 and page_all < 86 then playlist = 'top250s/kp' txt = '📺 Кинопоиск: Top 250' page = page_all - 68 elseif page_all >= 86 and page_all < 103 then playlist = 'top250s/imdb' txt = '📺 IMDB: Top 250' page = page_all - 85 elseif page_all >= 103 and page_all < 106 then playlist = 'top250m' txt = '🐶 Filmix: Top 250' page = page_all - 102 page_in = 3 elseif page_all >= 106 and page_all < 123 then playlist = 'top250m/kp' txt = '🐶 Кинопоиск: Top 250' page = page_all - 105 page_in = 17 elseif page_all >= 123 and page_all < 140 then playlist = 'top250m/imdb' txt = '🐶 IMDB: Top 250' page = page_all - 122 -- elseif page_all >= 52 and page_all < 59 then playlist = 'playlist/80-filmy-kotorye-zavoevali-lyubov-zriteley' txt = 'Filmix: my playlist' page = page_all - 51 page_in = 7 -- elseif page_all >= 59 and page_all < 61 then playlist = 'playlist/68-filmy-kotorymi-gordyatsya-rossiyane' txt = 'Filmix: my playlist' page = page_all - 58 page_in = 2 end local filmixurl = 'https://filmix.co/' .. playlist .. '/page/' .. page .. '/' local rc, filmixanswer = m_simpleTV.Http.Request(sessionFilmix, {url = filmixurl}) if rc ~= 200 then return end filmixanswer = m_simpleTV.Common.multiByteToUTF8(filmixanswer) str = str .. filmixanswer:gsub('\n', ' ') page_all = page_all + 1 m_simpleTV.OSD.ShowMessageT({text = txt .. ' (' .. math.floor(page/page_in*100) .. '%)' , showTime = 10000,0xFF00,3}) ---------------- end return str, txt end local function LoadFromSite() local t, i, k = {}, 1, 0 local name, adr, logo local answer = LoadFromPage() for w in answer:gmatch('
') do name_rus = w:match('itemprop="name" content="(.-)">') or '' quality = w:match('
(.-)
') or '' year = w:match('
(.-)') or '' genres = w:match('(.-)') or '' genres = genres:gsub('', ''):gsub('', '') perevod = w:match('
(.-)
') or '' perevod = perevod:gsub(':', ': ') actors = w:match('