def main(): """ Before running the plugin we need to check if there is any module to load on the fly (e.g. mytf1.py) (To prevent error when coming from a "favorite" Kodi item) """ cqu.import_needed_module() """ Then we let CodeQuick check for functions to register and call the correct function according to the Kodi URL """ run()
def main(): """Entry point function executed by Kodi for each menu of the addon""" # Let CodeQuick check for functions to register and call # the correct function according to the Kodi URL exception = run() if isinstance(exception, Exception): main = importlib.import_module('resources.lib.main') main.error_handler(exception)
def main(): """ Before calling run() function of codequick, we need to check if there is any module to load on the fly """ cqu.import_needed_module() """ Then we let CodeQuick check for functions to register and call the correct function according to the Kodi URL """ exception = run() if isinstance(exception, Exception): error_handler(exception)
def main(): """Entry point function executed by Kodi for each menu of the addon """ """ Before calling run() function of codequick, we need to check if there is any module to load on the fly """ import_needed_module() """ Then we let CodeQuick check for functions to register and call the correct function according to the Kodi URL """ exception = run() if isinstance(exception, Exception): main = importlib.import_module('resources.lib.main') main.error_handler(exception)
if 'search_on' in channel: link.set_callback(user_input, url=channel['playlist_url']) else: link.set_callback(open_site, url=channel['playlist_url']) elif 'stream_url' in channel: link.set_callback(play_media, url=channel['stream_url']) yield link @Route.register def play_media(plugin, url): print(url) item = Listitem(content_type='video') item.label = "Play" item.set_callback(url) yield item @Route.register def user_input(plugin, url): item = Listitem() yield item.search(open_site, url) if __name__ == "__main__": run()
plugin.category = plugin.localize(TAGS) url = url_constructor(url) source = urlquick.get(url) # Parse all video tags root_elem = source.parse("div", attrs={"id": "tags"}) for elem in root_elem.iterfind("a"): item = Listitem() item.label = elem.text.title() item.set_callback(video_list, url="%s1" % elem.get("href")) yield item @Resolver.register def play_video(plugin, url): """ Resolve video url. site: https://www.watchmojo.com/video/id/19268/ :param Resolver plugin: Tools related to Resolver callbacks. :param unicode url: The url to a video. :return: A playable video url. """ url = url_constructor(url) return plugin.extract_source(url) if __name__ == "__main__": run()
def __init__(self): # Fetch uuid for favorites tag favuuid = tvh.tags()["favorites"] # Fetch uuid of selected channel selectedUUID = self[u"uuid"] # Loop all channels till the selected channel is found for channel in tvh.request_channel_grid()["entries"]: if channel["uuid"] == selectedUUID: currentTags = channel["tags"] # Remove favorites tag from channel if favuuid in currentTags: currentTags.remove(favuuid) # Add favorites tag to channnel else: currentTags.append(favuuid) # Save the channel changes tvh.save_entry([{"tags":currentTags, "uuid":selectedUUID}]) break # Refresh the Container listings to update color markers self.utils.container_refresh() # Initiate Startup if __name__ == "__main__": codequick.run(debug=True)