dimkroon / itvx-for-kodi

Kodi addon to watch ITVX
GNU General Public License v2.0
20 stars 3 forks source link

Attempting to play anything results in KeyError 'title' #39

Closed andrewbird closed 1 year ago

andrewbird commented 1 year ago

Hello, I'm a new user of both Kodi and this plugin, so I may be doing something stupid, but I'm having trouble getting this working with ITVX. Firstly I'm in the UK, login seems to work and I can see the various programs listed. I'm running the latest OSMC on a Raspberry PI 4 / 8GB with the 64bit image, booting off of SSD via USB, and the plugin is the latest (beta5). When attempting to play any program a notification appears that has the following text KeyError followed by 'title'. Are there any logs I can retrieve to help you diagnose the issue?

Thanks

dimkroon commented 1 year ago

Thanks for reporting this issue. You've done nothing wrong. Coincindentaly ITV as made some changes to their website today, causing, among others, the error you describe. Rather unfortunate for you first Kodi experience. I'm aware of the issue and working on a fix. I hope to have a new version before too long.

I won't need a log right now, but check out https://kodi.wiki/view/Log_file if you want to know where to find it. If you want to use the log to report an issue ensure to enable debug logging in settings > system > logging

andrewbird commented 1 year ago

Ahh I found how to collect some log, maybe this will help.

2023-08-02 19:09:38.501 T:1778    debug <general>: CAddonDatabase::SetLastUsed[plugin.video.viwx] took 18 ms                                                                 
2023-08-02 19:09:38.501 T:1780    debug <general>: CScriptRunner: running add-on script viwX('plugin://plugin.video.viwx/resources/lib/main/wrapper.list_productions/', '3', 
2023-08-02 19:09:38.501 T:1780    debug <general>: GetLanguageInvoker - Reusing LanguageInvokerThread 9 for script /home/osmc/.kodi/addons/plugin.video.viwx/addon.py        
2023-08-02 19:09:38.501 T:1765    debug <general>: initializing python engine.                                                                                               
2023-08-02 19:09:38.502 T:1765    debug <general>: CPythonInvoker(9, /home/osmc/.kodi/addons/plugin.video.viwx/addon.py): start processing                                   
2023-08-02 19:09:38.502 T:1765    debug <general>: CPythonInvoker(9): adding args:                                                                                           
2023-08-02 19:09:38.502 T:1765    debug <general>: CPythonInvoker(9):  plugin://plugin.video.viwx/resources/lib/main/wrapper.list_productions/                               
2023-08-02 19:09:38.502 T:1765    debug <general>: CPythonInvoker(9):  3                                                                                                     
2023-08-02 19:09:38.502 T:1765    debug <general>: CPythonInvoker(9):  ?_pickle_=80049562000000000000007d94288c075f7469746c655f948c0b4d616c7072616374696365948c0375726c948c2d
2023-08-02 19:09:38.502 T:1765    debug <general>: CPythonInvoker(9):  resume:false                                                                                          
2023-08-02 19:09:38.502 T:1765    debug <general>: CPythonInvoker(9, /home/osmc/.kodi/addons/plugin.video.viwx/addon.py): entering source directory /home/osmc/.kodi/addons/p
2023-08-02 19:09:38.502 T:1765    debug <general>: CPythonInvoker(9, /home/osmc/.kodi/addons/plugin.video.viwx/addon.py): instantiating addon using automatically obtained id
2023-08-02 19:09:38.503 T:1765    debug <general>: [viwX.support] [DEBUG] Dispatching to route: '/resources/lib/main/wrapper.list_productions/'                              
2023-08-02 19:09:38.503 T:1765    debug <general>: [viwX.support] [DEBUG] Callback parameters: '{'url': 'https://www.itv.com/watch/malpractice/10a2194', 'series_idx': 1}'   
2023-08-02 19:09:38.503 T:1765    debug <general>: [viwX.route] [DEBUG] Listitem Cache: Miss                                                                                 
2023-08-02 19:09:38.504 T:1765    debug <general>: [viwX.main] [DEBUG] wrapper diverts route to: list_productions                                                            
2023-08-02 19:09:38.504 T:1765    debug <general>: [viwX.main] [INFO] Getting productions for series '1' of 'https://www.itv.com/watch/malpractice/10a2194'                  
2023-08-02 19:09:38.504 T:1765    debug <general>: [viwX.cache] [DEBUG] Data cache: miss                                                                                     
2023-08-02 19:09:38.504 T:1765    debug <general>: [viwX.fetch] [DEBUG] Making GET request to https://www.itv.com/watch/malpractice/10a2194                                  
2023-08-02 19:09:38.510 T:1765    debug <general>: [urllib3.connectionpool] Starting new HTTPS connection (1): www.itv.com:443                                               
2023-08-02 19:09:38.523 T:562     debug <general>: CLibInputPointer::ProcessMotion - event.type: 3, event.motion.x: 761, event.motion.y: 416                                 
2023-08-02 19:09:38.584 T:541     debug <general>: ------ Window Init (DialogBusy.xml) ------                                                                                
2023-08-02 19:09:38.620 T:562     debug <general>: CLibInputPointer::ProcessMotion - event.type: 3, event.motion.x: 761, event.motion.y: 416                                 
2023-08-02 19:09:38.754 T:564      info <general>: Skipped 1 duplicate messages..                                                                                            
2023-08-02 19:09:38.754 T:564      info <general>: CActiveAESink::OpenSink - initialize sink                                                                                 
2023-08-02 19:09:38.755 T:564     debug <general>: CActiveAESink::OpenSink - trying to open device Default                                                                   
2023-08-02 19:09:38.755 T:564     error <general>: CActiveAESink::OpenSink - no sink was returned                                                                            
2023-08-02 19:09:38.755 T:563     error <general>: ActiveAE::InitSink - returned error                                                                                       
2023-08-02 19:09:38.764 T:562     debug <general>: CLibInputPointer::ProcessMotion - event.type: 3, event.motion.x: 761, event.motion.y: 416                                 
2023-08-02 19:09:38.781 T:1765    debug <general>: [urllib3.connectionpool] https://www.itv.com:443 "GET /watch/malpractice/10a2194 HTTP/1.1" 200 11977                      
2023-08-02 19:09:38.790 T:1765    debug <general>: [viwX.support] [DEBUG] Callbacks Execution Time: 0ms                                                                      
2023-08-02 19:09:38.791 T:1765    debug <general>: [viwX.support] [ERROR] 'title'                                                                                            
                                                   Traceback (most recent call last):                                                                                        
                                                     File "/home/osmc/.kodi/addons/script.module.codequick/lib/codequick/support.py", line 306, in run_callback              
                                                       redirect = parent_ins(route, arg_params, self.callback_params)                                                        
                                                     File "/home/osmc/.kodi/addons/plugin.video.viwx/resources/lib/cc_patch.py", line 29, in patched_call                    
                                                       original_call(self, route, args, kwargs)                                                                              
                                                     File "/home/osmc/.kodi/addons/plugin.video.viwx/resources/lib/cc_patch.py", line 29, in patched_call                    
                                                       original_call(self, route, args, kwargs)                                                                              
                                                     File "/home/osmc/.kodi/addons/plugin.video.viwx/resources/lib/cc_patch.py", line 29, in patched_call                    
                                                       original_call(self, route, args, kwargs)                                                                              
                                                     File "/home/osmc/.kodi/addons/script.module.codequick/lib/codequick/route.py", line 195, in __call__                    
                                                       results = super(Route, self).__call__(route, args, kwargs)                                                            
                                                     File "/home/osmc/.kodi/addons/script.module.codequick/lib/codequick/script.py", line 169, in __call__                   
                                                       return route.function(self, *args, **kwargs)                                                                          
                                                     File "/home/osmc/.kodi/addons/plugin.video.viwx/resources/lib/main.py", line 75, in wrapper                             
                                                       result = list(result)                                                                                                 
                                                     File "/home/osmc/.kodi/addons/plugin.video.viwx/resources/lib/main.py", line 315, in list_productions                   
                                                       series_map = itvx.episodes(url, use_cache=True)                                                                       
                                                     File "/home/osmc/.kodi/addons/plugin.video.viwx/resources/lib/itvx.py", line 223, in episodes                           
                                                       brand_data = get_page_data(url, cache_time=0)['title']['brand']                                                       
                                                   KeyError: 'title'                                                                                                         
2023-08-02 19:09:38.791 T:1765    debug <general>: .                                                                                                                         
2023-08-02 19:09:38.791 T:1780    error <general>: GetDirectory - Error getting plugin://plugin.video.viwx/resources/lib/main/wrapper.list_productions/?_pickle_=800495620000
2023-08-02 19:09:38.791 T:1765    debug <general>: CPythonInvoker(9, /home/osmc/.kodi/addons/plugin.video.viwx/addon.py): script successfully run                            
2023-08-02 19:09:38.791 T:1780    debug <general>: Thread waiting 3494899968 terminating                                                                                     
2023-08-02 19:09:38.796 T:562     debug <general>: CLibInputPointer::ProcessMotion - event.type: 3, event.motion.x: 761, event.motion.y: 416                                 
2023-08-02 19:09:38.797 T:541     debug <general>: ------ Window Deinit (DialogBusy.xml) ------                                                                              
2023-08-02 19:09:38.798 T:541     error <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.viwx/resources/lib/main/wrapper.list_productions/?_pickle_=80049562000
2023-08-02 19:09:38.798 T:541     debug <general>: CGUIMediaWindow::GetDirectory (plugin://plugin.video.viwx/)                                                               
2023-08-02 19:09:38.798 T:541     debug <general>:   ParentPath = [plugin://]                                                                                                
2023-08-02 19:09:38.798 T:1778    debug <general>: CAddonDatabase::SetLastUsed[plugin.video.viwx] took 0 ms                                                                  
2023-08-02 19:09:38.799 T:541     debug <general>: Loading items: 11, directory: plugin://plugin.video.viwx/ sort method: 0, ascending: false                                
2023-08-02 19:09:38.802 T:1781    debug <general>: Thread BackgroundLoader start, auto delete: false                                                                         
2023-08-02 19:09:38.809 T:1781    debug <general>: Thread BackgroundLoader 3545698560 terminating                                                                            
2023-08-02 19:09:38.831 T:541     debug <general>: ------ Window Init (DialogNotification.xml) ------                                                                        
2023-08-02 19:09:38.831 T:563   warning <general>: CActiveAE::StateMachine - signal: 1 from port: OutputDataPort not handled for state: 2                                    
2023-08-02 19:09:38.876 T:562     debug <general>: CLibInputPointer::ProcessMotion - event.type: 3, event.motion.x: 761, event.motion.y: 416                                 
2023-08-02 19:09:39.254 T:564      info <general>: Skipped 1 duplicate messages..                                                                                            
andrewbird commented 1 year ago

Our posts crossed, thanks for the explanation.

dimkroon commented 1 year ago

fixed in PR #40 and merged in main in PR #41

andrewbird commented 1 year ago

Thank you, it now starts to play fine.

andrewbird commented 11 months ago

I just wanted to say that I'm extremely happy with kodi and especially this plugin, thanks! One thing though do you think it might be possible to extend it to be able to view my4 (previously all4.com)?

dimkroon commented 11 months ago

Please file a new issue for new issues, or requests. Or post in the support thread on the Kodi forum for general discussions