def test_channel_highlights(self): provider = Provider() # test root of highlights context = kodion.Context(path='/pro7/highlights/') result = provider.navigate(context) items = result[0] self.assertEqual(3, len(items)) print_items(items) # test 'Beliebte Sendungen' of highlights context = kodion.Context(path='/pro7/highlights/Beliebte Sendungen/') result = provider.navigate(context) items = result[0] self.assertGreater(len(items), 0) print_items(items) # test 'Aktuelle ganze Folgen' of highlights context = kodion.Context( path='/pro7/highlights/Aktuelle ganze Folgen/') result = provider.navigate(context) items = result[0] self.assertGreater(len(items), 0) print_items(items) # test 'Neueste Clips' of highlights context = kodion.Context(path='/pro7/highlights/Neueste Clips/') result = provider.navigate(context) items = result[0] self.assertGreater(len(items), 0) print_items(items) pass
def test_root(self): provider = Provider() context = kodion.Context('/') settings = context.get_settings() settings.set_string(kodion.constants.setting.LOGIN_USERNAME, '') # without login result = provider.navigate(context) items = result[0] self.assertEqual(2, len(items)) print_items(items) # with login context = kodion.Context('/') settings = context.get_settings() settings.set_string(kodion.constants.setting.LOGIN_USERNAME, '*****@*****.**') settings.set_string(kodion.constants.setting.LOGIN_PASSWORD, '1234567890') result = provider.navigate(context) items = result[0] self.assertEqual(4, len(items)) print_items(items) pass
def test_format_content(self): provider = Provider() # test full context = kodion.Context(path='/pro7/library/789/') context.get_function_cache()._clear() result = provider.navigate(context) items = result[0] self.assertGreater(len(items), 2) options = result[1] self.assertTrue(not provider.RESULT_CACHE_TO_DISC in options) print_items(items) # test clips context = kodion.Context(path='/pro7/library/789/', params={'clip_type': 'short'}) result = provider.navigate(context) items = result[0] self.assertGreater(len(items), 0) options = result[1] self.assertTrue(not provider.RESULT_CACHE_TO_DISC in options) print_items(items) # test backstage context = kodion.Context(path='/pro7/library/789/', params={'clip_type': 'webexclusive'}) result = provider.navigate(context) items = result[0] self.assertGreater(len(items), 0) options = result[1] self.assertTrue(not provider.RESULT_CACHE_TO_DISC in options) print_items(items) pass
def test_search(self): provider = Provider() path = '/%s/query/' % kodion.constants.paths.SEARCH context = kodion.Context(path=path, params={'q': 'halligalli'}) result = provider.navigate(context) pass
def test_get_video_streams_mixed(self): client = YouTube() context = kodion.Context() # some videos streams = client.get_video_streams(context, 'Hp0gI8KJw20') self.assertGreater(len(streams), 0) # Couch Tomato videos won't play streams = client.get_video_streams(context, 'xtPPggoKZjU') self.assertGreater(len(streams), 0) streams = client.get_video_streams(context, 'OSUy2uA6fbw') self.assertGreater(len(streams), 0) streams = client.get_video_streams(context, 'niBvN80Jqkg') self.assertGreater(len(streams), 0) # 60fps streams = client.get_video_streams(context, '_zPm3SSj6W8') self.assertGreater(len(streams), 0) # 1080p ?!? streams = client.get_video_streams(context, 'qfPUVz_Hpqo') self.assertGreater(len(streams), 0) # Restricted? streams = client.get_video_streams(context, 'U4DbJWA9JEw') self.assertGreater(len(streams), 0) pass
def test_rtl_formats(self): context = kodion.Context(path='/rtl/formats/') provider = Provider() result = provider.navigate(context) list = result[0] self.assertGreater(len(list), 0) pass
def test_get_video_streams_vevo(self): client = YouTube() context = kodion.Context() # ranadom stuff streams = client.get_video_streams(context, 'VznAYy5yL2A') #streams = client.get_video_streams(context, 'FlvtHMO6XHY') #streams = client.get_video_streams(context, 'zyg0WUsY9HI') # Exception: Sign in to confirm your age #streams = client.get_video_streams(context, 'B3eAMGXFw1o') # VEVO #streams = client.get_video_streams(context, 'YQHsXMglC9A') #streams = client.get_video_streams(context, 'VHrLPs3_1Fs') #streams = client.get_video_streams(context, 'a3ir9HC9vYg') #streams = client.get_video_streams(context, 'nfWlot6h_JM') self.assertGreater(len(streams), 0) # VEVO (Restricted) #streams = client.get_video_streams(context, 'O-zpOMYRi0w') self.assertGreater(len(streams), 0) #streams = client.get_video_streams(context, 'NmugSMBh_iI') self.assertGreater(len(streams), 0) # VEVO Gema # blocked (gema) #streams = client.get_video_streams(context, 'XbiH6pQI7pU') #self.assertGreater(len(streams), 0) pass
def test_get_video_streams(self): client = YouTube() context = kodion.Context() #Live streams = client.get_video_streams(context, 'RqbyYOCAFJU') #streams = client.get_video_streams(context, 'pvEWZY3Eqsg') # VEVO #streams = client.get_video_streams(context, 'nfWlot6h_JM') # 60fps # streams = client.get_video_streams(context, '_zPm3SSj6W8') # 1080p ?!? # streams = client.get_video_streams(context, 'qfPUVz_Hpqo') # Restricted? #streams = client.get_video_streams(context, 'U4DbJWA9JEw') # VEVO (Restricted) #streams = client.get_video_streams(context, 'O-zpOMYRi0w') #streams = client.get_video_streams(context, 'NmugSMBh_iI') # VEVO Gema #streams = client.get_video_streams(context, 'XbiH6pQI7pU') pass
def test_get_video_streams_vevo(self): client = YouTube() context = kodion.Context() # FLASH? streams = client.get_video_streams(context, 'B3eAMGXFw1o') streams = client.get_video_streams(context, 'zyg0WUsY9HI') # VEVO streams = client.get_video_streams(context, 'nfWlot6h_JM') self.assertGreater(len(streams), 0) # VEVO (Restricted) streams = client.get_video_streams(context, 'O-zpOMYRi0w') self.assertGreater(len(streams), 0) streams = client.get_video_streams(context, 'NmugSMBh_iI') self.assertGreater(len(streams), 0) # VEVO Gema # blocked (gema) #streams = client.get_video_streams(context, 'XbiH6pQI7pU') #self.assertGreater(len(streams), 0) pass
def test_on_search_playlist(self): provider = Provider() path = kodion.utils.create_path(kodion.constants.paths.SEARCH, 'query') context = kodion.Context(path=path, params={ 'q': 'lgr', 'search_type': 'playlist' }) result = provider.navigate(context) items = result[0] self.assertGreater(len(items), 0) kodion.utils.print_items(items) context = context.clone(new_path=path, new_params={ 'q': 'lgr', 'search_type': 'playlist', 'page_token': 'CDIQAA' }) result = provider.navigate(context) items = result[0] self.assertGreater(len(items), 0) kodion.utils.print_items(items) pass
def test_resolve_urls_2(self): description = ( 'An wild and bizarre adventure through the unreal and the unforgiving... HURRAY!!\n' 'MORE Scary Games ► https://www.youtube.com/playlist?list=PL3tRBEVW0hiBSFOFhTC5wt75P2BES0rAo\n' 'Exmortis ► https://youtu.be/GdhfwW5zHEY\n' 'The House ► https://youtu.be/eQxgWut4T4c\n' 'Subscribe Today! ► http://bit.ly/Markiplier\n' '\n' 'Play the Game ► http://www.newgrounds.com/portal/view/654784\n' '\n' 'You Might Also Like ▼\n' 'Markiplier Highlights - https://www.youtube.com/redirect?q=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9DKZbZyW2-g%26list%3DPL3tRBEVW0hiAOf_drlpS1hqZjJknW88cB%26index%3D1&redir_token=IBH7ovJdGv031f2JRlnYAKfq0m98MTQyODE1NjI2MEAxNDI4MDY5ODYw\n' 'Horror Compilations - https://www.youtube.com/redirect?q=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dp03A7QTBuhg%26list%3DPL58D8AC6A97A69F45%26index%3D1&redir_token=IBH7ovJdGv031f2JRlnYAKfq0m98MTQyODE1NjI2MEAxNDI4MDY5ODYw\n' 'Happy Wheels - https://www.youtube.com/redirect?q=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DveIB_RI8yMY%26list%3DPL3tRBEVW0hiBMoF9ihuu-x_aQVXvFYHIH%26index%3D2&redir_token=IBH7ovJdGv031f2JRlnYAKfq0m98MTQyODE1NjI2MEAxNDI4MDY5ODYw' '\n' 'Follow my Instagram ► http://instagram.com/markipliergram\n' 'Follow me on Twitter ► https://twitter.com/markiplier\n' 'Like me on Facebook ► https://www.facebook.com/markiplier\n' '\n' 'T-Shirts ► http://1shirt.com/collections/markiplier/products/markiplier-warfstache\'' 'Livestreams ► http://www.twitch.tv/markiplier') res_urls = [] urls = extract_urls(description) context = kodion.Context() resolver = UrlResolver(context) for url in urls: res_urls.append(resolver.resolve(url)) pass pass
def test_get_video_streams_restricted(self): client = YouTube() context = kodion.Context() streams = client.get_video_streams(context, 'oRSijEW_cDM') self.assertGreater(len(streams), 0)
def test_get_streams_live_streams(self): client = YouTube() context = kodion.Context() # working with old addon streams = client.get_video_streams(context, 'Hrc4rwZ29y4') #Live # blocked #streams = client.get_video_streams(context, 'y1knc30OqKQ') #self.assertGreater(len(streams), 0) # blocked #streams = client.get_video_streams(context, '7UFbGKo21lc') #self.assertGreater(len(streams), 0) # private #streams = client.get_video_streams(context, 'RqbyYOCAFJU') #self.assertGreater(len(streams), 0) #streams = client.get_video_streams(context, 'P8-yDTXnXAI') #self.assertGreater(len(streams), 0) #streams = client.get_video_streams(context, 'pvEWZY3Eqsg') #self.assertGreater(len(streams), 0) pass
def test_rtl_format_alles_was_zaehlt(self): context = kodion.Context(path='/rtl/format/1/', params={'seoUrl': 'alles-was-zaehlt'}) provider = Provider() result = provider.navigate(context) list = result[0] self.assertGreater(len(list), 0) pass
def test_rtl_format_gzsz(self): context = kodion.Context(path='/rtl/format/1/', params={'seoUrl': 'gzsz'}) provider = Provider() result = provider.navigate(context) list = result[0] self.assertGreater(len(list), 0) pass
def test_search(self): provider = Provider() path = '/%s/query/' % kodion.constants.paths.SEARCH context = kodion.Context(path=path, params={'q': 'angerfist'}) context.set_localization(30516, 'TEST %s') result = provider.navigate(context) pass
def test_on_channel(self): provider = Provider() path = kodion.utils.create_path('channel', 'UCDbAn9LEzqONk__uXA6a9jQ') context = kodion.Context(path=path) result = provider.navigate(context) items = result[0] pass
def test_extract_meta_info(self): client = YouTube() context = kodion.Context() # some via 'get_video_info' video_info = VideoInfo(context) video_streams = video_info._method_get_video_info('d5i0ZMMbkZY') pass
def test_play(self): provider = Provider() path = kodion.utils.create_path('play') context = kodion.Context(path=path, params={'video_id': 'puMYeBRTsHs'}) result = provider.navigate(context) items = result[0] pass
def test_feed(self): provider = Provider() context = kodion.Context(path='/show/2786742/') result = provider.navigate(context) items = result[0] kodion.utils.print_items(items) pass
def test_on_channel_playlist(self): provider = Provider() path = kodion.utils.create_path('channel', 'some_channel_id', 'playlist', 'UUDbAn9LEzqONk__uXA6a9jQ') context = kodion.Context(path=path) context.set_localization(30502, 'Go to %s') result = provider.navigate(context) items = result[0] pass
def test_play(self): provider = Provider() path = kodion.utils.create_path('play') context = kodion.Context(path=path, params={'video_id': 'ZCBlKMZLxZA'}) context.set_localization(30502, 'Go to %s') result = provider.navigate(context) items = result[0] pass
def test_get_fanarts(self): provider = Provider() context = kodion.Context() resource_manager = ResourceManager(context, provider.get_client(context)) resource_manager.clear() fanarts = resource_manager.get_fanarts(['UCDbAn9LEzqONk__uXA6a9jQ', 'UC8i4HhaJSZhm-fu84Bl72TA']) fanarts = resource_manager.get_fanarts(['UCDbAn9LEzqONk__uXA6a9jQ', 'UC8i4HhaJSZhm-fu84Bl72TA']) pass
def test_get_related_playlists(self): provider = Provider() context = kodion.Context() resource_manager = ResourceManager(context, provider.get_client(context)) resource_manager.clear() playlists = resource_manager.get_related_playlists('UCDbAn9LEzqONk__uXA6a9jQ') playlists = resource_manager.get_related_playlists('UCDbAn9LEzqONk__uXA6a9jQ') pass
def _create_context(self, path): context = kodion.Context(path=path) settings = context.get_settings() settings.set_string(kodion.constants.setting.LOGIN_USERNAME, '*****@*****.**') settings.set_string(kodion.constants.setting.LOGIN_PASSWORD, '1234567890') settings.set_string(kodion.constants.setting.ACCESS_TOKEN, self.TOKEN) return context
def test_channel_by_name(self): provider = Provider() path = kodion.utils.create_path('user', 'Gronkh') context = kodion.Context(path=path) context.set_localization(30502, 'Go to %s') result = provider.navigate(context) items = result[0] pass
def test_description_links(self): provider = Provider() path = kodion.utils.create_path('special', 'description_links') context = kodion.Context(path=path, params={'video_id': 'QEwEWKbWnaQ'}) context.set_localization(30502, 'Go to %s') result = provider.navigate(context) items = result[0] pass
def test_on_root(self): provider = Provider() context = kodion.Context(path='/') result = provider.navigate(context) items = result[0] kodion.utils.print_items(items) pass
def test_playlist(self): provider = Provider() path = kodion.utils.create_path('playlist', 'LL9DDFrb_dGvEvcTrzNn5LpA') context = kodion.Context(path=path) context.set_localization(30502, 'Go to %s') result = provider.navigate(context) items = result[0] pass
def test_play(self): provider = Provider() path = kodion.utils.create_path('play') context = kodion.Context(path=path, params={'video_id': '127708722'}) context.get_settings().set_int(kodion.constants.setting.VIDEO_QUALITY, 3) context.set_localization(30511, 'Go to %s') result = provider.navigate(context) items = result[0] pass