Exemple #1
0
    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_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
Exemple #3
0
    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_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
Exemple #5
0
    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_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_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_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 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
Exemple #12
0
    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
Exemple #13
0
    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
Exemple #14
0
    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
Exemple #15
0
    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_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_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
Exemple #18
0
    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
Exemple #19
0
    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
Exemple #20
0
    def test_on_search_video(self):
        provider = Provider()

        path = kodion.utils.create_path(kodion.constants.paths.SEARCH, 'query')
        context = kodion.Context(path=path, params={'q': 'lgr'})
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        kodion.utils.print_items(items)
        pass
    def test_on_search_video(self):
        provider = Provider()

        path = kodion.utils.create_path(kodion.constants.paths.SEARCH, 'query')
        context = kodion.Context(path=path, params={'q': 'lgr'})
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        kodion.utils.print_items(items)
        pass
Exemple #22
0
    def test_on_root(self):
        provider = Provider()

        context = kodion.Context(path='/')
        result = provider.navigate(context)

        items = result[0]
        self.assertGreater(len(items), 0)

        kodion.utils.print_items(items)
        pass
    def test_on_root(self):
        provider = Provider()

        context = kodion.Context(path='/')
        result = provider.navigate(context)

        items = result[0]
        self.assertGreater(len(items), 0)

        kodion.utils.print_items(items)
        pass
    def test_on_search(self):
        provider = Provider()

        path = kodion.utils.create_path('search')
        context = kodion.Context(path=path, params={'q': 'The Breakfast Club é Extras'})
        context.set_localization(30502, 'Go to %s')
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        kodion.utils.print_items(items)
        pass
Exemple #25
0
    def test_on_search(self):
        provider = Provider()

        path = kodion.utils.create_path('search')
        context = kodion.Context(path=path,
                                 params={'q': 'The Breakfast Club é Extras'})
        context.set_localization(30502, 'Go to %s')
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        kodion.utils.print_items(items)
        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
Exemple #27
0
    def test_complete_sequence(self):
        description = 'Subscribe to TRAILERS: http://bit.ly/sxaw6h Catch up with the hottest trailers from the past month in our original epic mashup! Subscribe to COMING SOON: http://bit.ly/H2vZUn Check out all the BEST TRAILER MASHUPS: http://bit.ly/JyKssP Best New Movie Trailers - February 2014 HD Music Credits: Empty Thoughts Over A Shallow Ocean - Ryan Hemsworth https://soundcloud.com/ryanhemsworth Sittin In The Park - Burning Bright ft. 1SP & Symatic (http://freemusicarchive.org/music/Burning_Bright_ft_1SP__Symatic/BLM50_RAISE_THE_BLACK_LANTERN/Black_Lantern_Music_-_BLM-50_RAISE_THE_BLACK_LANTERN_-_07_Sittin_In_The_Park) The Returned http://goo.gl/axzVNr Pompeii http://goo.gl/gMjs2g Battle Of The Damned http://goo.gl/SzNOOs 300: Rise Of An Empire http://goo.gl/h0pT0k Dom Hemingway http://goo.gl/mmzDL6 Triptyque http://goo.gl/zWHxSr The Missing Picture http://goo.gl/TyD5Ul Run & Jump http://goo.gl/gF2QRd The Bag Man http://goo.gl/NV1Jmx The Wait http://goo.gl/3RdT5G The Quiet Roar http://goo.gl/uxq0YD The Raid 2 Berandal http://goo.gl/Sf9XV2 Only Lovers Left Alive http://goo.gl/fg1FgL The Legend of Hercules http://goo.gl/TF7csz Better Living Through Chemistry http://goo.gl/yDBy0E Dead Snow Red vs Dead http://goo.gl/rfJ4f4 Robocop http://goo.gl/hVLLMl Mr X http://goo.gl/bcaSUP Maleficent http://goo.gl/RjJ02i The Lego Movie http://goo.gl/syqxkU Swim Little Fish Swim http://goo.gl/MaSVZz Street Society http://goo.gl/T52aQg Jack Ryan Shadow Recruit http://goo.gl/KVxCP4 Snowpiercer http://goo.gl/8X510l Starred Up http://goo.gl/mfgcWw I, Frankenstein http://goo.gl/0IiCV1 Easy Money Hard To Kill http://goo.gl/BrYTmV American Hustle http://goo.gl/1q581W Visitors http://goo.gl/t6VIfG Walk of Shame http://goo.gl/Idfekc Tide Lines http://goo.gl/zFAa5G The Monkey King http://goo.gl/UQTKuu Enemy http://goo.gl/RRjpCO Make Your Move http://goo.gl/lnoa1d The Bag Man http://goo.gl/NV1Jmx Particle Fever http://goo.gl/dJQAAY The Desert Fish http://goo.gl/0kE7CT The Unknown Known http://goo.gl/ZsswPf Stray Dogs http://goo.gl/BI2h3W Rhymes for Young Ghouls http://goo.gl/ux0p5M Our Man In Tehran http://goo.gl/hdUyZh Rio 2 http://goo.gl/8ELaQn Abuse of Weakness http://goo.gl/filvWj After The Dark http://goo.gl/mquNHn All Hail the King http://goo.gl/O0IzmE Summer in February http://goo.gl/2HJe0L The Missing Picture http://goo.gl/TyD5Ul Bad Words http://goo.gl/ILnyAF Tracks http://goo.gl/zWHxSr The Railway Man http://goo.gl/ankLLE The Suspect http://goo.gl/89MaEJ The Amazing Catfish http://goo.gl/UEPOQr The Better Angels http://goo.gl/YqnHU2 The Strange Little Cat http://goo.gl/SkrTgr The Pretty One http://goo.gl/JYZRGC About Last Night http://goo.gl/LjpHUu Silent But Deadly http://goo.gl/X8Ht2F Elaine Stritch Shoot Me http://goo.gl/j19ybM movieclips movie clips movieclipstrailers trailers hd "best new trailers" "new trailers" trailers hd 300 "300 rise of an empire" "the raid 2" "i frankenstein" "american hustle" "dead snow 2" robocop enemy "jake gyllenhaal" maleficent "mr x" "leos carax" "better living through chemistry" "jack ryan" "stray dogs" shellsyo'
        urls = extract_urls(description)
        context = kodion.Context()
        resolver = UrlResolver(context)
        res_urls = []
        for url in urls:
            res_urls.append(resolver.resolve(url))
            pass
        pass

        provider = Provider()
        context.set_localization(30502, 'Go to %s')
        url_converter = UrlToItemConverter(flatten=True)
        url_converter.add_urls(res_urls, provider, context)
        items = url_converter.get_items(provider, context)
        pass