from Components.ServiceEventTracker import ServiceEventTracker
from Components.Sources.List import List
from Plugins.Plugin import PluginDescriptor
from Screens.InputBox import InputBox
import os
import socket
from urllib2 import urlopen, Request, URLError, HTTPError
from xml.etree.cElementTree import fromstring, ElementTree
from enigma import iPlayableService, eDVBDB, eTimer, eConsoleAppContainer, ePicLoad, loadPNG, loadJPG
from Screens.Screen import Screen
from Screens.ChoiceBox import ChoiceBox
from Screens.MessageBox import MessageBox
import re, urllib, urllib2, cookielib, time
from twisted.web import client
from twisted.web.client import downloadPage, getPage
from Components.Button import Button
from Components.Sources.StaticText import StaticText
from Components.ActionMap import NumberActionMap, ActionMap
from Components.FileList import FileList, FileEntryComponent
from Components.MenuList import MenuList
# from Components.Pixmap import Pixmap, MovingPixmap
# from Components.AVSwitch import AVSwitch
from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
# from Tools.LoadPixmap import LoadPixmap
from Components.ActionMap import *
from Components.Label import Label
from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmap, MultiContentEntryPixmapAlphaTest
# from Screens.InfoBarGenerics import *
# from Screens.InfoBar import MoviePlayer, InfoBar
# from Screens.InfoBarGenerics import InfoBarNotifications
from string import find
from Components.config import *
from Components.ConfigList import ConfigList, ConfigListScreen
from Components.config import config, ConfigSubsection, ConfigText, getConfigListEntry, ConfigSelection, ConfigPIN, ConfigDirectory, ConfigYesNo
from enigma import eListboxPythonMultiContent, eListbox, gFont, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER, RT_WRAP, RT_VALIGN_CENTER
from enigma import getDesktop, eServiceReference, iServiceInformation
from Components.PluginComponent import plugins
from Screens.Console import Console
from urllib import urlencode
import sha
from httplib import HTTP
from urlparse import urlparse
import StringIO
import httplib
from Tools.Directories import fileExists, resolveFilename, SCOPE_PLUGINS, pathExists
Version = 'FreeCCcam V1.4 (modded)'
dwidth = getDesktop(0).size().width()
wsize = getDesktop(0).size().width()
hsize = getDesktop(0).size().height()
UserAgent = {'Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.0.15) Gecko/2009102815 Ubuntu/9.04 (jaunty) Firefox/3.'}
config.plugins.Weather = ConfigSubsection()
config.plugins.Weather.name = ConfigText(default='', fixed_size=False)
Agent = {'User-agent': 'Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.0.15) Gecko/2009102815 Ubuntu/9.04 (jaunty) Firefox/3.',
'Connection': 'Close'}
Agent0 = {'User-Agent': 'Mozilla/5.0',
'Accept': 'text/html'}
Lien1 = 'http://www.fcccam.com/free.php'
Lien1 = 'http://cccamgenerador.com/gratis/get2.php'
Lien2 = 'http://freeccamserver.com/free/get2.php'
Lien3 = 'http://cccamgood.com/free/get2.php'
Lien4 = 'http://cccamspot.com/spot/get.php'
Lien5 = 'http://cccammania.com/free4/get2.php'
Lien6 = 'http://cccam-free2.com/free2/get.php'
Lien7 = 'http://free-cccam.com/freecccam/get.php'
Lien8 = 'http://powerfullcccam.com/powerfull/get.php'
Lien9 = 'http://free-cccam.com/freecccam/get.php'
Lien10 = 'http://powerfullcccam.com/powerfull/get.php'
Lien11 = 'http://www.testious.com/'
class m2list(MenuList):
def __init__(self, list):
MenuList.__init__(self, list, False, eListboxPythonMultiContent)
self.l.setFont(0, gFont('Regular', 14))
self.l.setFont(1, gFont('Regular', 16))
self.l.setFont(2, gFont('Regular', 18))
self.l.setFont(3, gFont('Regular', 20))
self.l.setFont(4, gFont('Regular', 22))
self.l.setFont(5, gFont('Regular', 24))
self.l.setFont(6, gFont('Regular', 26))
self.l.setFont(7, gFont('Regular', 28))
self.l.setFont(8, gFont('Regular', 30))
def show_listiptv(h, p, u, pw):
print h, p, u, pw
if dwidth == 1280:
res = [(h,
p,
u,
pw)]
if 'Free Server Cccam' in h:
res.append(MultiContentEntryText(pos=(2, 2), size=(425, 31), font=5, text=h, backcolor_sel=26214, backcolor=22503, flags=RT_HALIGN_CENTER))
return res
else:
res.append(MultiContentEntryText(pos=(2, 2), size=(425, 31), font=5, text=h, backcolor_sel=26214, backcolor=1090519040, flags=RT_HALIGN_CENTER))
return res
else:
res = [(h,
p,
u,
pw)]
if 'Free Server Cccam' in h:
res.append(MultiContentEntryText(pos=(2, 2), size=(600, 31), font=7, text=h, backcolor_sel=26214, backcolor=22503, flags=RT_HALIGN_CENTER))
return res
res.append(MultiContentEntryText(pos=(2, 2), size=(600, 31), font=7, text=h, backcolor_sel=26214, backcolor=1090519040, flags=RT_HALIGN_CENTER))
return res
class LiseScreencccam(Screen):
skinfhd = ' '
skinhd = ' '
def __init__(self, session, args = 0):
Screen.__init__(self, session)
if dwidth == 1280:
self.skin = LiseScreencccam.skinhd
else:
self.skin = LiseScreencccam.skinfhd
self['actions'] = ActionMap(['OkCancelActions',
'MenuActions',
'ColorActions',
'DirectionActions',
'SetupActions',
'MovieSelectionActions'], {'cancel': self.End,
'ok': self.Choice_Cccam,
'up': self.up,
'down': self.down,
'left': self.left,
'green': self.Wicardd,
'1': self.Cccam,
'menu': self.initial,
'2': self.Doscam,
'3': self.Gcam,
'yellow': self.Ncam,
'blue': self.Oscam,
'right': self.right}, -1)
self['EPGSelectActions'] = HelpableActionMap(self, 'EPGSelectActions', {'nextBouquet': self.switchList,
'prevBouquet': self.switchList}, -1)
self.List = []
self.letter_list = []
self['List'] = m2list([])
self.ProgramTv = []
self.letter_list2 = []
self['ProgramTv'] = m2list([])
self.currentList = 'ProgramTv'
self['ProgramTv'].selectionEnabled(0)
self['info'] = Label()
self['info'].setText('....')
self['infoserver'] = Label()
self['infoserver'].setText('....')
self.updateTimer = eTimer()
self.list_iptv1(Lien1)
self.list_iptv1(Lien2)
self.list_iptv1(Lien3)
self.list_iptv1(Lien4)
self.list_iptv1(Lien5)
self.list_iptv1(Lien6)
self.list_iptv1(Lien7)
self.list_iptv1(Lien8)
self.list_iptv1(Lien9)
self.list_iptv(Lien10)
self.list_iptv(Lien11)
def list_iptv1(self, main_url):
getPage(main_url, method='GET', headers=Agent).addCallback(self.load_iptv1, main_url)
def load_iptv1(self, data, main_url):
url1 = re.findall('
C: (.*?) (.*?) (.*?) (.*?).*?\n', data)
for h, p, u, pw in url1:
if 'cccamspot' in h:
self.letter_list.append(show_listiptv(h, p, u, 'cccamspot.com'))
if 'free2.cccam-free2.com' in h:
self.letter_list.append(show_listiptv(h, p, u, 'cccam-free2.com'))
elif 'fr.free-cccam.com' in h:
self.letter_list.append(show_listiptv(h, p, u, 'free-cccam.com'))
elif 's2.cccam-free.com' in h or 's3.cccam-free.com' in h:
self.letter_list.append(show_listiptv(h, p, u, 'cccam-free.com'))
elif 's4.powerfullcccam.com' in h:
self.letter_list.append(show_listiptv(h, p, u, 'powerfullcccam.com'))
else:
self.letter_list.append(show_listiptv(h, p, u, 'free'))
self['List'].l.setList(self.letter_list)
self['List'].l.setItemHeight(31)
condt0 = len(self.letter_list)
self['info'].setText(str(condt0) + '_Gift_Server')
# Lien = 'http://www.testious.com/'
# self.list_iptv(Lien)
def list_iptv(self, main_url):
getPage(main_url, method='GET', headers=Agent).addCallback(self.load_iptv, main_url)
def load_iptv(self, data, main_url):
url1 = re.findall('Free CCcam servers', data)
URL = url1[0]
self.list_cccam(URL)
def list_cccam(self, url):
getPage(url, method='GET', headers=Agent).addCallback(self.load_cccam, url)
def load_cccam(self, data, url):
url1 = re.findall('C: (.*?) (.*?) (.*?) (.*?) # .*?', data)
Nmb = len(url1)
self['infoserver'].setText(str(Nmb) + '__Free Server Cccam')
# self.letter_list2.append(show_listiptv(str(Nmb) + '__Free Server Cccam', '', '', ''))
for h, p, u, pw in url1:
self.letter_list2.append(show_listiptv(h, p, u, pw))
self['ProgramTv'].l.setList(self.letter_list2)
self['ProgramTv'].l.setItemHeight(31)
def Choice_Cccam(self):
if self.currentList == 'ProgramTv':
if 'Free Server Cccam' in self['ProgramTv'].getCurrent()[0][0]:
pass
else:
host = self['ProgramTv'].getCurrent()[0][0]
port = self['ProgramTv'].getCurrent()[0][1]
user = self['ProgramTv'].getCurrent()[0][2]
pasw = self['ProgramTv'].getCurrent()[0][3]
self.letter_list.append(show_listiptv(host, port, user, pasw))
self['List'].l.setList(self.letter_list)
self['List'].l.setItemHeight(31)
condt0 = len(self.letter_list)
self['info'].setText(str(condt0) + '_Server')
else:
Refc = self['List'].getSelectionIndex()
condt = len(self.letter_list)
if Refc == 0 and condt == 1:
del self.letter_list[Refc]
self['info'].setText('.....')
self['List'].selectionEnabled(0)
self['ProgramTv'].selectionEnabled(1)
self.currentList = 'ProgramTv'
if Refc == 0 and condt > 1:
del self.letter_list[0]
self['List'].l.setList(self.letter_list)
self['List'].l.setItemHeight(31)
self['List'].moveToIndex(0)
self['info'].setText(str(condt - 1) + '_Server')
if Refc != 0 and condt > 1:
del self.letter_list[Refc]
self['List'].l.setList(self.letter_list)
self['List'].l.setItemHeight(31)
self['List'].moveToIndex(Refc - 1)
self['info'].setText(str(condt - 1) + '_Server')
def switchList(self):
if self.currentList == 'List':
self['List'].selectionEnabled(1)
self['ProgramTv'].selectionEnabled(1)
self.currentList = 'ProgramTv'
else:
self['ProgramTv'].selectionEnabled(1)
self['List'].selectionEnabled(1)
self.currentList = 'List'
# def switchList(self):
# if self.currentList == 'List':
# self['List'].selectionEnabled(0)
# self['ProgramTv'].selectionEnabled(1)
# self.currentList = 'ProgramTv'
# else:
# self['ProgramTv'].selectionEnabled(0)
# self['List'].selectionEnabled(1)
# self.currentList = 'List'
def up(self):
self[self.currentList].up()
self.updateTimer.stop()
def down(self):
self[self.currentList].down()
self.updateTimer.stop()
def left(self):
self[self.currentList].pageUp()
self.updateTimer.stop()
def right(self):
self[self.currentList].pageDown()
self.updateTimer.stop()
def initial(self):
self.List = []
self.letter_list = []
import shutil
shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/config/wicardd.conf', '/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/wicardd.conf')
shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/config/ncam.server', '/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/ncam.server')
shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/config/CCcam.cfg', '/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/CCcam.cfg')
shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/config/oscam.server', '/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/oscam.server')
shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/config/oscam.server', '/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/doscam.cfg')
shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/config/gcam.server', '/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/gcam.server')
self['info'].setText('.....')
self['List'].l.setList(self.letter_list)
self['List'].l.setItemHeight(31)
self.list_iptv1(Lien1)
self.list_iptv1(Lien2)
self.list_iptv1(Lien3)
self.list_iptv1(Lien4)
self.list_iptv1(Lien5)
self.list_iptv1(Lien6)
self.list_iptv1(Lien7)
self.list_iptv1(Lien8)
self.list_iptv1(Lien9)
self.list_iptv(Lien10)
self.list_iptv(Lien11)
self.session.open(MessageBox, 'Erase servers', type=MessageBox.TYPE_INFO, timeout=8)
def End(self):
self.close()
def Wicardd(self):
import shutil
Imp = len(self.letter_list)
if Imp == 0:
self.session.open(MessageBox, 'Empty list', type=MessageBox.TYPE_INFO, timeout=8)
else:
self['ProgramTv'].selectionEnabled(0)
self['List'].selectionEnabled(1)
self.currentList = 'List'
for x in range(Imp):
try:
self['List'].moveToIndex(x)
host = self['List'].getCurrent()[0][0]
port = self['List'].getCurrent()[0][1]
user = self['List'].getCurrent()[0][2]
pasw = self['List'].getCurrent()[0][3]
if fileExists('/usr/cfmngr/wicardd/wicardd.conf'):
Dist = '/usr/cfmngr/wicardd/wicardd.conf'
elif fileExists('/etc/tuxbox/config/wicardd.conf'):
Dist = '/etc/tuxbox/config/wicardd.conf'
elif fileExists('/usr/keys/wicardd.conf'):
Dist = '/usr/keys/wicardd.conf'
elif fileExists('/var/tuxbox/config/wicardd.conf'):
Dist = '/var/tuxbox/config/wicardd.conf'
else:
shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/wicardd.conf', '/etc/tuxbox/config/wicardd.conf')
Dist = '/etc/tuxbox/config/wicardd.conf'
fichier = open(Dist, 'a')
#fichier = open('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/wicardd.conf', 'a')
fichier.write('\n[reader]\nname= server_' + str(x) + '\nactive= 1\ntype= cccam\naccount=' + user + ':' + pasw + '@' + host + ':' + port + '\ndebug = 1\nreconnect_delay = 1\nemm_cache = 1\necm_ttl = 15000\nreconnect_to_account_ip =1\n\n')
fichier.close()
except IndexError:
pass
# Dist = '/etc/tuxbox/config/wicardd.conf'
# shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/wicardd.conf', '/etc/tuxbox/config/wicardd.conf')
self.session.open(MessageBox, str(Imp) + '_Server Copy/in ' + Dist, type=MessageBox.TYPE_INFO, timeout=8)
self['ProgramTv'].selectionEnabled(1)
self['List'].selectionEnabled(0)
self.currentList = 'ProgramTv'
def Oscam(self):
import shutil
Imp = len(self.letter_list)
if Imp == 0:
self.session.open(MessageBox, 'Empty list', type=MessageBox.TYPE_INFO, timeout=8)
else:
self['ProgramTv'].selectionEnabled(0)
self['List'].selectionEnabled(1)
self.currentList = 'List'
for x in range(Imp):
try:
self['List'].moveToIndex(x)
host = self['List'].getCurrent()[0][0]
port = self['List'].getCurrent()[0][1]
user = self['List'].getCurrent()[0][2]
pasw = self['List'].getCurrent()[0][3]
if fileExists('/etc/tuxbox/config/oscam.server'):
Dist = '/etc/tuxbox/config/oscam.server'
elif fileExists('/usr/keys/oscam_atv_ymod/oscam.server'):
Dist = '/usr/keys/oscam_atv_ymod/oscam.server'
elif fileExists('/usr/keys/oscam.server'):
Dist = '/usr/keys/oscam.server'
elif fileExists('/var/keys/oscam.server'):
Dist = '/var/keys/oscam.server'
else:
shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/oscam.server', '/etc/tuxbox/config/oscam.server' )
Dist = '/etc/tuxbox/config/oscam.server'
fichier = open(Dist, 'a')
#fichier = open('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/oscam.server', 'a')
fichier.write('\n[reader]\nlabel = Server_' + str(x) + '\nenable= 1\nprotocol = cccam\ndevice = ' + host + ',' + port + '\nuser = ' + user + '\npassword = ' + pasw + '\ninactivitytimeout = 30\ngroup = 3\ncccversion = 2.2.1\ncccmaxhops = 0\nccckeepalive = 1\naudisabled = 1\n\n')
fichier.close()
except IndexError:
pass
# Dist = '/etc/tuxbox/config/oscam.server'
# shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/oscam.server', Dist)
self.session.open(MessageBox, str(Imp) + '_Server Copy/in ' + Dist, type=MessageBox.TYPE_INFO, timeout=8)
self['ProgramTv'].selectionEnabled(1)
self['List'].selectionEnabled(0)
self.currentList = 'ProgramTv'
def Doscam(self):
import shutil
Imp = len(self.letter_list)
if Imp == 0:
self.session.open(MessageBox, 'Empty list', type=MessageBox.TYPE_INFO, timeout=8)
else:
self['ProgramTv'].selectionEnabled(0)
self['List'].selectionEnabled(1)
self.currentList = 'List'
for x in range(Imp):
try:
self['List'].moveToIndex(x)
host = self['List'].getCurrent()[0][0]
port = self['List'].getCurrent()[0][1]
user = self['List'].getCurrent()[0][2]
pasw = self['List'].getCurrent()[0][3]
if fileExists('/etc/tuxbox/config/doscam.cfg'):
Dist = '/etc/tuxbox/config/doscam.cfg'
elif fileExists('/usr/keys/doscam.cfg'):
Dist = '/usr/keys/doscam.cfg'
elif fileExists('/etc/tuxbox/doscam.config/doscam.cfg'):
Dist = '/etc/tuxbox/doscam.config/doscam.cfg'
elif fileExists('/etc/tuxbox/doscam.cfg'):
Dist = '/etc/tuxbox/doscam.cfg'
else:
shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/doscam.cfg', '/etc/tuxbox/doscam.cfg' )
Dist = '/etc/tuxbox/doscam.cfg'
fichier = open(Dist, 'a')
#fichier = open('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/doscam.vfg', 'a')
fichier.write('\n[reader]\nlabel = Server_' + str(x) + '\nenable= 1\nprotocol = cccam\ndevice = ' + host + ',' + port + '\nuser = ' + user + '\npassword = ' + pasw + '\ninactivitytimeout = 30\ngroup = 3\ncccversion = 2.2.1\ncccmaxhops = 0\nccckeepalive = 1\naudisabled = 1\n\n')
fichier.close()
except IndexError:
pass
# Dist = '/etc/tuxbox/config/doscam.cfg'
# shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/doscam.cfg', Dist)
self.session.open(MessageBox, str(Imp) + '_Server Copy/in ' + Dist, type=MessageBox.TYPE_INFO, timeout=8)
self['ProgramTv'].selectionEnabled(1)
self['List'].selectionEnabled(0)
self.currentList = 'ProgramTv'
def Gcam(self):
import shutil
Imp = len(self.letter_list)
if Imp == 0:
self.session.open(MessageBox, 'Empty list', type=MessageBox.TYPE_INFO, timeout=8)
else:
self['ProgramTv'].selectionEnabled(0)
self['List'].selectionEnabled(1)
self.currentList = 'List'
for x in range(Imp):
try:
self['List'].moveToIndex(x)
host = self['List'].getCurrent()[0][0]
port = self['List'].getCurrent()[0][1]
user = self['List'].getCurrent()[0][2]
pasw = self['List'].getCurrent()[0][3]
if fileExists('/etc/tuxbox/config/gcam.server'):
Dist = '/etc/tuxbox/config/gcam.server'
elif fileExists('/usr/keys/gcam.server'):
Dist = '/usr/keys/gcam.server'
elif fileExists('/var/keys/gcam.server'):
Dist = '/var/keys/gcam.server'
else:
shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/gcam.server', '/etc/tuxbox/config/gcam.server' )
Dist = '/etc/tuxbox/config/gcam.server'
fichier = open(Dist, 'a')
#fichier = open('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/gcam.server', 'a')
fichier.write('\n[reader]\nlabel = Server_' + str(x) + '\nenable= 1\nprotocol = cccam\ndevice = ' + host + ',' + port + '\nuser = ' + user + '\npassword = ' + pasw + '\ninactivitytimeout = 30\ngroup = 3\ncccversion = 2.2.1\ncccmaxhops = 0\nccckeepalive = 1\naudisabled = 1\n\n')
fichier.close()
except IndexError:
pass
# Dist = '/etc/tuxbox/config/gcam.server'
# shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/gcam.server', Dist)
self.session.open(MessageBox, str(Imp) + '_Server Copy/in ' + Dist, type=MessageBox.TYPE_INFO, timeout=8)
self['ProgramTv'].selectionEnabled(1)
self['List'].selectionEnabled(0)
self.currentList = 'ProgramTv'
def Cccam(self):
import shutil
Imp = len(self.letter_list)
if Imp == 0:
self.session.open(MessageBox, 'Empty list', type=MessageBox.TYPE_INFO, timeout=8)
else:
self['ProgramTv'].selectionEnabled(0)
self['List'].selectionEnabled(1)
self.currentList = 'List'
for x in range(Imp):
try:
self['List'].moveToIndex(x)
host = self['List'].getCurrent()[0][0]
port = self['List'].getCurrent()[0][1]
user = self['List'].getCurrent()[0][2]
pasw = self['List'].getCurrent()[0][3]
if fileExists('/etc/CCcam.cfg'):
Dist = '/etc/CCcam.cfg'
elif fileExists('/etc/tuxbox/config/CCcam.cfg'):
Dist = '/etc/tuxbox/config/CCcam.cfg'
elif fileExists('/usr/keys/CCcam.cfg'):
Dist = '/usr/keys/CCcam.cfg'
elif fileExists('/etc/keys/CCcam.cfg'):
Dist = '/etc/keys/CCcam.cfg'
else:
shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/CCcam.cfg', '/etc/CCcam.cfg')
Dist = '/etc/CCcam.cfg'
fichier = open(Dist, 'a')
#fichier = open('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/CCcam.cfg', 'a')
fichier.write('\n\nC: ' + host + ' ' + port + ' ' + user + ' ' + pasw)
fichier.close()
except IndexError:
pass
# Dist = '/etc/tuxbox/config/CCcam.cfg'
# shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/CCcam.cfg', '/etc/tuxbox/config/CCcam.cfg')
self.session.open(MessageBox, str(Imp) + '_Server Copy in ' + Dist, type=MessageBox.TYPE_INFO, timeout=8)
self['ProgramTv'].selectionEnabled(1)
self['List'].selectionEnabled(0)
self.currentList = 'ProgramTv'
def Ncam(self):
import shutil
Imp = len(self.letter_list)
if Imp == 0:
self.session.open(MessageBox, 'Empty list', type=MessageBox.TYPE_INFO, timeout=8)
else:
self['ProgramTv'].selectionEnabled(0)
self['List'].selectionEnabled(1)
self.currentList = 'List'
for x in range(Imp):
try:
self['List'].moveToIndex(x)
host = self['List'].getCurrent()[0][0]
port = self['List'].getCurrent()[0][1]
user = self['List'].getCurrent()[0][2]
pasw = self['List'].getCurrent()[0][3]
if fileExists('/etc/tuxbox/config/ncam.server'):
Dist = '/etc/tuxbox/config/ncam.server'
elif fileExists('/var/keys/ncam.server'):
Dist = '/var/keys/ncam.server'
elif fileExists('/usr/keys/ncam.server'):
Dist = '/usr/keys/ncam.server'
else:
shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/ncam.server', '/etc/tuxbox/config/ncam.server')
Dist = '/etc/tuxbox/config/ncam.server'
fichier = open(Dist, 'a')
#fichier = open('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/ncam.server', 'a')
fichier.write('\n[reader]\nlabel= server_' + str(x) + '\nenable= 1\nprotocol= cccam\ndevice=' + host + ',' + port + '\nuser=' + user + '\npassword=' + pasw + '\ngroup= 1\ncccversion= 2.0.11\ndisablecrccws_only_for= 0500:032830\ncccmaxhops= 1\nccckeepalive= 1\naudisabled= 1\n\n')
fichier.close()
except IndexError:
pass
#shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/ncam.server', '/etc/tuxbox/config/ncam.server')
#Dist = '/etc/tuxbox/config/ncam.server'
self.session.open(MessageBox, str(Imp) + '_Server Copy ' + Dist, type=MessageBox.TYPE_INFO, timeout=8)
self['ProgramTv'].selectionEnabled(1)
self['List'].selectionEnabled(0)
self.currentList = 'ProgramTv'
def main(session, **kwargs):
session.open(LiseScreencccam)
def menu(menuid, **kwargs):
if menuid == 'mainmenu':
return [(_('FreeCCcam-Modded'),
main,
'FreeCCcamMod',
44)]
return []
def Plugins(**kwargs):
return [PluginDescriptor(name='FreeCCcam Mod.', description=Version, where=[PluginDescriptor.WHERE_PLUGINMENU], icon='FreeCCcam.png', fnc=main), PluginDescriptor(name='FreeCCcamMod', description='FreeCCcamMod', where=[PluginDescriptor.WHERE_EXTENSIONSMENU], fnc=main)] #, PluginDescriptor(icon='FreeCCcam.png', name=_('FreeCCcam'), description=_('FreeCCcam'), where=PluginDescriptor.WHERE_MENU, fnc=menu)