Advertisement
Guest User

Untitled

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