chore(performance): Further speed up of imports
[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.NetflixSession import NetflixSession
8 from resources.lib.KodiHelper import KodiHelper
9 from resources.lib.Navigation import Navigation
10 from resources.lib.Library import Library
11
12 # Setup plugin
13 plugin_handle = int(sys.argv[1])
14 base_url = sys.argv[0]
15
16 # init plugin libs
17 kodi_helper = KodiHelper(
18     plugin_handle=plugin_handle,
19     base_url=base_url
20 )
21 netflix_session = NetflixSession(
22     cookie_path=kodi_helper.cookie_path,
23     data_path=kodi_helper.data_path,
24     verify_ssl=kodi_helper.get_ssl_verification_setting(),
25     log_fn=kodi_helper.log
26 )
27 library = Library(
28     root_folder=kodi_helper.base_data_path,
29     library_settings=kodi_helper.get_custom_library_settings(),
30     log_fn=kodi_helper.log
31 )
32 navigation = Navigation(
33     netflix_session=netflix_session,
34     kodi_helper=kodi_helper,
35     library=library,
36     base_url=base_url,
37     log_fn=kodi_helper.log
38 )
39 kodi_helper.set_library(library=library)
40
41 if __name__ == '__main__':
42     # Call the router function and pass the plugin call parameters to it.
43     # We use string slicing to trim the leading '?' from the plugin call paramstring
44     kodi_helper.log('started')
45     navigation.router(paramstring=sys.argv[2][1:])