chore(performance): Removes NetflixSession from the core addon & adds a HTTP proxy...
[plugin.video.netflix.git] / addon.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 # Module: default
4 # Created on: 13.01.2017
5
6 import sys
7 from resources.lib.KodiHelper import KodiHelper
8 from resources.lib.Navigation import Navigation
9 from resources.lib.Library import Library
10
11 # Setup plugin
12 plugin_handle = int(sys.argv[1])
13 base_url = sys.argv[0]
14
15 # init plugin libs
16 kodi_helper = KodiHelper(
17     plugin_handle=plugin_handle,
18     base_url=base_url
19 )
20 library = Library(
21     root_folder=kodi_helper.base_data_path,
22     library_settings=kodi_helper.get_custom_library_settings(),
23     log_fn=kodi_helper.log
24 )
25 navigation = Navigation(
26     kodi_helper=kodi_helper,
27     library=library,
28     base_url=base_url,
29     log_fn=kodi_helper.log
30 )
31 kodi_helper.set_library(library=library)
32
33 if __name__ == '__main__':
34     # Call the router function and pass the plugin call parameters to it.
35     # We use string slicing to trim the leading '?' from the plugin call paramstring
36     kodi_helper.log('started')
37     navigation.router(paramstring=sys.argv[2][1:])