def Dependency_OpenSettings(): DepList = [str(addon_id)] dependencies = koding.Dependency_Check(addon_id=addon_id, recursive=True) addons_path = koding.Physical_Path('special://home/addons/') for dependacy in dependencies: if not dependacy in DepList: DepList.append(dependacy) path = str(addons_path) + str( dependacy) + '/resources/settings.xml' if xbmcvfs.exists(path): try: Addon = xbmcaddon.Addon(str(dependacy)) AddonTitle = Addon.getAddonInfo('name') AddonFanart = Addon.getAddonInfo('fanart') AddonIcon = Addon.getAddonInfo('icon') koding.dolog(str(AddonTitle) + ' has file ' + str(path), line_info=True) BYB.addDir_file( ItemColor('{} {}'.format(local_string(30073), AddonTitle)), dependacy, 103, AddonIcon, AddonFanart, '{} {}'.format(local_string(30073), AddonTitle), '', '', '') except: pass
def index(): RunScrapers() for results in scraper.sources: title = results.get('Name', 'Name Missing') title = title.encode('utf-8') playlink = results.get('playlink', '') icon = results.get('img', paths.icon) BYB.addDir_file(title, playlink, 110, icon, paths.fanart, '', '', '', '')
def index(iconimage, fanart): BYB.addDir_file('Open settings', '', 100, iconimage, fanart, 'Open settings for addon', '', '', '') BYB.addDir_file('Delete Cookies', '', 101, iconimage, fanart, 'Clear all Cookies from Cookie cache', '', '', '') BYB.addDir('Dependencies OpenSettings', '', 102, iconimage, fanart, 'Open settings of all dependencies required by this addon', '', '', '') xbmcplugin.endOfDirectory(int(sys.argv[1]))
def videos(url,fanart): YouTube_Scraper.channel_video(url) for items in YouTube_Scraper.CHANNEL_VIDEO: title = items.get('title','Title Missing') playlink = items.get('playlink','') icon = items.get('icon','') date = items.get('date','') description = items.get('description','') BYB.addDir_file(ItemColor(title),playlink,33,icon,fanart,description,'',date,'') del YouTube_Scraper.CHANNEL_VIDEO[:]
def search(search_item=None): if search_item == None: search_item = koding.Keyboard(heading=SingleColor(local_string(30053),_Edit.DialogBoxColor1)) koding.dolog('search item = %s'%search_item,line_info=True) fanart = addon_fanart if _Edit.YT_SearchFanart == '' else _Edit.YT_SearchFanart YouTube_Scraper.search(search_item) for items in YouTube_Scraper.SEARCH_VIDEO: title = items.get('title','Title Missing') playlink = items.get('playlink','') icon = items.get('icon') BYB.addDir_file(ItemColor(title),playlink,33,icon,fanart,'','','','')
def channel_search(url,fanart): search_item = koding.Keyboard(heading=SingleColor(local_string(30053),_Edit.DialogBoxColor1)) koding.dolog('search item = %s'%search_item,line_info=True) YouTube_Scraper.channel_search(url,search_item) for items in YouTube_Scraper.CHANNEL_SEARCH: title = items.get('title','Title Missing') playlink = items.get('playlink','') icon = items.get('artwork','') date = items.get('date','') description = items.get('description','') BYB.addDir_file(ItemColor(title),playlink,33,icon,fanart,description,'',date,'')
def index(iconimage, fanart): BYB.addDir_file(ItemColor(local_string(30059)), '', 100, icon_Setting, fanart_Setting, local_string(30068), '', '', '') BYB.addDir_file(ItemColor(local_string(30060)), '', 101, icon_Setting, fanart_Setting, local_string(30069), '', '', '') BYB.addDir(ChannelColor(local_string(30061)), '', 102, icon_Setting, fanart_Setting, local_string(30070), '', '', '') BYB.addDir_file(ItemColor(local_string(30079)), '', 104, icon_Setting, fanart_Setting, '', '', '', '') BYB.addDir_file(ItemColor(local_string(30080)), '', 105, icon_Setting, fanart_Setting, '', '', '', '') BYB.addDir_file(ItemColor('Pairing Tool'), '', 106, icon_Setting, fanart_Setting, '', '', '', '') xbmcplugin.endOfDirectory(int(sys.argv[1]))
def livesport_scrape_lists(url): from resources.lib.scrapers import streamshunter streamshunter = streamshunter.streamshunter() streamshunter.getmatch_and_streams(url) for results in streamshunter.Events: EventTime = results.get('event_time', 'Event Time Missing') EventName = results.get('event_name', 'Event Name Missing') PlayName = results.get('playname', 'Link Name Missing') PlayLink = results.get('playlink', '') if len(PlayLink) > 0: FullName = '[COLOR red]%s[/COLOR] |[COLOR aqua] %s[/COLOR] |[COLOR lime] %s[/COLOR]' % ( EventTime, EventName, PlayName) BYB.addDir_file(FullName, PlayLink, 109, paths.icon, paths.fanart, '', '', '', '')
def retroclassic(): #call scraper from folder from .scrapers import retrovision #run scraper retrovision.all_movies() #return list of dicts from scraper for items in retrovision.ReturnList: #HTMLPareser cleans up any text that is still in html code Description = HTMLParser().unescape(items.get('description', '')) Description = Description.encode('utf-8') BYB.addDir_file(ItemColor(items.get('title', '')), items.get('playlink', ''), 902, items.get('icon', ''), addon_fanart, Description, '', '', '') del retrovision.ReturnList[:]
def AddEpisodes(url,fanart): if EnableListLenght == 'true': itemcount = PodcastRss.ItemCount(url) if itemcount > int(ListLenght): PodcastRss.Items(url,ListLenght) else: PodcastRss.Items(url) else: PodcastRss.Items(url) for item in PodcastRss.ITEM: koding.dolog(item,line_info=True) title = item.get('title','Title Missing') image = item.get('image','') description = item.get('description','description missing') date = item.get('date','') playlink = item.get('playlink','') icon,fanart = _image(image,fanart) BYB.addDir_file(title,playlink,33,icon,fanart,description,'Podcast','','')
def tool_index(): BYB.addDir_file('[COLOR red]Settings[/COLOR]', '', 100, paths.icon, paths.fanart, '', '', '', '') BYB.addDir_file('[COLOR red]Clear Cached password[/COLOR]', '', 104, paths.icon, paths.fanart, '', '', '', '') koding.dolog(settings.DEVMODE, line_info=True) if settings.DEVMODE == 'true': BYB.addDir_file('[COLOR red]Dev Mode tester[/COLOR]', '', 102, paths.icon, paths.fanart, '', '', '', '') xbmcplugin.endOfDirectory(int(sys.argv[1]))