from imports import *
from about import *
from setup import *
from teledunet import *
from alqudseyes import *
from dramacafe import *
from dubaitv import *
from ilive_new import *
from farfesh import *
from albtvapp import *
from alarab import *
from sonara import *
from daily import *
from streamingHD import *
from arabic_streams import *
from veetle import *
from magictvbox import *
from globaltv import *
from panet import *
from newspaper import *
from peerstv import *
from beinsports24 import *
#from cricfree import *
#from cricfree_perm import *
from okgoals import *
from ourmatch import *
from skysport_schedule import *
from stadium_live import *
from streamking import *
from wagasworld import *
from bokra import *
#from swisscom import *
from stream4free import *
from onemovies import *
from iptv_planet import *
from wwech import *
from teleboy import *
from canalitv import *
from animejunkies import *
from streamoase import *
from crestream import *
from wwein import *
from satarabia import *
#from yoytv import *
from thaitv import *
from kika import *
#from showsports import *
from cinemay import *
from uktv import *
from teleclubfr import *
from wwetv import *
from ecanlitvizle import *
from meocanaltv import *
from bs import *
from zengatv import *
from streaminghub import *
from myaz import *
from yooanime import *
from kuretv import *
from netd import *
from canalimobi import *
from kinoger import *
from streamco import *
from flashmoviez import *
from ustvnow import *
from giniko import *
from zoptv import *
from jag import *
from tuiptv import *
from tvsporthd import *
from canalitvlive import *
from russian import *
from hdmoviezone import *
from zerocast import *
from wsssport import *
from bratu import *
from hdtvizle import *
from hungarian_iptv import *
from romanian_sport import *
from filmpalast import *
from infoua import *
from orflive import *
from laola1tv import *
#from lanet import *
from spox import *
from kodilive import *
from ndatv import *
from webtv import *
from streamlive import *
from filmon import *
from onlinetvler import *
from tvnanet import *
from weebtv import *
from thaisports import *
from scandinavian import *
from hdfree import *
from latino import *
from sportstreams import *
from wizihd import *
from hoofoot import *
from webcams import *
from liveonlinetv import *
from arconaitv import *
from magictvboxeu import *
#from tectime import *
from cczwei import *
from myge import *
#from freetvrocks import *
from moviesever import *
from mykino import *
from kino24 import *
from cineto import *
from persian import *
#from canlitvplay import *
from muntumedia import *
from vipgoal import *
from freetvstream import *
from iranproud import *
from saraydorf import *
from tumarcador import *
from streamhdeu import *
from alltvfr import *
from dizi import *
from turkey import *
from urtv import *
from sports_player import *
from tvmak_player import *
from ontv_player import *
from elitehd import *
from iptvfree import *
from shqiptv import *
from sportstvclub import *
from elahmad import *
from livestream import *
from streamcloud_pastebin import *
from ad_sports import *
from c247 import *
from goal2hd import *
from seirsanduk import *
from myonlinetv import *
from streamkiste import *
from movietown import *
#from polish import *
from filmestreamz import *
from nettvplayer import *
from castfree import *
from moreiptv import *
from tvshqip import *
from tvplayerlatino import *
from filmcuks import *
from crimazlive import *
from live365 import *
from kurdtvs import *
from watchwrestlingup import *
from solidstreamz import *
from livetvhd import *
from kumanda import *
#from skyfall import *
from tata import *
from mhdtvlive import *
from karwan import *
from sport247hd import *
from ustreamix import *
from skylinewebcams import *
from streamm import *
#from livesport import *
from hdfreetv import *
from mcanlitv import *
from kineskop import *
from streams import *
sz_w = getDesktop(0).size().width()
if sz_w == 1920:
    Height = 60
else:		
    Height = 40
	
PLUGIN_PATH = '/usr/lib/enigma2/python/Plugins/Extensions/Albatros'
from enigma import addFont
try:
    addFont('%s/1.ttf' % PLUGIN_PATH, 'RegularIPTV', 100, 1)
except Exception as ex:
    print 'addfont', ex

if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/MediaPlayer/plugin.pyo'):
    from streamcomplete import *
    MediaPlayerInstalled = True
else:
    MediaPlayerInstalled = False

class chooseMenuList(MenuList):

    def __init__(self, list):
        MenuList.__init__(self, list, True, eListboxPythonMultiContent)
        self.l.setFont(0, gFont('RegularIPTV', 20))
        self.l.setFont(1, gFont('RegularIPTV', 24))
        self.l.setItemHeight(40)


class Albatros(Screen):

    def __init__(self, session):
        self.session = session
        if sz_w == 1920:
            if config.Albatros.skin.value=='1':
                path = "%s/skin/haupt_Screen_new.xml" % PLUGIN_PATH
            elif config.Albatros.skin.value=='2':
                path = "%s/skin2/haupt_Screen_new.xml" % PLUGIN_PATH
            elif config.Albatros.skin.value=='3':
                path = "%s/skin3/haupt_Screen_new.xml" % PLUGIN_PATH
        else:
            if config.Albatros.skin.value=='1':
                path = "%s/skin/haupt_Screen.xml" % PLUGIN_PATH
            elif config.Albatros.skin.value=='2':
                path = "%s/skin2/haupt_Screen.xml" % PLUGIN_PATH
            elif config.Albatros.skin.value=='3':
                path = "%s/skin3/haupt_Screen.xml" % PLUGIN_PATH
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()
        Screen.__init__(self, session)
        self['actions'] = ActionMap(['OkCancelActions',
         'ShortcutActions',
         'WizardActions',
         'ColorActions',
         'SetupActions',
         'NumberActions',
         'MenuActions',
         'HelpActions'], {'ok': self.keyOK,
         'up': self.keyUp,
         'down': self.keyDown,
         'yellow': self.about,
         'cancel': self.keyCancel,
         'red': self.keyCancel,
         'left': self.keyLeft,
         'right': self.keyRight,
         'menu': self.keySetup}, -1)
        self['red'] = Label(_('Exit'))
        self['green'] = Label(' ')
        self['yellow'] = Label(_('About'))
        self['blue'] = Label(' ')
        self['name'] = Label('Plugin Auswahl')
        self['headline'] = Label('Albatros 7.1 - Entertainment without frontiers')
        self['Menu'] = Label(_('Menu'))
        self['infos'] = chooseMenuList([])
        self['Infos'] = Label('Info / More')
        self['fun'] = chooseMenuList([])
        self['Fun'] = Label('Fun / TV')
        self['movies'] = chooseMenuList([])
        self['Movies'] = Label('Movies / Series')
        self['sport'] = chooseMenuList([])
        self['Sport'] = Label('Sport / More')
        self.currenlist = 'sport'
        self.picload = ePicLoad()
        self.onLayoutFinish.append(self.layoutFinished)

    def layoutFinished(self):
        self.movies = []
        self.infos = []
        self.fun = []
        self.sport = []
        if config.Albatros.show_Alqudseyes.value=='Yes':
            self.movies.append(self.hauptListEntry('Alqudseyes', 'alqudseyes'))
        if config.Albatros.show_Wagasworld.value=='Yes':
            self.movies.append(self.hauptListEntry('Wagasworld', 'wagasworld'))
        if config.Albatros.show_Dramacafe.value=='Yes':
            self.movies.append(self.hauptListEntry('Dramacafe', 'dramacafe'))
        if config.Albatros.show_Dubaitv.value=='Yes':
            self.movies.append(self.hauptListEntry('Dubaitv', 'dubaitv'))
        if config.Albatros.show_Sonara.value=='Yes':
            self.movies.append(self.hauptListEntry('Sonara', 'alarab'))
        if config.Albatros.show_Farfesh.value=='Yes':
            self.movies.append(self.hauptListEntry('Farfesh', 'farfesh'))
        if config.Albatros.show_Streamlive.value=='Yes':
            self.movies.append(self.hauptListEntry('Streamlive', 'ilive'))
        if config.Albatros.show_Dailymotion.value=='Yes':
            self.movies.append(self.hauptListEntry('Dailymotion', 'daily'))
        if config.Albatros.show_Veetle.value=='Yes':
            self.movies.append(self.hauptListEntry('Veetle', 'Veetle'))
        if config.Albatros.show_FlashMoviez.value=='Yes':
            self.movies.append(self.hauptListEntry('FlashMoviez', 'flashmoviez'))
        if config.Albatros.show_Panet.value=='Yes':
            self.movies.append(self.hauptListEntry('Panet', 'panet'))
        if config.Albatros.show_Alarab.value=='Yes':
            self.movies.append(self.hauptListEntry('Alarab', 'realalarab'))
        if config.Albatros.show_AnimeJunkies.value=='Yes':
            self.movies.append(self.hauptListEntry('AnimeJunkies', 'animejunkies'))
        if config.Albatros.show_Filmpalast.value=='Yes':
            self.movies.append(self.hauptListEntry('Filmpalast', 'filmpalast'))
        if config.Albatros.show_Cinemay.value=='Yes':
            self.movies.append(self.hauptListEntry('Cinemay.com', 'cinemay'))
        if config.Albatros.show_Bokra.value=='Yes':
            self.movies.append(self.hauptListEntry('Bokra', 'bokra'))
        if config.Albatros.show_Onlinetvler.value=='Yes':
            self.fun.append(self.hauptListEntry('Onlinetvler', 'onlinetvler'))
        if config.Albatros.show_123movies.value=='Yes':
            self.movies.append(self.hauptListEntry('123movies', 'onetwothreemovies'))
        if config.Albatros.show_KinoGer.value=='Yes':
            self.movies.append(self.hauptListEntry('KinoGer', 'kinoger'))
        #if config.Albatros.show_Tectime.value=='Yes':
        #    self.movies.append(self.hauptListEntry('Tectime', 'tectime'))
        if config.Albatros.show_MyKino.value=='Yes':
            self.movies.append(self.hauptListEntry('MyKino', 'mykino'))
        if config.Albatros.show_KIKA.value=='Yes':
            self.movies.append(self.hauptListEntry('KIKA.de', 'kika'))
        if config.Albatros.show_arconaitv.value=='Yes':
            self.movies.append(self.hauptListEntry('arconaitv', 'arconaitv'))
        if config.Albatros.show_BurningSeries.value=='Yes':
            self.movies.append(self.hauptListEntry('BurningSeries', 'burning'))
        if config.Albatros.show_Newspaper.value=='Yes':
            self.infos.append(self.hauptListEntry('Newspaper', 'newspaper'))
        if config.Albatros.show_Webcams.value=='Yes':
            self.infos.append(self.hauptListEntry('Webcams', 'webcams'))
        if config.Albatros.show_CanaliTV.value=='Yes':
            self.fun.append(self.hauptListEntry('CanaliTV', 'canalitv'))
        if config.Albatros.show_ZopTV.value=='Yes':
            self.fun.append(self.hauptListEntry('ZopTV', 'zoptv'))
        if config.Albatros.show_HDTVler.value=='Yes':
            self.fun.append(self.hauptListEntry('HDTVler.net', 'hdtvler'))
        if config.Albatros.show_Zerocast.value=='Yes':
            self.fun.append(self.hauptListEntry('Zerocast - USA', 'zerocast'))
        if config.Albatros.show_RussianPlaylist.value=='Yes':
            self.fun.append(self.hauptListEntry('RussianPlaylist', 'russian'))
        if config.Albatros.show_Hungarian.value=='Yes':
            self.fun.append(self.hauptListEntry('Hungarian IPTV', 'hungarian'))
        if config.Albatros.show_jagobd.value=='Yes':
            self.fun.append(self.hauptListEntry('jagobd', 'jagobd'))
        if config.Albatros.show_NetD.value=='Yes':
            self.fun.append(self.hauptListEntry('NetD', 'netd'))
        if config.Albatros.show_KureTV.value=='Yes':
            self.fun.append(self.hauptListEntry('KureTV', 'kuretv'))
        if config.Albatros.show_Ecanlitvizle.value=='Yes':
            self.fun.append(self.hauptListEntry('Ecanlitvizle', 'ecanlitvizle'))
        if config.Albatros.show_StreamingHUB.value=='Yes':
            self.fun.append(self.hauptListEntry('StreamingHUB', 'streaminghub'))
        if config.Albatros.show_Teledunet.value=='Yes':
            self.fun.append(self.hauptListEntry('Teledunet', 'teledunet'))
        if config.Albatros.show_ZengaTV.value=='Yes':
            self.fun.append(self.hauptListEntry('ZengaTV', 'zengatv'))
        if config.Albatros.show_Infoua.value=='Yes':
            self.fun.append(self.hauptListEntry('Infoua.biz', 'infoua'))
        if config.Albatros.show_Giniko.value=='Yes':
            self.fun.append(self.hauptListEntry('Giniko', 'giniko'))
        if config.Albatros.show_tvnanet.value=='Yes':
            self.fun.append(self.hauptListEntry('tvnanet', 'tvnanet'))
        if config.Albatros.show_WeebTV.value=='Yes':
            self.fun.append(self.hauptListEntry('WeebTV', 'weebtv'))
        if config.Albatros.show_USTVNOW.value=='Yes':
            self.fun.append(self.hauptListEntry('USTVNOW', 'ustvnow'))
        if config.Albatros.show_IPTVPlanet.value=='Yes':
            self.fun.append(self.hauptListEntry('IPTV-Planet', 'iptv_planet'))
        if config.Albatros.show_magictvboxeu.value=='Yes':
            self.fun.append(self.hauptListEntry('magictvboxeu', 'magictvboxeu'))
        if config.Albatros.show_KodiLive.value=='Yes':
            self.fun.append(self.hauptListEntry('KodiLive.eu', 'kodilive'))
        if config.Albatros.show_StreamingHD.value=='Yes':
            self.fun.append(self.hauptListEntry('StreamingHD', 'streamingHD'))
        if config.Albatros.show_Filmon.value=='Yes':
            self.fun.append(self.hauptListEntry('Filmon', 'filmon'))
        if config.Albatros.show_CCZwei.value=='Yes':
            self.movies.append(self.hauptListEntry('CCZwei', 'cczwei'))
        if config.Albatros.show_ArabicStreams.value=='Yes':
            self.fun.append(self.hauptListEntry('ArabicStreams', 'arabicstreams'))
        if config.Albatros.show_Web.value=='Yes':
            self.fun.append(self.hauptListEntry('Web TV', 'webtv'))
        if config.Albatros.show_Myvideoaz.value=='Yes':
            self.fun.append(self.hauptListEntry('Myvideo.az', 'myvideoaz'))
        if config.Albatros.show_NDATV.value=='Yes':
            self.fun.append(self.hauptListEntry('NDATV', 'ndatv'))
        if config.Albatros.show_Myvideoge.value=='Yes':
            self.fun.append(self.hauptListEntry('Myvideo.ge', 'myge'))
        if config.Albatros.show_CanaliTVLive.value=='Yes':
            self.fun.append(self.hauptListEntry('CanaliTVLive', 'canalitvlive'))
        if config.Albatros.show_Teleboy.value=='Yes':
            self.fun.append(self.hauptListEntry('Teleboy', 'teleboy'))
        if config.Albatros.show_Thai.value=='Yes':
            self.fun.append(self.hauptListEntry('Thai TV', 'thaitv'))
        if config.Albatros.show_ORF.value=='Yes':
            self.fun.append(self.hauptListEntry('ORF LIVE', 'orflive'))
        #if config.Albatros.show_lanet.value=='Yes':
        #    self.fun.append(self.hauptListEntry('lanet.tv', 'lanet'))
        if config.Albatros.show_Scandinavian.value=='Yes':
            self.fun.append(self.hauptListEntry('Scandinavian', 'scandinavian'))
        if config.Albatros.show_LiveOnlineTV.value=='Yes':
            self.sport.append(self.hauptListEntry('LiveOnlineTV', 'liveonlinetv'))
        if config.Albatros.show_ThaiSports.value=='Yes':
            self.sport.append(self.hauptListEntry('ThaiSports', 'thaisports'))
        if config.Albatros.show_Hoofoot.value=='Yes':
            self.sport.append(self.hauptListEntry('Hoofoot', 'hoofoot'))
        if config.Albatros.show_Spox.value=='Yes':
            self.sport.append(self.hauptListEntry('Spox.com', 'spox'))
        if config.Albatros.show_WSSSPORT.value=='Yes':
            self.sport.append(self.hauptListEntry('WSS-SPORT', 'wsssport'))
        if config.Albatros.show_SportStreams.value=='Yes':
            self.sport.append(self.hauptListEntry('SportStreams', 'sportstreams'))
        #if config.Albatros.show_CricfreeCH.value=='Yes':
        #    self.sport.append(self.hauptListEntry('Cricfree(CH)', 'cricfree_perm'))
        if config.Albatros.show_Moviesever.value=='Yes':
            self.movies.append(self.hauptListEntry('Moviesever', 'moviesever'))
        if config.Albatros.show_Romanian.value=='Yes':
            self.sport.append(self.hauptListEntry('Romanian Sports', 'romaniansports'))
        if config.Albatros.show_OKGoals.value=='Yes':
            self.sport.append(self.hauptListEntry('OKGoals(H)', 'OKGoals'))
        if config.Albatros.show_Ourmatch.value=='Yes':
            self.sport.append(self.hauptListEntry('Ourmatch(H)', 'ourmatch'))
        if config.Albatros.show_Skysport.value=='Yes':
            self.sport.append(self.hauptListEntry('Skysport(L)', 'sky_sports'))
        if config.Albatros.show_Stadium.value=='Yes':
            self.sport.append(self.hauptListEntry('Stadium(L)', 'stadium_live'))
        if config.Albatros.show_Streamking.value=='Yes':
            self.sport.append(self.hauptListEntry('Streamking(L)', 'streamking'))
        #if config.Albatros.show_freetvrocks.value=='Yes':
        #    self.fun.append(self.hauptListEntry('freetv.rocks', 'freetvrocks'))
        if config.Albatros.show_WWEIN.value=='Yes':
            self.sport.append(self.hauptListEntry('WWE.IN', 'wwein'))
        if config.Albatros.show_WWETV.value=='Yes':
            self.sport.append(self.hauptListEntry('WWE.TV', 'wwetv'))
        if config.Albatros.show_WWECH.value=='Yes':
            self.sport.append(self.hauptListEntry('WWE.CH', 'wwech'))
        #if config.Albatros.show_ShowSport.value=='Yes':
        #    self.sport.append(self.hauptListEntry('ShowSport', 'showsports'))
        if config.Albatros.show_laola1.value=='Yes':
            self.sport.append(self.hauptListEntry('laola1.tv', 'laola1tv'))
        if config.Albatros.show_cineto.value=='Yes':
            self.movies.append(self.hauptListEntry('Cine.to', 'cineto'))
        if config.Albatros.show_kino24.value=='Yes':
            self.movies.append(self.hauptListEntry('Kino24', 'kino24'))
        if config.Albatros.show_persian.value=='Yes':
            self.fun.append(self.hauptListEntry('persian', 'persian'))
#        if config.Albatros.show_canlitvplay.value=='Yes':
#            self.fun.append(self.hauptListEntry('CanliTVPlay','canlitvplay'))
        if config.Albatros.show_muntumedia.value=='Yes':
            self.fun.append(self.hauptListEntry('Muntumedia - African','muntumedia'))
        if config.Albatros.show_vipgoal.value=='Yes':			
            self.sport.append(self.hauptListEntry('Vipgoal', 'vipgoal'))
        if config.Albatros.show_tumarcador.value=='Yes':			
            self.sport.append(self.hauptListEntry('Tumarcador', 'tumarcador'))
        if config.Albatros.show_sportsplayer.value=='Yes':
            self.sport.append(self.hauptListEntry('SportsPlayer', 'sportsplayer'))
        if config.Albatros.show_iranproud.value=='Yes':		
            self.fun.append(self.hauptListEntry('Iranproud','iranproud'))
        if config.Albatros.show_freetvstream.value=='Yes':
            self.movies.append(self.hauptListEntry('FreeTVStream', 'freetvstream'))
        if config.Albatros.show_streamhdeu.value=='Yes':
            self.sport.append(self.hauptListEntry('StreamHD', 'streamhdeu'))
        if config.Albatros.show_tvsporthd.value=='Yes':
            self.sport.append(self.hauptListEntry('TVSportHD', 'tvsporthd'))
        if config.Albatros.show_alltvfr.value=='Yes':
            self.fun.append(self.hauptListEntry('AllTVFR','alltvfr'))
        if config.Albatros.show_turkey.value=='Yes':
            self.fun.append(self.hauptListEntry('Turkey - CH','turkey'))
        if config.Albatros.show_urtv.value=='Yes':			
            self.fun.append(self.hauptListEntry('Urhd.tv','urtv'))
        if config.Albatros.show_tvmak.value=='Yes':
            self.fun.append(self.hauptListEntry('TVMak','tvmak'))
        if config.Albatros.show_ontv.value=='Yes':
            self.fun.append(self.hauptListEntry('OnTV - Player','ontv'))
        if config.Albatros.show_elitehd.value=='Yes':
            self.fun.append(self.hauptListEntry('EliteHD','elitehd'))
        if config.Albatros.show_iptvfree.value=='Yes':
            self.fun.append(self.hauptListEntry('IPTVFree','iptvfree'))
        if config.Albatros.show_shqiptv.value=='Yes':
            self.fun.append(self.hauptListEntry('Shqiptv','shqiptv'))
        if config.Albatros.show_elahmad.value=='Yes':
            self.fun.append(self.hauptListEntry('elahmad','elahmad'))
        if config.Albatros.show_latino.value=='Yes':
            self.fun.append(self.hauptListEntry('Latino','latino'))
        if config.Albatros.show_livestream.value=='Yes':
            self.fun.append(self.hauptListEntry('livestream','livestream'))
        if config.Albatros.show_streamcloud_paste.value=='Yes':
            self.fun.append(self.hauptListEntry('streamcloud_paste','streamcloud_paste'))
        if config.Albatros.show_sportstvclub.value=='Yes':
            self.sport.append(self.hauptListEntry('SportsTV.club','sportstvclub'))
        if config.Albatros.show_ad_sports.value=='Yes':
            self.sport.append(self.hauptListEntry('ad_sports','ad_sports'))
        if config.Albatros.show_c247.value=='Yes':
            self.sport.append(self.hauptListEntry('C247.to','c247'))
        if config.Albatros.show_gol2hd.value=='Yes':
            self.sport.append(self.hauptListEntry('Goal2HD','gol2hd'))
        if config.Albatros.show_seirsanduk.value=='Yes':
            self.fun.append(self.hauptListEntry('seirsanduk','seirsanduk'))
        if config.Albatros.show_wizihd.value=='Yes':
            self.sport.append(self.hauptListEntry('wizihd','wizihd'))
        if config.Albatros.show_myonlinetv.value=='Yes':
            self.fun.append(self.hauptListEntry('MyOnlineTV','myonlinetv'))
        if config.Albatros.show_streamkiste.value=='Yes':
            self.movies.append(self.hauptListEntry('Streamkiste', 'streamkiste'))
        if config.Albatros.show_filmestreamz.value=='Yes':
            self.movies.append(self.hauptListEntry('Filme-Streamz', 'filmestreamz'))
        if config.Albatros.show_movietown.value=='Yes':
            self.movies.append(self.hauptListEntry('Movietown', 'movietown'))
        #if config.Albatros.show_polish.value=='Yes':
        #    self.fun.append(self.hauptListEntry('Polish IPTV','polish'))
        if config.Albatros.show_castfree.value=='Yes':
            self.sport.append(self.hauptListEntry('Castfree.me','castfree'))
        if config.Albatros.show_crimazlive.value=='Yes':
            self.sport.append(self.hauptListEntry('crimazlive','crimazlive'))
        if config.Albatros.show_moreiptv.value=='Yes':
            self.fun.append(self.hauptListEntry('MoreIPTV','moreiptv'))
        if config.Albatros.show_tvshqip.value=='Yes':
            self.fun.append(self.hauptListEntry('TVShqip','tvshqip'))
        if config.Albatros.show_tvplayerlatino.value=='Yes':
            self.fun.append(self.hauptListEntry('TVPlayerLatino','tvplayerlatino'))
        if config.Albatros.show_sport365.value=='Yes':
            self.sport.append(self.hauptListEntry('Sport365 Live','sport365'))
        if config.Albatros.show_kurdtvs.value=='Yes':####
            self.fun.append(self.hauptListEntry('Kurdtvs','kurdtvs'))
        if config.Albatros.show_karwan.value=='Yes':
            self.fun.append(self.hauptListEntry('Karwan.tv','karwan'))
        if config.Albatros.show_livetvhd.value=='Yes':
            self.fun.append(self.hauptListEntry('LiveTVHD','livetvhd'))
        if config.Albatros.show_solidstreamz.value=='Yes':
            self.fun.append(self.hauptListEntry('SolidStreamz','solidstreamz'))
        if config.Albatros.show_kumanda.value=='Yes':
            self.fun.append(self.hauptListEntry('Kumanda','kumanda'))
        if config.Albatros.show_watchwrestlingup.value=='Yes':
            self.sport.append(self.hauptListEntry('WatchWrestlingUP','watchwrestlingup'))
        #if config.Albatros.show_livestreamtracker.value=='Yes':
        #    self.sport.append(self.hauptListEntry('LiveStreamTracker','livestreamtracker'))
        if config.Albatros.show_tata.value=='Yes':
            self.movies.append(self.hauptListEntry('Tata.to', 'tata'))
        if config.Albatros.show_247HD.value=='Yes':		
            self.sport.append(self.hauptListEntry('247 HD','sport247hd'))
        if config.Albatros.show_streamm.value=='Yes':		
            self.sport.append(self.hauptListEntry('Streamm.eu','streamm'))
        self.fun.append(self.hauptListEntry('Ustreamix','ustreamix'))
        self.fun.append(self.hauptListEntry('UKTV','uktv'))
        self.fun.append(self.hauptListEntry('AlbTVApp','albtvapp'))
        self.infos.append(self.hauptListEntry('Skyline Webcams', 'skylinewebcams'))
        #self.sport.append(self.hauptListEntry('LiveSport.pw','livesport'))
        self.sport.append(self.hauptListEntry('HDFreeTV','hdfreetv'))
        self.fun.append(self.hauptListEntry('Mcanlitv','mcanlitv'))
        self.fun.append(self.hauptListEntry('Mhdtvlive','mhdtvlive'))
        self.fun.append(self.hauptListEntry('Kineskop','kineskop'))
        self.sport.append(self.hauptListEntry('SportStreams','sportstreams'))
        self.movies.sort(key=lambda t: tuple(t[0][0].lower()))
        self.infos.sort(key=lambda t: tuple(t[0][0].lower()))
        self.fun.sort(key=lambda t: tuple(t[0][0].lower()))
        self.sport.sort(key=lambda t: tuple(t[0][0].lower()))
        self['movies'].setList(self.movies)
        self['movies'].l.setItemHeight(40)
        self['infos'].setList(self.infos)
        self['infos'].l.setItemHeight(40)
        self['fun'].setList(self.fun)
        self['fun'].l.setItemHeight(40)
        self['sport'].setList(self.sport)
        self['sport'].l.setItemHeight(40)
        self.keyRight()

    def hauptListEntry(self, name, jpg):
        res = [(name, jpg)]
        icon = "/usr/lib/enigma2/python/Plugins/Extensions/Albatros/icons/%s.png" % jpg
        if fileExists(icon):
            scale = AVSwitch().getFramebufferScale()
            if sz_w == 1920:
                self.picload.setPara((105, 56, scale[0], scale[1], False, 1, "#FF000000"))
            else:
                self.picload.setPara((80, 35, scale[0], scale[1], False, 1, "#FF000000"))
            self.picload.startDecode(icon, 0, 0, False)
            pngthumb = self.picload.getData()
            if sz_w == 1920:
                res.append(MultiContentEntryPixmapAlphaTest(pos=(0, 0), size=(105, 60), png=pngthumb))
                res.append(MultiContentEntryText(pos=(110, 0), size=(400, 60), font=1, text=name, flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER))
            else:
                res.append(MultiContentEntryPixmapAlphaTest(pos=(0, 0), size=(75, 44), png=pngthumb))
                res.append(MultiContentEntryText(pos=(80, 0), size=(300, 44), font=0, text=name, flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER))
        return res

    def keySetup(self):
        self.session.open(SetupScreen)

    def keyHelp(self):
        self.session.open(HelpScreen)

    def getTriesEntry(self):
        return config.ParentalControl.retries.setuppin

    def pinok(self, pincode):
        if pincode:
            self.session.openWithCallback(self.restart, hauptScreenSetup)

    def keyUp(self):
        exist = self[self.currenlist].getCurrent()
        if exist == None:
            return
        else:
            self[self.currenlist].up()
            auswahl = self[self.currenlist].getCurrent()[0][0]
            self.title = auswahl
            self['name'].setText(auswahl)
            return

    def keyDown(self):
        exist = self[self.currenlist].getCurrent()
        if exist == None:
            return
        else:
            self[self.currenlist].down()
            auswahl = self[self.currenlist].getCurrent()[0][0]
            self.title = auswahl
            self['name'].setText(auswahl)
            return

    def keyRight(self):
        self.cur_idx = self[self.currenlist].getSelectedIndex()
        self['sport'].selectionEnabled(0)
        self['fun'].selectionEnabled(0)
        self['movies'].selectionEnabled(0)
        self['infos'].selectionEnabled(0)
        if self.currenlist == 'infos':
            self['sport'].selectionEnabled(1)
            self.currenlist = 'sport'
            cnt_tmp_ls = len(self.sport)
        elif self.currenlist == 'sport':
            self['fun'].selectionEnabled(1)
            self.currenlist = 'fun'
            cnt_tmp_ls = len(self.fun)
        elif self.currenlist == 'fun':
            self['movies'].selectionEnabled(1)
            self.currenlist = 'movies'
            cnt_tmp_ls = len(self.movies)
        elif self.currenlist == 'movies':
            self['infos'].selectionEnabled(1)
            self.currenlist = 'infos'
            cnt_tmp_ls = len(self.infos)
        cnt_tmp_ls = int(cnt_tmp_ls)
        if int(self.cur_idx) < int(cnt_tmp_ls):
            self[self.currenlist].moveToIndex(int(self.cur_idx))
        else:
            idx = int(cnt_tmp_ls) - 1
            self[self.currenlist].moveToIndex(int(idx))
        auswahl = self[self.currenlist].getCurrent()[0][0]
        self.title = auswahl
        self['name'].setText(auswahl)

    def keyLeft(self):
        self.cur_idx = self[self.currenlist].getSelectedIndex()
        self['infos'].selectionEnabled(0)
        self['fun'].selectionEnabled(0)
        self['movies'].selectionEnabled(0)
        self['sport'].selectionEnabled(0)
        if self.currenlist == 'sport':
            self['infos'].selectionEnabled(1)
            self.currenlist = 'infos'
            cnt_tmp_ls = len(self.infos)
        elif self.currenlist == 'infos':
            self['movies'].selectionEnabled(1)
            self.currenlist = 'movies'
            cnt_tmp_ls = len(self.movies)
        elif self.currenlist == 'movies':
            self['fun'].selectionEnabled(1)
            self.currenlist = 'fun'
            cnt_tmp_ls = len(self.fun)
        elif self.currenlist == 'fun':
            self['sport'].selectionEnabled(1)
            self.currenlist = 'sport'
            cnt_tmp_ls = len(self.sport)
        cnt_tmp_ls = int(cnt_tmp_ls)
        print self.cur_idx, cnt_tmp_ls
        if int(self.cur_idx) < int(cnt_tmp_ls):
            self[self.currenlist].moveToIndex(int(self.cur_idx))
        else:
            idx = int(cnt_tmp_ls) - 1
            self[self.currenlist].moveToIndex(int(idx))
        auswahl = self[self.currenlist].getCurrent()[0][0]
        self.title = auswahl
        self['name'].setText(auswahl)

    def keyOK(self):
        exist = self[self.currenlist].getCurrent()
        if exist == None:
            return
        else:
            print self.currenlist
            auswahl = self[self.currenlist].getCurrent()[0][0]
            print auswahl
            if auswahl == 'Teledunet':
                self.session.open(teledunet)
            elif auswahl == 'Alqudseyes':
                self.session.open(alqudseyes)
            elif auswahl == 'Newspaper':
                self.session.open(newspaper)
            elif auswahl == 'PeersTV':
                self.session.open(peerstv)
            elif auswahl == 'Bein24':
                self.session.open(bein24)
            elif auswahl == 'Mhdtvlive':
                self.session.open(mhdtvlive)
            #elif auswahl == 'Cricfree(CH)':
            #    self.session.open(cricfree_perm)
            elif auswahl == 'SportStreams':
                self.session.open(sportstreams)
            elif auswahl == 'arconaitv':
                self.session.open(arconaitv)
            elif auswahl == 'OKGoals(H)':
                self.session.open(OKGoals)
            elif auswahl == 'Ourmatch(H)':
                self.session.open(ourmatch)
            elif auswahl == 'Skysport(L)':
                self.session.open(sky_sports)
            elif auswahl == 'Stadium(L)':
                self.session.open(stadium_live)
            elif auswahl == 'Streamking(L)':
                self.session.open(streamking)
            elif auswahl == 'Wagasworld':
                self.session.open(wagasworld)
            elif auswahl == 'Glarab':
                self.session.open(glarab)
            elif auswahl == 'Glwiz':
                self.session.open(glwiz)
            elif auswahl == 'Glturk':
                self.session.open(glturk)
            elif auswahl == 'Dramacafe':
                self.session.open(dramacafe)
            elif auswahl == 'Dubaitv':
                self.session.open(dubaitv)
            elif auswahl == 'Sonara':
                self.session.open(sonara)
            elif auswahl == 'Farfesh':
                self.session.open(farfesh)
            elif auswahl == 'Ilive':
                self.session.open(ilive)
            elif auswahl == 'magictvboxeu':
                self.session.open(magictvboxeu)
            elif auswahl == 'Dailymotion':
                self.session.open(daily)
            elif auswahl == 'Veetle':
                self.session.open(Veetle)
            elif auswahl == 'StreamingHD':
                self.session.open(streamingHD)
            elif auswahl == 'Magictvbox':
                self.session.open(magictvbox)
            elif auswahl == 'Globaltv':
                self.session.open(globaltv)
            elif auswahl == 'Panet':
                self.session.open(panet)
            elif auswahl == 'Alarab':
                self.session.open(alarab)
            elif auswahl == 'ThaiSports':
                self.session.open(thaisports)
            elif auswahl == 'ArabicStreams':
                self.session.open(arabicstreams)
            elif auswahl == 'SportStreams':
                self.session.open(sportstreams)
            elif auswahl == 'WeebTV':
                self.session.open(weebtv)
            elif auswahl == 'Ecanlitvizle':
                self.session.open(ecanlitvizle)
            elif auswahl == 'Bokra':
                self.session.open(bokra)
            elif auswahl == 'Streamm.eu':
                self.session.open(streamm)
            elif auswahl == 'Streamcomplet':
                self.session.open(streamcomplete)
            elif auswahl == 'Stream4free':
                self.session.open(stream4free)
            elif auswahl == 'HDTVler.net':
                self.session.open(hdtvler)
            elif auswahl == '123movies':
                self.session.open(onetwothreemovies)
            elif auswahl == 'tvnanet':
                self.session.open(tvnanet)
            elif auswahl == 'IPTV-Planet':
                self.session.open(iptv_planet)
            elif auswahl == 'WWE.TV':
                self.session.open(wwetv)
            elif auswahl == 'Teleboy':
                self.session.open(teleboy)
            elif auswahl == 'CanaliTV':
                self.session.open(canalitv)
            elif auswahl == 'MeoCanalTV':
                self.session.open(meocanaltv)
            elif auswahl == 'AnimeJunkies':
                self.session.open(animejunkies)
            elif auswahl == 'Movietown':
                self.session.open(movietown)
            elif auswahl == 'RussianCDN':
                self.session.open(crestream)
            elif auswahl == 'WWE.IN':
                self.session.open(wwein)
            elif auswahl == 'Satarabia':
                self.session.open(satarabia)
            elif auswahl == 'AlbTVApp':
                self.session.open(albtvapp)
            elif auswahl == 'Thai TV':
                self.session.open(thaitv)
            elif auswahl == 'KIKA.de':
                self.session.open(kika)
            elif auswahl == 'UKTV':
                self.session.open(uktv)
            elif auswahl == 'Turkey - CH':
                self.session.open(turkey)
            elif auswahl == 'Cinemay.com':
                self.session.open(cinemay)
            elif auswahl == 'Zerocast - USA':
                self.session.open(zerocast)
            elif auswahl == 'Teleclub.fr':
                self.session.open(teleclubfr)
            elif auswahl == 'German Streams':
                self.session.open(streamger)
            elif auswahl == 'BurningSeries':
                self.session.open(burning)
            elif auswahl == 'ZengaTV':
                self.session.open(zengatv)
            elif auswahl == 'StreamingHUB':
                self.session.open(streaminghub)
            elif auswahl == 'GlChina':
                self.session.open(glchinese)
            elif auswahl == 'Myvideo.az':
                self.session.open(myvideoaz)
            elif auswahl == 'Myvideo.ge':
                self.session.open(myvideoge)
            elif auswahl == 'Wiziwig - Lag10(L)':
               self.session.open(wizi)
            elif auswahl == 'KureTV':
                self.session.open(kuretv)
            elif auswahl == 'NetD':
                self.session.open(netd)
            elif auswahl == 'CanaliMobi':
                self.session.open(canalimobi)
            elif auswahl == 'KinoGer':
                self.session.open(kinoger)
            elif auswahl == 'Streamking.co':
                self.session.open(streamco)
            elif auswahl == 'FlashMoviez':
                self.session.open(flashmoviez)
            elif auswahl == 'WWE.CH':
                self.session.open(wwech)
            elif auswahl == 'USTVNOW':
                self.session.open(ustvnow)
            elif auswahl == 'Giniko':
                self.session.open(giniko)
            elif auswahl == 'ZopTV':
                self.session.open(zoptv)
            elif auswahl == 'jagobd':
                self.session.open(jagobd)
            elif auswahl == 'tuiptv':
                self.session.open(tuiptv)
            elif auswahl == 'TVSportHD':
                self.session.open(tvsporthd)
            elif auswahl == 'CanaliTVLive':
                self.session.open(canalitvlive)
            elif auswahl == 'RussianPlaylist':
                self.session.open(russian_playlist)
            elif auswahl == 'HDMovieZone':
                self.session.open(hdmoviezone)
            elif auswahl == 'WSS-SPORT':
                self.session.open(wsssport)
            elif auswahl == 'telewizjada.net':
                self.session.open(telewizjada)
            elif auswahl == 'bratu-marian.ro':
                self.session.open(bratu)
            elif auswahl == 'MoreIPTV':
                self.session.open(moreiptv)
            elif auswahl == 'Romanian Sports':
                self.session.open(romaniansport)
            elif auswahl == 'Hungarian IPTV':
                self.session.open(hungarian)
            elif auswahl == 'Filmpalast':
                self.session.open(filmpalast)
            elif auswahl == 'Embratoria.com':
                self.session.open(embratoria)
            elif auswahl == 'Infoua.biz':
                self.session.open(infoua)
            elif auswahl == 'ORF LIVE':
                self.session.open(orflive)
            elif auswahl == 'laola1.tv':
                self.session.open(laola1tv)
            #elif auswahl == 'lanet.tv':
            #    self.session.open(lanet)
            elif auswahl == 'Spox.com':
                self.session.open(spox)
            elif auswahl == 'KodiLive.eu':
                self.session.open(kodilive)
            elif auswahl == 'NDATV':
                self.session.open(ndatv)
            elif auswahl == 'Web TV':
                self.session.open(webtv)
            elif auswahl == 'Streamlive':
                self.session.open(streamlive)
            elif auswahl == 'Filmon':
                self.session.open(filmon)
            elif auswahl == 'Onlinetvler':
                self.session.open(onlinetvler)
            elif auswahl == 'Scandinavian':
                self.session.open(scandinavian)
            elif auswahl == 'NetsporTV':
                self.session.open(netsportv)
            elif auswahl == 'HDFree':
                self.session.open(hdfree)
            elif auswahl == 'Latino':
                self.session.open(latino)
            elif auswahl == 'StreamHD':
                self.session.open(streamhdeu)
            elif auswahl == 'wizihd':
                self.session.open(wizihd)
            elif auswahl == 'Hoofoot':
                self.session.open(hoofoot)
            elif auswahl == 'Webcams':
                self.session.open(webcams)
            elif auswahl == 'LiveOnlineTV':
                self.session.open(liveonlinetv)
            elif auswahl == 'MyOnlineTV':
                self.session.open(myonlinetv)
            elif auswahl == 'CCZwei':
                self.session.open(cczwei)
            #elif auswahl == 'freetv.rocks':
            #    self.session.open(freetvrocks)
            elif auswahl == 'MyKino':
                self.session.open(mykino)
            elif auswahl == 'Moviesever':
                self.session.open(moviesever)
            elif auswahl == 'Kino24':
                self.session.open(kino24)
            elif auswahl == 'arconaitv':
                self.session.open(arconaitv)
            elif auswahl == 'Cine.to':
                self.session.open(cineto)
            elif auswahl == 'persian':
                self.session.open(persian)
#            elif auswahl == 'CanliTVPlay':
#                self.session.open(canlitvplay)
            elif auswahl == 'Muntumedia - African':
                self.session.open(muntumedia)
            elif auswahl == 'Vipgoal':
                self.session.open(vipgoal)
            elif auswahl == 'FreeTVStream':
                self.session.open(freetvstream)
            elif auswahl == 'Iranproud':
                self.session.open(iranproud)
            elif auswahl == 'Saraydorf':
                self.session.open(saraydorf)
            elif auswahl == 'Tumarcador':
                self.session.open(tumarcador)
            elif auswahl == 'AllTVFR':
                self.session.open(alltvfr)
            elif auswahl == 'Dizi':
                self.session.open(dizi)
            elif auswahl == 'Urhd.tv':
                self.session.open(urhd)
            elif auswahl == 'SportsPlayer':
                self.session.open(sportsplayer)
            elif auswahl == 'TVMak':
                self.session.open(tvmakplayer)
            elif auswahl == 'OnTV - Player':
                self.session.open(ontvplayer)
            elif auswahl == 'EliteHD':
                self.session.open(elitehd)
            elif auswahl == 'IPTVFree':
                self.session.open(iptvfree)
            elif auswahl == 'Shqiptv':
                self.session.open(shqiptv)
            elif auswahl == 'SportsTV.club':
                self.session.open(sportstvclub)
            elif auswahl == 'elahmad':
                self.session.open(elahmad)
            elif auswahl == 'livestream':
                self.session.open(livestream)
            elif auswahl == 'streamcloud_paste':
                self.session.open(streamcloud_paste)
            elif auswahl == 'ad_sports':
                self.session.open(ad_sports)
            elif auswahl == 'C247.to':
                self.session.open(c247)
            elif auswahl == 'Goal2HD':
                self.session.open(goal2hd)
            elif auswahl == 'seirsanduk':
                self.session.open(seirsanduk)
            elif auswahl == 'Streamkiste':
                self.session.open(streamkiste)
            #elif auswahl == 'Polish IPTV':
            #    self.session.open(polish)
            elif auswahl == 'Filme-Streamz':
                self.session.open(filmestreamz)
            elif auswahl == 'NetTVPlayer':
                self.session.open(nettvplayer)
            elif auswahl == 'Castfree.me':
                self.session.open(castfree)
            elif auswahl == 'TVShqip':
                self.session.open(tvshqip)
            elif auswahl == 'TVPlayerLatino':
                self.session.open(tvplayerlatino)
            elif auswahl == 'FilmCuks':
                self.session.open(filmcuks)
            elif auswahl == 'crimazlive':
                self.session.open(crimazlive)
            elif auswahl == 'Sport365 Live':
                self.session.open(sport365)
            elif auswahl == 'Kurdtvs':
                self.session.open(kurdtvs)
            elif auswahl == 'WatchWrestlingUP':
                self.session.open(watchwrestlingup)
            elif auswahl == 'SolidStreamz':
                self.session.open(solidstreamz)
            elif auswahl == 'LiveTVHD':
                self.session.open(livetvhd)
            elif auswahl == 'Kumanda':
                self.session.open(kumanda)
            elif auswahl == 'Mcanlitv':
                self.session.open(mcanlitv)
            elif auswahl == 'Tata.to':
                self.session.open(tata)
            elif auswahl == 'HDFreeTV':
                self.session.open(hdfreetv)
            elif auswahl == 'Karwan.tv':
                self.session.open(karwan)
            elif auswahl == '247 HD':
                self.session.open(sport247hd)
            elif auswahl == 'Ustreamix':
                self.session.open(ustreamix)
            elif auswahl == 'Skyline Webcams':
                self.session.open(skylinewebcams)
            elif auswahl == 'Kineskop':
                self.session.open(kineskop)
            return

    def keyCancel(self):
        self.close(self.session, True)

    def restart(self):
        self.close(self.session, False)

    def about(self):
        self.session.open(AboutScreen)


def main(session, **kwargs):
    session.open(Albatros)


def Plugins(path, **kwargs):
    global plugin_path
    plugin_path = path
    return [PluginDescriptor(name='Albatros', description='Entertainment without frontiers', where=[PluginDescriptor.WHERE_EXTENSIONSMENU], fnc=main), PluginDescriptor(name='Albatros', description='Entertainment without frontiers', where=[PluginDescriptor.WHERE_PLUGINMENU], fnc=main, icon='plugin.png')]