Converter EPG XMLTV to OTT-play (by Alex) server side JSON

EPG converter for OTT-play FOSS

Описание

Инструмент создания телепрограммы для OTT-Play FOSS, использует 1 поток, и буферное чтение из файла, что позволяет минимизировать нагрузку на систему при разборе больших файлов, потребляет примерно 25 мб оперативной памяти при обработке 300 МБ файла, на современном процессоре тратит на это порядка 35 сек. Для любопытных есть бенчмарки.

Вся информация о провайдерах заносится в конфиг файлы в формате json, можно настроить провайдер так, что он будет получать данные через stdin (а значит файл можно вообще не скачивать на диск). Пример конфига в samples/sample_config.json

Поддерживается прямое скачивание файлов с поддержкой редиректов(301/302), а также прямая работа с gzip источниками.

После каждого запуска актуализируется база данных по обработанным провайдерам chcache.db на ее основе в конце создается общий список каналов.
epgcache.tmp это данные epg последнего обработанного провайдера, пересоздается при обработке нового провайдера.
Файл providers.json содержит имя провайдера, хеши поддерживаемых url-tvg, и время последней передачи в EPG (для контроля актуальности провайдера).
Для каждого провайдера также создается channels.json, в котором содержится хеш ид канала, время последней передачи на канале (позволяет контролировать актуальность и наличие EPG), ссылку на логотип канала, список названий канала.

Аргументы командной строки

Общая схема: <app> [--epg-ram] [-c OPTS]
Основные опции:
    --epg-ram  включает обработку базы в оперативной памяти, дает ~20% прирост
               производительности, но увеличивает потребление памяти до ~200МБ
    -c <opts>  обработать XMLTV файл по параметрам из конфиг файла
  ПРИМЕЧАНИЕ: Символ "," используется как разделитель в блоке <opts>,
              аргументы -c можно комбинировать

  -c config_file[,prov_name]
    config_file  файл со списком для обработки
    prov_name    дополнительный фильтр, для выборки только одного провайдера

Конфиг

Представляет из себя массив с json объектами, у которых могут быть следующие свойства:

  • id - идентификатор (короткое имя) провайдера, для внутреннего использования плеером;
  • file - имя файла на диске, который необходимо обрабатывать, в качестве имени файла можно указать -, тогда будет читаться ввод из StdIn, и можно загружать XML из cat/zcat/curl в различных комбинациях. Логично, что не стоит пытаться обработать 2 источника с - за один запуск. Имеет приоритет над urls, при указании обоих, предпочтение будет отдаваться file;
  • urls - массив ссылок, которые могут указываться в плейлистах (url-tvg), для этого провайдера, самая первая ссылка используется как источник, то есть скачивается и обрабатывается (если не определено свойство file);
  • order - порядок источника при поиске каналов по имени, по умолчанию имеет значение 50;

Обязательными являются только 2 свойства: id, url или file

Примеры конфига

  • Провайдер it999f с источником из файла it999.xml.gz:
    {"id":"it999f", "file":"it999.xml.gz"}
  • Провайдер it999u с источником из ссылки https://epg.it999.ru/epg.xml.gz, при автоматическом сопоставлении каналов, будет одним из первых:
    {"id":"it999u", "order":10, "urls": ["https://epg.it999.ru/epg.xml.gz", "http://epg.it999.ru/epg.xml.gz"]}
  • Провайдер lightiptv с источником из ссылки https://epg.lightiptv.cc/epg.xml.gz, загрузка из файла не будет использована, тк свойство записано как _file:
    {"id":"lightiptv", "_file":"lightiptv.xml.gz", "urls": ["https://epg.lightiptv.cc/epg.xml.gz", "http://epg.lightiptv.cc/epg.xml.gz"] }
  • Провайдер iptvx.one с источником из StdIn, также будет автоматически определяться у клиентов ottg.tv:
      {"id":"iptvx.one", "file":"-", "urls": ["https://iptvx.one/EPG", "https://ottg.tv/epg.xml.gz"]}

Примеры запуска

### Создать EPG для провайдера it999 из конфиг файла sample_config.json:
  ott-play-epg-converter -c sample_config.json,it999
### Создать EPG для провайдера intest из конфиг файла sample_config.json:
  zcat somepg.xml.gz | ott-play-epg-converter -c sample_config.json,intest
### Создать EPG для всех провайдеров из конфиг файла sample_config.json:
  ott-play-epg-converter -c sample_config.json
### Другие примеры:
  cat epgone.xml | ott-play-epg-converter -c sample_config.json,intest
  curl --silent http://prov.host/epg.xml.gz | gzip -d -c - | ott-play-epg-converter -c sample_config.json,intest
  curl --silent --compressed http://prov.host/epg.xml | ott-play-epg-converter -c sample_config.json,intest
  ...
  ott-play-epg-converter -c sample_config.json,it999

Prebuild

Готовые бинарники я компилирую для Windows (x64, x86)/Linux (x64, arm64, arm7a-soft-float, arm7-hard-float)
Иногда буду добавлять версии для Android (arm64, arm7a-soft-float)
В теории можно завести на всем, что поддерживает GO и кросс-компил, но сборкой придется заняться самостоятельно.

Бенчмарки

В файле benchmarks.md есть немного тестов EPG от it999 на различных платформах.

Similar Resources

Notifie Server is a learning list notifier

Notifie Server Notifie Server is a learning list notifier. E.g; If you want to l

Dec 24, 2021

A brief demo of real-time plotting with Plotly, Go, and server-sent events

A brief demo of real-time plotting with Plotly, Go, and server-sent events

Golang SSE Demo A brief demo of real-time plotting with Plotly, Go, and server-side events. Overview I first learned about Server-Sent Events from @mr

Nov 28, 2022

Database security suite. Database proxy with field-level encryption, search through encrypted data, SQL injections prevention, intrusion detection, honeypots. Supports client-side and proxy-side ("transparent") encryption. SQL, NoSQL.

Database security suite. Database proxy with field-level encryption, search through encrypted data, SQL injections prevention, intrusion detection, honeypots. Supports client-side and proxy-side (

Database protection suite with field level encryption and intrusion detection. | Acra Engineering Examples | Documentation | Installation | Examples a

Dec 28, 2022

☄ The golang convenient converter supports Database to Struct, SQL to Struct, and JSON to Struct.

☄ The golang convenient converter supports Database to Struct, SQL to Struct, and JSON to Struct.

Gormat - Cross platform gopher tool The golang convenient converter supports Database to Struct, SQL to Struct, and JSON to Struct. 中文说明 Features Data

Dec 20, 2022

Universal JSON, BSON, YAML, CSV, XML converter with templates

Universal JSON, BSON, YAML, CSV, XML converter with templates

Universal JSON, BSON, YAML, CSV, XML translator to ANY format using templates Key features Various input formats (json, bson, yaml, csv, xml) Flexible

Dec 11, 2022

Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices.

Homepage Download Blog/News @uniqush Introduction Uniqush (\ˈyü-nə-ku̇sh\ "uni" pronounced as in "unified", and "qush" pronounced as in "cushion") is

Jan 9, 2023

SSRFuzz is a tool to find Server Side Request Forgery vulnerabilities, with CRLF chaining capabilities

SSRFuzz is a tool to find Server Side Request Forgery vulnerabilities, with CRLF chaining capabilities Why?

Dec 8, 2022

A game server side framework with both web API and realtime communication.

HAYABUSA Framework Hayabusa is a server side framework for Japan-like social games. Easy to understand and use for beginners Powerful controller, flex

May 21, 2022

The server-side reproduction, similar the one of https://popcat.click, improve the performance and speed.

PopCat Echo The server-side reproduction, similar the one of https://popcat.click, improve the performance and speed. Docker Image The docker image is

Dec 15, 2022

Server side for goyotashi

Server side for goyotashi

goyotashi クライアントサイドはこちら 製品概要 グループでよく行く飲食店のリストを共有する eat*Tech(消費者の食行動*Tech)SNS 「goyotashi」 背景(製品開発のきっかけ、課題等) グループや個人で飲食店に行くとき、「どこでもいい」と言いながら決まらないという面倒な問

May 1, 2022

Server and relay side infrastructure for RDA

BitterJohn Server and relay side infrastructure for RDA. Usage install sudo ./BitterJohn install -g systemctl enable --now BitterJohn upgrade sudo ./B

Dec 14, 2022

Generate Server and Client side code

Additional Information Generate Server and Client side code Pre-generated stub file is included in the go project. If you need to generate the stub fi

Nov 6, 2021

HLive is a server-side WebSocket based dynamic template-less view layer for Go.

HLive is a server-side WebSocket based dynamic template-less view layer for Go.

HLive HLive is a server-side WebSocket based dynamic template-less view layer for Go. HLive is a fantastic tool for creating complex and dynamic brows

Jan 8, 2023

A Golang localhost TLS Server for testing Mutual Authentication (A.K.A Client-Side Authentication)

goMutualAuthServer goMutualAuthServer implements a localhost TLS server in Golang, which can be used to perform Mutual Authentication (A.K.A Client-Si

Dec 23, 2021

Embedded javascript server-side renderer for Golang

v8ssr Embedded javascript server-side renderer for Golang. Useful for static server-side rendering. This does not attempt to polyfill node or browser

Aug 27, 2022

:exclamation:Basic Assertion Library used along side native go testing, with building blocks for custom assertions

Package assert Package assert is a Basic Assertion library used along side native go testing Installation Use go get. go get github.com/go-playground/

Jan 6, 2023

Generate a basic IAM policy from AWS client-side monitoring (CSM)

Generate a basic IAM policy from AWS client-side monitoring (CSM)

iamlive Generate a basic IAM policy from AWS client-side monitoring (CSM) Installation Pre-built binaries Pre-built binaries for Windows, macOS and Li

Jan 8, 2023

A Go client implementing a client-side distributed consumer group client for Amazon Kinesis.

A Go client implementing a client-side distributed consumer group client for Amazon Kinesis.

Kinesumer is a Go client implementing a client-side distributed consumer group client for Amazon Kinesis.

Jan 5, 2023

Client-Side Load Balancing for Golang

cslb Client-Side Load Balancer This Project is in early developing state Feature Multiple client-side load balancing solutions support Round-Robin DNS

Aug 29, 2022
Arjuns-urgent-notification-backend - A simple Golang app that handles form JSON POST requests

Arjun's Urgent Notification Backend This is intended to let people urgently noti

Jan 7, 2022
Scalable real-time messaging server in language-agnostic way
Scalable real-time messaging server in language-agnostic way

Centrifugo is a scalable real-time messaging server in language-agnostic way. Centrifugo works in conjunction with application backend written in any

Jan 2, 2023
golang long polling library. Makes web pub-sub easy via HTTP long-poll server :smiley: :coffee: :computer:
golang long polling library.  Makes web pub-sub easy via HTTP long-poll server :smiley: :coffee: :computer:

golongpoll Golang long polling library. Makes web pub-sub easy via an HTTP long-poll server. New in v1.1 Deprecated CreateManager and CreateCustomMana

Jan 6, 2023
Golang push server cluster
Golang push server cluster

gopush-cluster gopush-cluster is a go push server cluster. Features light weight high performance pure golang implementation message expired offline m

Dec 28, 2022
A push notification server written in Go (Golang).
A push notification server written in Go (Golang).

gorush A push notification micro server using Gin framework written in Go (Golang) and see the demo app. Contents gorush Contents Support Platform Fea

Jan 8, 2023
websocket based messaging server written in golang

Guble Messaging Server Guble is a simple user-facing messaging and data replication server written in Go. Overview Guble is in an early state (release

Oct 19, 2022
Server-sent live updates: protocol and reference implementation
Server-sent live updates: protocol and reference implementation

Protocol and Reference Implementation Mercure is a protocol allowing to push data updates to web browsers and other HTTP clients in a convenient, fast

Jan 1, 2023
⚡️ A lightweight service that will build and store your go projects binaries, Integrated with Github, Gitlab, Bitbucket and Bitbucket Server.
⚡️ A lightweight service that will build and store your go projects binaries, Integrated with Github, Gitlab, Bitbucket and  Bitbucket Server.

Rabbit A lightweight service that will build and store your go projects binaries. Rabbit is a lightweight service that will build and store your go pr

Nov 19, 2022
High-Performance server for NATS, the cloud native messaging system.
High-Performance server for NATS, the cloud native messaging system.

NATS is a simple, secure and performant communications system for digital systems, services and devices. NATS is part of the Cloud Native Computing Fo

Jan 2, 2023
NanoMDM is a minimalist Apple MDM server heavily inspired by MicroMDM

NanoMDM NanoMDM is a minimalist Apple MDM server heavily inspired by MicroMDM. Getting started & Documentation Quickstart A quick guide to get NanoMDM

Dec 28, 2022