2018-01-01 17:28:19 +03:00
|
|
|
""" Common elements module """
|
|
|
|
|
from collections import namedtuple
|
2017-10-10 14:13:35 +03:00
|
|
|
from enum import Enum
|
|
|
|
|
|
2018-01-01 23:42:40 +03:00
|
|
|
Service = namedtuple("Service", ["flags_cas", "transponder_type", "coded", "service", "locked", "hide",
|
2018-01-01 17:28:19 +03:00
|
|
|
"package", "service_type", "ssid", "freq", "rate", "pol", "fec",
|
|
|
|
|
"system", "pos", "data_id", "fav_id", "transponder"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ***************** Bouquets *******************#
|
|
|
|
|
|
|
|
|
|
class BqServiceType(Enum):
|
|
|
|
|
DEFAULT = "DEFAULT"
|
|
|
|
|
IPTV = "IPTV"
|
|
|
|
|
MARKER = "MARKER" # 64
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bouquet = namedtuple("Bouquet", ["name", "type", "services"])
|
|
|
|
|
Bouquets = namedtuple("Bouquets", ["name", "type", "bouquets"])
|
|
|
|
|
BouquetService = namedtuple("BouquetService", ["name", "type", "data", "num"])
|
|
|
|
|
|
|
|
|
|
# ***************** Satellites *******************#
|
|
|
|
|
|
|
|
|
|
Satellite = namedtuple("Satellite", ["name", "flags", "position", "transponders"])
|
|
|
|
|
|
|
|
|
|
Transponder = namedtuple("Transponder", ["frequency", "symbol_rate", "polarization", "fec_inner",
|
|
|
|
|
"system", "modulation", "pls_mode", "pls_code", "is_id"])
|
|
|
|
|
|
2017-10-10 14:13:35 +03:00
|
|
|
|
|
|
|
|
class Type(Enum):
|
|
|
|
|
""" Types of DVB transponders """
|
|
|
|
|
Satellite = "s"
|
|
|
|
|
Terestrial = "t"
|
|
|
|
|
Cable = "c"
|
|
|
|
|
|
|
|
|
|
|
2017-11-23 16:59:21 +03:00
|
|
|
class FLAG(Enum):
|
|
|
|
|
""" Service flags """
|
2017-12-24 16:43:05 +03:00
|
|
|
KEEP = 1 # Do not automatically update the services parameters.
|
|
|
|
|
HIDE = 2
|
|
|
|
|
PIDS = 4 # Always use the cached instead of current pids.
|
|
|
|
|
LOCK = 8
|
|
|
|
|
NEW = 40 # Marked as new at the last scan
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def hide_values():
|
|
|
|
|
return 2, 3, 6, 7, 10, 42, 43, 46, 47
|
2017-11-23 16:59:21 +03:00
|
|
|
|
|
|
|
|
|
2017-10-20 14:45:51 +03:00
|
|
|
POLARIZATION = {"0": "H", "1": "V", "2": "L", "3": "R"}
|
2017-10-10 14:13:35 +03:00
|
|
|
|
2017-10-20 14:45:51 +03:00
|
|
|
PLS_MODE = {"0": "Root", "1": "Gold", "2": "Combo"}
|
2017-10-10 14:13:35 +03:00
|
|
|
|
2017-11-17 15:20:17 +03:00
|
|
|
FEC = {"0": "Auto", "1": "1/2", "2": "2/3",
|
|
|
|
|
"3": "3/4", "4": "5/6", "5": "7/8",
|
|
|
|
|
"6": "8/9", "7": "3/5", "8": "4/5",
|
|
|
|
|
"9": "9/10", "15": None}
|
2017-10-10 14:13:35 +03:00
|
|
|
|
2017-10-20 14:45:51 +03:00
|
|
|
SYSTEM = {"0": "DVB-S", "1": "DVB-S2"}
|
2017-10-10 14:13:35 +03:00
|
|
|
|
2017-10-20 14:45:51 +03:00
|
|
|
MODULATION = {"0": "Auto", "1": "QPSK", "2": "8PSK", "3": "16APSK", "5": "32APSK"}
|
2017-10-10 14:13:35 +03:00
|
|
|
|
2017-10-26 16:23:05 +03:00
|
|
|
SERVICE_TYPE = {"-2": "Unknown", "1": "TV", "2": "Radio", "3": "Data",
|
|
|
|
|
"10": "Radio", "12": "Data", "22": "TV", "25": "TV (HD)",
|
|
|
|
|
"136": "Data", "139": "Data"}
|
2017-11-21 23:48:30 +03:00
|
|
|
|
2017-12-06 18:14:37 +03:00
|
|
|
CAS = {"C:2600": "BISS", "C:0b00": "Conax", "C:0b01": "Conax", "C:0b02": "Conax", "C:0baa": "Conax", "C:0602": "Irdeto",
|
2017-11-23 16:59:21 +03:00
|
|
|
"C:0604": "Irdeto", "C:0606": "Irdeto", "C:0608": "Irdeto", "C:0622": "Irdeto", "C:0626": "Irdeto",
|
|
|
|
|
"C:0664": "Irdeto", "C:0614": "Irdeto", "C:0692": "Irdeto", "C:1801": "Nagravision", "C:0500": "Viaccess",
|
2017-12-06 18:14:37 +03:00
|
|
|
"C:0E00": "PowerVu", "C:4ae0": "DRE-Crypt", "C:4ae1": "DRE-Crypt", "C:7be1": "DRE-Crypt"}
|
2018-01-02 17:38:01 +03:00
|
|
|
|
|
|
|
|
# 'on' attribute 0070(hex) = 112(int) = ONID(ONID-TID on www.lyngsat.com)
|
|
|
|
|
PROVIDER = {112: "HTB+", 253: "Tricolor TV"}
|