예제 #1
0
	def Log_in(self):
		koding.dolog('Loggin setting = %s'%settings.LOGIN_PREF,line_info=True)
		if settings.LOGIN_PREF == 'Never':
			return True
		elif settings.LOGIN_PREF == 'Once':
			BYB.table_names_DB(self.file)
			if len(BYB.TableNames) > 0:
				for tables in BYB.TableNames:
					if self.table == tables:
						checkdb = 1
					else:
						checkdb = 0
			else:
				checkdb = 0
			if checkdb == 0:
				self.once_login()
				BYB.readall_DB(self.file,self.table)
			elif checkdb == 1:
				BYB.readall_DB(self.file,self.table)
			for results in BYB.DB_list:
				User = results[0]
				PassWord = results[1]
				if User == settings.USERNAME and PassWord == settings.PASSWORD:
					koding.Notify(title='Loggin', message='Loggin successful', icon=self.icon)
					return True
				else:
					koding.Notify(title='Loggin',message='Cached User and Password do not match ',icon=self.icon)
					return False
		elif settings.LOGIN_PREF == 'Always':
			User,PassWord = self.enter_login()
			if User == settings.USERNAME and PassWord == settings.PASSWORD:
			    koding.Notify(title='Loggin', message='Loggin successful', icon=self.icon)
			    return True
			else:
			    koding.Notify(title='Loggin', message='Log In Fail', icon=self.icon)
			    yes_no = koding.YesNo_Dialog(title='Log In',message='Loggin failed would you like to try again')
			    if yes_no:
			        self.LogInCount.append(1)
			        LogginCount = sum(self.LogInCount)
			        koding.dolog('Loggin count = %s'%LogginCount,line_info=True)
			        if  LogginCount >= 3:
			            koding.Notify(title='Loggin',message='Attempted to Loggin 3 times unseccesfully no adult content will be shown',icon=self.icon)
			            return False
			            del LogginCount [:]
			        else:
			            self.Log_in()
			    else:
			        return False
		else:
			return False
예제 #2
0
def output_folder():
    folder_name = koding.Keyboard(heading='Output Folder Name')
    folder_name = folder_name.replace(" ", "_")
    xml_folder = os.path.join(xml_path, folder_name)
    if os.path.exists(xml_folder):
         koding.Notify(title='Folder Already Exists', message='Choose a different folder', duration=5000)
         xml_folder = output_folder()
    else:
        os.mkdir(xml_folder, 0755)
        return folder_name    
예제 #3
0
def play(url, windowed, name=None):
    handled = False

    getIdle = int(ADDON.getSetting('idle').replace('Never', '0'))
    maxIdle = getIdle * 60 * 60

    dixie.SetSetting('streamURL', url)

    if 'tv/play_by_name_only_guide/' in url or 'movies/play_by_name_guide' in url or 'tv/play_by_name_guide/' in url:
        dixie.removeKepmap()
        xbmc.executebuiltin('XBMC.ActivateWindow(10025,%s)' % url)
        CheckIdle(maxIdle)

    else:
        dixie.loadKepmap()

        if url.startswith('HDTV'):
            import hdtv
            delay = 5
            stream = hdtv.getURL(url)

            if not playAndWait(stream, windowed, maxIdle, delay=delay):
                dixie.SetSetting('LOGIN_HDTV', '2001-01-01 00:00:00')
                stream = hdtv.getURL(url)
                playAndWait(stream, windowed, maxIdle, delay=delay)
            return

        if url.startswith('IPLAY'):
            import iplayer
            stream = iplayer.getURL(url)
            playAndWait(stream, windowed, maxIdle)
            return

        if url.startswith('IPTV:'):
            import iptv
            url = iptv.getURL(url)
            dixie.log(url)
            xbmc.executebuiltin('XBMC.RunPlugin(%s)' % url)
            return

        if url.startswith('UKTV'):
            import uktv
            stream = uktv.getURL(url)
            dixie.log(stream)
            playAndWait(stream, windowed, maxIdle)
            return

        if url.isdigit():
            command = (
                '{"jsonrpc": "2.0", "id":"1", "method": "Player.Open","params":{"item":{"channelid":%s}}}'
                % url)
            xbmc.executeJSONRPC(command)
            return

        if (url.startswith('__SF__')) or (
                'plugin://plugin.program.super.favourites' in url.lower()):
            handled, url = playSF(url)
            if handled:
                return

        if not checkForAlternateStreaming(url):
            my_playback = koding.Play_Video(url)
            if not my_playback:
                if CLEAN_STREAMS == 'true':
                    clean_ini(url)
            koding.Notify(title='PLAYBACK FAILED',
                          message='Please try another link',
                          duration=5000)
예제 #4
0
def del_cache_password():
    BYB.delete_table(filename=paths.CACHE_DB, table='login')
    koding.Notify(title='Loggin Cache',
                  message='Loggin cache successful cleared',
                  icon=paths.icon)