Advertisement
Guest User

Untitled

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