Advertisement
mino60

Untitled

Nov 8th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 34.37 KB | None | 0 0
  1. from Components.ServiceEventTracker import ServiceEventTracker
  2. from Components.Sources.List import List
  3. from Plugins.Plugin import PluginDescriptor
  4. from Screens.InputBox import InputBox
  5. import os
  6. import socket
  7. from urllib2 import urlopen, Request, URLError, HTTPError
  8. from xml.etree.cElementTree import fromstring, ElementTree
  9. from enigma import iPlayableService, eDVBDB, eTimer, eConsoleAppContainer, ePicLoad, loadPNG, loadJPG
  10. from Screens.Screen import Screen
  11. from Screens.ChoiceBox import ChoiceBox
  12. from Screens.MessageBox import MessageBox
  13. import re, urllib, urllib2, cookielib, time
  14. from twisted.web import client
  15. from twisted.web.client import downloadPage, getPage
  16. from Components.Button import Button
  17. from Components.Sources.StaticText import StaticText
  18. from Components.ActionMap import NumberActionMap, ActionMap
  19. from Components.FileList import FileList, FileEntryComponent
  20. from Components.MenuList import MenuList
  21. # from Components.Pixmap import Pixmap, MovingPixmap
  22. # from Components.AVSwitch import AVSwitch
  23. from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
  24. # from Tools.LoadPixmap import LoadPixmap
  25. from Components.ActionMap import *
  26. from Components.Label import Label
  27. from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmap, MultiContentEntryPixmapAlphaTest
  28. # from Screens.InfoBarGenerics import *
  29. # from Screens.InfoBar import MoviePlayer, InfoBar
  30. # from Screens.InfoBarGenerics import InfoBarNotifications
  31. from string import find
  32. from Components.config import *
  33. from Components.ConfigList import ConfigList, ConfigListScreen
  34. from Components.config import config, ConfigSubsection, ConfigText, getConfigListEntry, ConfigSelection, ConfigPIN, ConfigDirectory, ConfigYesNo
  35. from enigma import eListboxPythonMultiContent, eListbox, gFont, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER, RT_WRAP, RT_VALIGN_CENTER
  36. from enigma import getDesktop, eServiceReference, iServiceInformation
  37. from Components.PluginComponent import plugins
  38. from Screens.Console import Console
  39. from urllib import urlencode
  40. import sha
  41. from httplib import HTTP
  42. from urlparse import urlparse
  43. import StringIO
  44. import httplib
  45. from Tools.Directories import fileExists, resolveFilename, SCOPE_PLUGINS, pathExists
  46.  
  47. Version = 'FreeCCcam V1.4 (modded)'
  48.  
  49. dwidth = getDesktop(0).size().width()
  50. wsize = getDesktop(0).size().width()
  51. hsize = getDesktop(0).size().height()
  52. UserAgent = {'Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.0.15) Gecko/2009102815 Ubuntu/9.04 (jaunty) Firefox/3.'}
  53. config.plugins.Weather = ConfigSubsection()
  54. config.plugins.Weather.name = ConfigText(default='', fixed_size=False)
  55. 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.',
  56.  'Connection': 'Close'}
  57. Agent0 = {'User-Agent': 'Mozilla/5.0',
  58.  'Accept': 'text/html'}
  59. Lien1 = 'http://www.fcccam.com/free.php'
  60. Lien1 = 'http://cccamgenerador.com/gratis/get2.php'
  61. Lien2 = 'http://freeccamserver.com/free/get2.php'
  62. Lien3 = 'http://cccamgood.com/free/get2.php'
  63. Lien4 = 'http://cccamspot.com/spot/get.php'
  64. Lien5 = 'http://cccammania.com/free4/get2.php'
  65. Lien6 = 'http://cccam-free2.com/free2/get.php'
  66. Lien7 = 'http://free-cccam.com/freecccam/get.php'
  67. Lien8 = 'http://powerfullcccam.com/powerfull/get.php'
  68. Lien9 = 'http://free-cccam.com/freecccam/get.php'
  69. Lien10 = 'http://powerfullcccam.com/powerfull/get.php'
  70. Lien11 = 'http://www.testious.com/'
  71.  
  72.  
  73.  
  74.  
  75.  
  76. class m2list(MenuList):
  77.  
  78.     def __init__(self, list):
  79.         MenuList.__init__(self, list, False, eListboxPythonMultiContent)
  80.         self.l.setFont(0, gFont('Regular', 14))
  81.         self.l.setFont(1, gFont('Regular', 16))
  82.         self.l.setFont(2, gFont('Regular', 18))
  83.         self.l.setFont(3, gFont('Regular', 20))
  84.         self.l.setFont(4, gFont('Regular', 22))
  85.         self.l.setFont(5, gFont('Regular', 24))
  86.         self.l.setFont(6, gFont('Regular', 26))
  87.         self.l.setFont(7, gFont('Regular', 28))
  88.         self.l.setFont(8, gFont('Regular', 30))
  89.  
  90.  
  91. def show_listiptv(h, p, u, pw):
  92.     print h, p, u, pw
  93.     if dwidth == 1280:
  94.         res = [(h,
  95.           p,
  96.           u,
  97.           pw)]
  98.         if 'Free Server Cccam' in h:
  99.             res.append(MultiContentEntryText(pos=(2, 2), size=(425, 31), font=5, text=h, backcolor_sel=26214, backcolor=22503, flags=RT_HALIGN_CENTER))
  100.             return res
  101.         else:
  102.             res.append(MultiContentEntryText(pos=(2, 2), size=(425, 31), font=5, text=h, backcolor_sel=26214, backcolor=1090519040, flags=RT_HALIGN_CENTER))
  103.             return res
  104.     else:
  105.         res = [(h,
  106.           p,
  107.           u,
  108.           pw)]
  109.         if 'Free Server Cccam' in h:
  110.             res.append(MultiContentEntryText(pos=(2, 2), size=(600, 31), font=7, text=h, backcolor_sel=26214, backcolor=22503, flags=RT_HALIGN_CENTER))
  111.             return res
  112.         res.append(MultiContentEntryText(pos=(2, 2), size=(600, 31), font=7, text=h, backcolor_sel=26214, backcolor=1090519040, flags=RT_HALIGN_CENTER))
  113.         return res
  114.  
  115.  
  116. class LiseScreencccam(Screen):
  117.     skinfhd = '<screen name="LiseScreencccam" position="0,0" size="1920,1064" title="" flags="wfNoBorder" backgroundColor="transparent">  <widget name="ProgramTv" zPosition="1" foregroundColorSelected="white" position="13,142" size="600,801" enableWrapAround="1" scrollbarMode="showNever" transparent="0" /><eLabel position="167,974" size="148,35" backgroundColor="#398564" /><eLabel position="322,974" size="148,35" backgroundColor="#ffcf40" /><eLabel position="468,975" size="148,35" backgroundColor="#222f5b" /><eLabel text="Wicardd" zPosition="4" position="170,977" size="140,30" font="Regular; 25" transparent="0" backgroundColor="black" halign="center" /><eLabel text="Ncam" zPosition="4" position="325,976" size="140,30" font="Regular; 25" transparent="0" backgroundColor="black" halign="center" /><eLabel text="Oscam" zPosition="4" position="474,976" size="140,30" font="Regular; 25" transparent="0" backgroundColor="black" halign="center" /><eLabel position="17,975" size="148,35" backgroundColor="#a32020" /><eLabel text="1 CCcam" zPosition="4" position="29,977" size="132,30" font="Regular; 25" transparent="0" backgroundColor="black" halign="center" /><eLabel text="All files in   /etc/tuxbox/config" zPosition="4" position="15,1046" size="600,20" font="Regular; 22" transparent="0" backgroundColor="black" halign="center" /><widget name="List" zPosition="1" foregroundColorSelected="white" position="1286,176" size="600,801" enableWrapAround="1" scrollbarMode="showNever" transparent="0" /><eLabel text="OK to choose server" zPosition="4" position="12,945" size="600,25" font="Regular; 22" transparent="0" backgroundColor="black" halign="center" /><eLabel text="OK To Remove Server" zPosition="4" position="1286,1040" size="600,23" font="Regular; 22" transparent="0" backgroundColor="black" halign="center" /><eLabel text="List Of Choices" zPosition="4" position="1286,976" size="600,30" font="Regular; 22" transparent="0" backgroundColor="black" halign="center" /><widget name="info" position="1286,1008" zPosition="1" size="600,30" font="Regular;24" foregroundColor="#ffffff" transparent="0" halign="center" valign="center" backgroundColor="#000000" /><eLabel text="MENU Reset Server" zPosition="4" position="321,1013" size="294,31" font="Regular; 22" transparent="0" backgroundColor="black" halign="center" /><widget name="infoserver" position="72,114" zPosition="2" size="450,28" font="Regular;25" foregroundColor="#03396c" transparent="1" halign="center" valign="center" backgroundColor="black" /><eLabel text="2 Doscam" zPosition="4" position="30,1014" size="130,30" font="Regular; 20" transparent="0" backgroundColor="black" halign="center" /><eLabel position="17,1008" size="153,35" backgroundColor="#33ffff" /><eLabel text="3 Gcam" zPosition="4" position="177,1014" size="130,30" font="Regular; 20" transparent="0" backgroundColor="black" halign="center" /><eLabel position="169,1010" size="148,35" backgroundColor="#00cc33" /></screen>'
  118.     skinhd = '<screen name="LiseScreencccam" position="0,0" size="1284,720" title="" flags="wfNoBorder" backgroundColor="transparent">  <widget name="ProgramTv" zPosition="1" foregroundColorSelected="white" position="6,46" size="425,525" enableWrapAround="1" scrollbarMode="showNever" transparent="0" /><eLabel position="130,600" size="97,39" backgroundColor="#398564" /><eLabel position="229,600" size="99,39" backgroundColor="#ffcf40" /><eLabel position="328,600" size="102,39" backgroundColor="#222f5b" /><eLabel text="Wicardd" zPosition="4" position="133,604" size="90,28" font="Regular; 20" transparent="0" backgroundColor="black" halign="center" /><eLabel text="Ncam" zPosition="4" position="235,604" size="90,28" font="Regular; 20" transparent="0" backgroundColor="black" halign="center" /><eLabel text="Oscam" zPosition="4" position="335,604" size="90,28" font="Regular; 20" transparent="0" backgroundColor="black" halign="center" /><eLabel position="5,600" size="124,39" backgroundColor="#a32020" zPosition="3" /><eLabel text="1 CCcam" zPosition="4" position="29,604" size="90,28" font="Regular; 20" transparent="0" backgroundColor="black" halign="center" /><eLabel text="All files in   /etc/tuxbox/config" zPosition="4" position="6,679" size="425,26" font="Regular; 18" transparent="0" backgroundColor="black" halign="center" /><widget name="List" zPosition="1" foregroundColorSelected="white" position="841,46" size="425,525" enableWrapAround="1" scrollbarMode="showNever" transparent="0" /><eLabel text="List Of Choices" zPosition="4" position="842,576" size="425,30" font="Regular; 22" transparent="0" backgroundColor="black" halign="center" /><widget name="info" position="842,609" zPosition="1" size="425,30" font="Regular;24" foregroundColor="#ffffff" transparent="0" halign="center" valign="center" backgroundColor="#000000" /><eLabel text="OK To Remove Server" zPosition="4" position="842,638" size="425,25" font="Regular; 22" transparent="0" backgroundColor="black" halign="center" /><eLabel text="OK to choose server" zPosition="4" position="6,574" size="424,26" font="Regular; 19" transparent="0" backgroundColor="black" halign="center" valign="center" /><eLabel text="MENU Reset Server" zPosition="4" position="228,640" size="201,38" font="Regular; 19" transparent="0" backgroundColor="black" halign="center" valign="center" /><widget name="infoserver" position="7,18" zPosition="2" size="425,28" font="Regular;25" foregroundColor="#03396c" transparent="1" halign="center" valign="center" backgroundColor="black" /><eLabel text="2 Doscam" zPosition="4" position="30,644" size="90,28" font="Regular; 18" transparent="0" backgroundColor="black" halign="center" /><eLabel position="6,639" size="122,39" backgroundColor="#33ffff" /><eLabel text="3 Gcam" zPosition="4" position="132,644" size="90,28" font="Regular; 18" transparent="0" backgroundColor="black" halign="center" /><eLabel position="129,638" size="97,39" backgroundColor="#00cc33" /></screen>'
  119.  
  120.     def __init__(self, session, args = 0):
  121.         Screen.__init__(self, session)
  122.         if dwidth == 1280:
  123.             self.skin = LiseScreencccam.skinhd
  124.         else:
  125.             self.skin = LiseScreencccam.skinfhd
  126.         self['actions'] = ActionMap(['OkCancelActions',
  127.          'MenuActions',
  128.          'ColorActions',
  129.          'DirectionActions',
  130.          'SetupActions',
  131.          'MovieSelectionActions'], {'cancel': self.End,
  132.          'ok': self.Choice_Cccam,
  133.          'up': self.up,
  134.          'down': self.down,
  135.          'left': self.left,
  136.          'green': self.Wicardd,
  137.          '1': self.Cccam,
  138.          'menu': self.initial,
  139.          '2': self.Doscam,
  140.          '3': self.Gcam,
  141.          'yellow': self.Ncam,
  142.          'blue': self.Oscam,
  143.          'right': self.right}, -1)
  144.         self['EPGSelectActions'] = HelpableActionMap(self, 'EPGSelectActions', {'nextBouquet': self.switchList,
  145.          'prevBouquet': self.switchList}, -1)
  146.         self.List = []
  147.         self.letter_list = []
  148.         self['List'] = m2list([])
  149.         self.ProgramTv = []
  150.         self.letter_list2 = []
  151.         self['ProgramTv'] = m2list([])
  152.         self.currentList = 'ProgramTv'
  153.         self['ProgramTv'].selectionEnabled(0)
  154.         self['info'] = Label()
  155.         self['info'].setText('....')
  156.         self['infoserver'] = Label()
  157.         self['infoserver'].setText('....')
  158.         self.updateTimer = eTimer()
  159.         self.list_iptv1(Lien1)
  160.         self.list_iptv1(Lien2)
  161.         self.list_iptv1(Lien3)
  162.         self.list_iptv1(Lien4)
  163.         self.list_iptv1(Lien5)
  164.         self.list_iptv1(Lien6)
  165.         self.list_iptv1(Lien7)
  166.         self.list_iptv1(Lien8)
  167.         self.list_iptv1(Lien9)
  168.         self.list_iptv(Lien10)
  169.         self.list_iptv(Lien11)        
  170.        
  171.     def list_iptv1(self, main_url):
  172.         getPage(main_url, method='GET', headers=Agent).addCallback(self.load_iptv1, main_url)
  173.  
  174.     def load_iptv1(self, data, main_url):
  175.         url1 = re.findall('<h1>C: (.*?) (.*?) (.*?) (.*?).*?\n', data)
  176.         for h, p, u, pw in url1:
  177.             if 'cccamspot' in h:
  178.                 self.letter_list.append(show_listiptv(h, p, u, 'cccamspot.com'))
  179.             if 'free2.cccam-free2.com' in h:
  180.                 self.letter_list.append(show_listiptv(h, p, u, 'cccam-free2.com'))
  181.             elif 'fr.free-cccam.com' in h:
  182.                 self.letter_list.append(show_listiptv(h, p, u, 'free-cccam.com'))
  183.             elif 's2.cccam-free.com' in h or 's3.cccam-free.com' in h:
  184.                 self.letter_list.append(show_listiptv(h, p, u, 'cccam-free.com'))
  185.             elif 's4.powerfullcccam.com' in h:
  186.                 self.letter_list.append(show_listiptv(h, p, u, 'powerfullcccam.com'))
  187.             else:
  188.                 self.letter_list.append(show_listiptv(h, p, u, 'free'))
  189.  
  190.         self['List'].l.setList(self.letter_list)
  191.         self['List'].l.setItemHeight(31)
  192.         condt0 = len(self.letter_list)
  193.         self['info'].setText(str(condt0) + '_Gift_Server')
  194.         # Lien = 'http://www.testious.com/'
  195.         # self.list_iptv(Lien)
  196.  
  197.     def list_iptv(self, main_url):
  198.         getPage(main_url, method='GET', headers=Agent).addCallback(self.load_iptv, main_url)
  199.  
  200.     def load_iptv(self, data, main_url):
  201.         url1 = re.findall('<a href="(.*?)">Free CCcam servers</a></li>', data)
  202.         URL = url1[0]
  203.         self.list_cccam(URL)
  204.  
  205.     def list_cccam(self, url):
  206.         getPage(url, method='GET', headers=Agent).addCallback(self.load_cccam, url)
  207.  
  208.     def load_cccam(self, data, url):
  209.         url1 = re.findall('C: (.*?) (.*?) (.*?) (.*?) # .*?', data)
  210.         Nmb = len(url1)
  211.         self['infoserver'].setText(str(Nmb) + '__Free Server Cccam')
  212. #        self.letter_list2.append(show_listiptv(str(Nmb) + '__Free Server Cccam', '', '', ''))
  213.         for h, p, u, pw in url1:
  214.             self.letter_list2.append(show_listiptv(h, p, u, pw))
  215.  
  216.         self['ProgramTv'].l.setList(self.letter_list2)
  217.         self['ProgramTv'].l.setItemHeight(31)
  218.  
  219.     def Choice_Cccam(self):
  220.         if self.currentList == 'ProgramTv':
  221.             if 'Free Server Cccam' in self['ProgramTv'].getCurrent()[0][0]:
  222.                 pass
  223.             else:
  224.                 host = self['ProgramTv'].getCurrent()[0][0]
  225.                 port = self['ProgramTv'].getCurrent()[0][1]
  226.                 user = self['ProgramTv'].getCurrent()[0][2]
  227.                 pasw = self['ProgramTv'].getCurrent()[0][3]
  228.                 self.letter_list.append(show_listiptv(host, port, user, pasw))
  229.                 self['List'].l.setList(self.letter_list)
  230.                 self['List'].l.setItemHeight(31)
  231.                 condt0 = len(self.letter_list)
  232.                 self['info'].setText(str(condt0) + '_Server')
  233.         else:
  234.             Refc = self['List'].getSelectionIndex()
  235.             condt = len(self.letter_list)
  236.             if Refc == 0 and condt == 1:
  237.                 del self.letter_list[Refc]
  238.                 self['info'].setText('.....')
  239.                 self['List'].selectionEnabled(0)
  240.                 self['ProgramTv'].selectionEnabled(1)
  241.                 self.currentList = 'ProgramTv'
  242.             if Refc == 0 and condt > 1:
  243.                 del self.letter_list[0]
  244.                 self['List'].l.setList(self.letter_list)
  245.                 self['List'].l.setItemHeight(31)
  246.                 self['List'].moveToIndex(0)
  247.                 self['info'].setText(str(condt - 1) + '_Server')
  248.             if Refc != 0 and condt > 1:
  249.                 del self.letter_list[Refc]
  250.                 self['List'].l.setList(self.letter_list)
  251.                 self['List'].l.setItemHeight(31)
  252.                 self['List'].moveToIndex(Refc - 1)
  253.                 self['info'].setText(str(condt - 1) + '_Server')
  254.  
  255.     def switchList(self):
  256.         if self.currentList == 'List':
  257.             self['List'].selectionEnabled(1)
  258.             self['ProgramTv'].selectionEnabled(1)
  259.             self.currentList = 'ProgramTv'
  260.         else:
  261.             self['ProgramTv'].selectionEnabled(1)
  262.             self['List'].selectionEnabled(1)
  263.             self.currentList = 'List'
  264.            
  265.     # def switchList(self):
  266.         # if self.currentList == 'List':
  267.             # self['List'].selectionEnabled(0)
  268.             # self['ProgramTv'].selectionEnabled(1)
  269.             # self.currentList = 'ProgramTv'
  270.         # else:
  271.             # self['ProgramTv'].selectionEnabled(0)
  272.             # self['List'].selectionEnabled(1)
  273.             # self.currentList = 'List'
  274.  
  275.     def up(self):
  276.         self[self.currentList].up()
  277.         self.updateTimer.stop()
  278.  
  279.     def down(self):
  280.         self[self.currentList].down()
  281.         self.updateTimer.stop()
  282.  
  283.     def left(self):
  284.         self[self.currentList].pageUp()
  285.         self.updateTimer.stop()
  286.  
  287.     def right(self):
  288.         self[self.currentList].pageDown()
  289.         self.updateTimer.stop()
  290.  
  291.     def initial(self):
  292.         self.List = []
  293.         self.letter_list = []
  294.         import shutil
  295.         shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/config/wicardd.conf', '/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/wicardd.conf')
  296.         shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/config/ncam.server', '/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/ncam.server')
  297.         shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/config/CCcam.cfg', '/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/CCcam.cfg')
  298.         shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/config/oscam.server', '/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/oscam.server')
  299.         shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/config/oscam.server', '/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/doscam.cfg')
  300.         shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/config/gcam.server', '/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/gcam.server')
  301.        
  302.         self['info'].setText('.....')
  303.         self['List'].l.setList(self.letter_list)
  304.         self['List'].l.setItemHeight(31)
  305.         self.list_iptv1(Lien1)
  306.         self.list_iptv1(Lien2)
  307.         self.list_iptv1(Lien3)
  308.         self.list_iptv1(Lien4)
  309.         self.list_iptv1(Lien5)
  310.         self.list_iptv1(Lien6)
  311.         self.list_iptv1(Lien7)
  312.         self.list_iptv1(Lien8)
  313.         self.list_iptv1(Lien9)
  314.         self.list_iptv(Lien10)
  315.         self.list_iptv(Lien11)
  316.        
  317.         self.session.open(MessageBox, 'Erase servers', type=MessageBox.TYPE_INFO, timeout=8)
  318.  
  319.     def End(self):
  320.         self.close()
  321.  
  322.     def Wicardd(self):
  323.         import shutil
  324.         Imp = len(self.letter_list)
  325.         if Imp == 0:
  326.             self.session.open(MessageBox, 'Empty list', type=MessageBox.TYPE_INFO, timeout=8)
  327.         else:
  328.             self['ProgramTv'].selectionEnabled(0)
  329.             self['List'].selectionEnabled(1)
  330.             self.currentList = 'List'
  331.             for x in range(Imp):
  332.                 try:
  333.                     self['List'].moveToIndex(x)
  334.                     host = self['List'].getCurrent()[0][0]
  335.                     port = self['List'].getCurrent()[0][1]
  336.                     user = self['List'].getCurrent()[0][2]
  337.                     pasw = self['List'].getCurrent()[0][3]
  338.                    
  339.                     if fileExists('/usr/cfmngr/wicardd/wicardd.conf'):
  340.                         Dist = '/usr/cfmngr/wicardd/wicardd.conf'
  341.                     elif fileExists('/etc/tuxbox/config/wicardd.conf'):
  342.                         Dist = '/etc/tuxbox/config/wicardd.conf'
  343.                     elif fileExists('/usr/keys/wicardd.conf'):
  344.                         Dist = '/usr/keys/wicardd.conf'
  345.                     elif fileExists('/var/tuxbox/config/wicardd.conf'):
  346.                         Dist = '/var/tuxbox/config/wicardd.conf'                        
  347.                     else:
  348.                         shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/wicardd.conf', '/etc/tuxbox/config/wicardd.conf')
  349.                         Dist = '/etc/tuxbox/config/wicardd.conf'
  350.                        
  351.                     fichier = open(Dist, 'a')
  352.                     #fichier = open('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/wicardd.conf', 'a')
  353.                     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')
  354.                     fichier.close()
  355.                 except IndexError:
  356.                     pass
  357.  
  358.             # Dist = '/etc/tuxbox/config/wicardd.conf'
  359.             # shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/wicardd.conf', '/etc/tuxbox/config/wicardd.conf')
  360.             self.session.open(MessageBox, str(Imp) + '_Server Copy/in ' + Dist, type=MessageBox.TYPE_INFO, timeout=8)
  361.             self['ProgramTv'].selectionEnabled(1)
  362.             self['List'].selectionEnabled(0)
  363.             self.currentList = 'ProgramTv'
  364.  
  365.     def Oscam(self):
  366.         import shutil
  367.         Imp = len(self.letter_list)
  368.         if Imp == 0:
  369.             self.session.open(MessageBox, 'Empty list', type=MessageBox.TYPE_INFO, timeout=8)
  370.         else:
  371.             self['ProgramTv'].selectionEnabled(0)
  372.             self['List'].selectionEnabled(1)
  373.             self.currentList = 'List'
  374.             for x in range(Imp):
  375.                 try:
  376.                     self['List'].moveToIndex(x)
  377.                     host = self['List'].getCurrent()[0][0]
  378.                     port = self['List'].getCurrent()[0][1]
  379.                     user = self['List'].getCurrent()[0][2]
  380.                     pasw = self['List'].getCurrent()[0][3]
  381.                    
  382.                     if fileExists('/etc/tuxbox/config/oscam.server'):
  383.                         Dist = '/etc/tuxbox/config/oscam.server'
  384.                     elif fileExists('/usr/keys/oscam_atv_ymod/oscam.server'):
  385.                         Dist = '/usr/keys/oscam_atv_ymod/oscam.server'
  386.                     elif fileExists('/usr/keys/oscam.server'):
  387.                         Dist = '/usr/keys/oscam.server'
  388.                     elif fileExists('/var/keys/oscam.server'):
  389.                         Dist = '/var/keys/oscam.server'                        
  390.                     else:
  391.                         shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/oscam.server', '/etc/tuxbox/config/oscam.server' )
  392.                         Dist = '/etc/tuxbox/config/oscam.server'                    
  393.  
  394.                     fichier = open(Dist, 'a')
  395.                     #fichier = open('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/oscam.server', 'a')
  396.                     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')
  397.                     fichier.close()
  398.                 except IndexError:
  399.                     pass
  400.  
  401.             # Dist = '/etc/tuxbox/config/oscam.server'
  402.             # shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/oscam.server', Dist)
  403.             self.session.open(MessageBox, str(Imp) + '_Server Copy/in ' + Dist, type=MessageBox.TYPE_INFO, timeout=8)
  404.            
  405.             self['ProgramTv'].selectionEnabled(1)
  406.             self['List'].selectionEnabled(0)
  407.             self.currentList = 'ProgramTv'
  408.  
  409.     def Doscam(self):
  410.         import shutil
  411.         Imp = len(self.letter_list)
  412.         if Imp == 0:
  413.             self.session.open(MessageBox, 'Empty list', type=MessageBox.TYPE_INFO, timeout=8)
  414.         else:
  415.             self['ProgramTv'].selectionEnabled(0)
  416.             self['List'].selectionEnabled(1)
  417.             self.currentList = 'List'
  418.             for x in range(Imp):
  419.                 try:
  420.                     self['List'].moveToIndex(x)
  421.                     host = self['List'].getCurrent()[0][0]
  422.                     port = self['List'].getCurrent()[0][1]
  423.                     user = self['List'].getCurrent()[0][2]
  424.                     pasw = self['List'].getCurrent()[0][3]
  425.                    
  426.                     if fileExists('/etc/tuxbox/config/doscam.cfg'):
  427.                         Dist = '/etc/tuxbox/config/doscam.cfg'
  428.                     elif fileExists('/usr/keys/doscam.cfg'):
  429.                         Dist = '/usr/keys/doscam.cfg'
  430.                     elif fileExists('/etc/tuxbox/doscam.config/doscam.cfg'):
  431.                         Dist = '/etc/tuxbox/doscam.config/doscam.cfg'
  432.                     elif fileExists('/etc/tuxbox/doscam.cfg'):
  433.                         Dist = '/etc/tuxbox/doscam.cfg'                        
  434.                     else:
  435.                         shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/doscam.cfg', '/etc/tuxbox/doscam.cfg' )
  436.                         Dist = '/etc/tuxbox/doscam.cfg'                    
  437.  
  438.                     fichier = open(Dist, 'a')
  439.                     #fichier = open('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/doscam.vfg', 'a')
  440.                     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')
  441.                     fichier.close()
  442.                 except IndexError:
  443.                     pass
  444.  
  445.             # Dist = '/etc/tuxbox/config/doscam.cfg'
  446.             # shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/doscam.cfg', Dist)
  447.             self.session.open(MessageBox, str(Imp) + '_Server Copy/in ' + Dist, type=MessageBox.TYPE_INFO, timeout=8)
  448.            
  449.             self['ProgramTv'].selectionEnabled(1)
  450.             self['List'].selectionEnabled(0)
  451.             self.currentList = 'ProgramTv'
  452.            
  453.     def Gcam(self):
  454.         import shutil
  455.         Imp = len(self.letter_list)
  456.         if Imp == 0:
  457.             self.session.open(MessageBox, 'Empty list', type=MessageBox.TYPE_INFO, timeout=8)
  458.         else:
  459.             self['ProgramTv'].selectionEnabled(0)
  460.             self['List'].selectionEnabled(1)
  461.             self.currentList = 'List'
  462.             for x in range(Imp):
  463.                 try:
  464.                     self['List'].moveToIndex(x)
  465.                     host = self['List'].getCurrent()[0][0]
  466.                     port = self['List'].getCurrent()[0][1]
  467.                     user = self['List'].getCurrent()[0][2]
  468.                     pasw = self['List'].getCurrent()[0][3]
  469.                    
  470.                     if fileExists('/etc/tuxbox/config/gcam.server'):
  471.                         Dist = '/etc/tuxbox/config/gcam.server'
  472.                     elif fileExists('/usr/keys/gcam.server'):
  473.                         Dist = '/usr/keys/gcam.server'
  474.                     elif fileExists('/var/keys/gcam.server'):
  475.                         Dist = '/var/keys/gcam.server'                        
  476.                     else:
  477.                         shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/gcam.server', '/etc/tuxbox/config/gcam.server' )
  478.                         Dist = '/etc/tuxbox/config/gcam.server'                    
  479.  
  480.                     fichier = open(Dist, 'a')
  481.                     #fichier = open('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/gcam.server', 'a')
  482.                     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')
  483.                     fichier.close()
  484.                 except IndexError:
  485.                     pass
  486.  
  487.             # Dist = '/etc/tuxbox/config/gcam.server'
  488.             # shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/gcam.server', Dist)
  489.             self.session.open(MessageBox, str(Imp) + '_Server Copy/in ' + Dist, type=MessageBox.TYPE_INFO, timeout=8)
  490.            
  491.             self['ProgramTv'].selectionEnabled(1)
  492.             self['List'].selectionEnabled(0)
  493.             self.currentList = 'ProgramTv'  
  494.            
  495.     def Cccam(self):
  496.         import shutil
  497.         Imp = len(self.letter_list)
  498.         if Imp == 0:
  499.             self.session.open(MessageBox, 'Empty list', type=MessageBox.TYPE_INFO, timeout=8)
  500.         else:
  501.             self['ProgramTv'].selectionEnabled(0)
  502.             self['List'].selectionEnabled(1)
  503.             self.currentList = 'List'
  504.             for x in range(Imp):
  505.                 try:
  506.                     self['List'].moveToIndex(x)
  507.                     host = self['List'].getCurrent()[0][0]
  508.                     port = self['List'].getCurrent()[0][1]
  509.                     user = self['List'].getCurrent()[0][2]
  510.                     pasw = self['List'].getCurrent()[0][3]
  511.                                        
  512.                     if fileExists('/etc/CCcam.cfg'):
  513.                         Dist = '/etc/CCcam.cfg'
  514.                     elif fileExists('/etc/tuxbox/config/CCcam.cfg'):
  515.                         Dist = '/etc/tuxbox/config/CCcam.cfg'
  516.                     elif fileExists('/usr/keys/CCcam.cfg'):
  517.                         Dist = '/usr/keys/CCcam.cfg'    
  518.                     elif fileExists('/etc/keys/CCcam.cfg'):
  519.                         Dist = '/etc/keys/CCcam.cfg'    
  520.                     else:
  521.                         shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/CCcam.cfg', '/etc/CCcam.cfg')
  522.                         Dist = '/etc/CCcam.cfg'                    
  523.                     fichier = open(Dist, 'a')
  524.                     #fichier = open('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/CCcam.cfg', 'a')
  525.                     fichier.write('\n\nC: ' + host + ' ' + port + ' ' + user + ' ' + pasw)
  526.                     fichier.close()
  527.                 except IndexError:
  528.                     pass
  529.  
  530.             # Dist = '/etc/tuxbox/config/CCcam.cfg'
  531.             # shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/CCcam.cfg', '/etc/tuxbox/config/CCcam.cfg')
  532.             self.session.open(MessageBox, str(Imp) + '_Server Copy in ' + Dist, type=MessageBox.TYPE_INFO, timeout=8)
  533.             self['ProgramTv'].selectionEnabled(1)
  534.             self['List'].selectionEnabled(0)
  535.             self.currentList = 'ProgramTv'
  536.  
  537.     def Ncam(self):
  538.         import shutil
  539.         Imp = len(self.letter_list)
  540.         if Imp == 0:
  541.             self.session.open(MessageBox, 'Empty list', type=MessageBox.TYPE_INFO, timeout=8)
  542.         else:
  543.             self['ProgramTv'].selectionEnabled(0)
  544.             self['List'].selectionEnabled(1)
  545.             self.currentList = 'List'
  546.             for x in range(Imp):
  547.                 try:
  548.                     self['List'].moveToIndex(x)
  549.                     host = self['List'].getCurrent()[0][0]
  550.                     port = self['List'].getCurrent()[0][1]
  551.                     user = self['List'].getCurrent()[0][2]
  552.                     pasw = self['List'].getCurrent()[0][3]
  553.                                                            
  554.                     if fileExists('/etc/tuxbox/config/ncam.server'):
  555.                         Dist = '/etc/tuxbox/config/ncam.server'
  556.                     elif fileExists('/var/keys/ncam.server'):
  557.                         Dist = '/var/keys/ncam.server'
  558.                     elif fileExists('/usr/keys/ncam.server'):
  559.                         Dist = '/usr/keys/ncam.server'
  560.                     else:
  561.                         shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/ncam.server', '/etc/tuxbox/config/ncam.server')
  562.                         Dist = '/etc/tuxbox/config/ncam.server'                    
  563.                     fichier = open(Dist, 'a')
  564.                    
  565.                     #fichier = open('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/ncam.server', 'a')
  566.                     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')
  567.                     fichier.close()
  568.                 except IndexError:
  569.                     pass
  570.  
  571.             #shutil.copy2('/usr/lib/enigma2/python/Plugins/Extensions/FreeCccamMod/data/ncam.server', '/etc/tuxbox/config/ncam.server')
  572.             #Dist = '/etc/tuxbox/config/ncam.server'
  573.             self.session.open(MessageBox, str(Imp) + '_Server Copy ' + Dist, type=MessageBox.TYPE_INFO, timeout=8)
  574.             self['ProgramTv'].selectionEnabled(1)
  575.             self['List'].selectionEnabled(0)
  576.             self.currentList = 'ProgramTv'
  577.            
  578.            
  579.  
  580. def main(session, **kwargs):
  581.     session.open(LiseScreencccam)
  582.  
  583.  
  584. def menu(menuid, **kwargs):
  585.     if menuid == 'mainmenu':
  586.         return [(_('FreeCCcam-Modded'),
  587.           main,
  588.           'FreeCCcamMod',
  589.           44)]
  590.     return []
  591.  
  592.  
  593. def Plugins(**kwargs):
  594.     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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement