thetvdb / metadata.tvshows.thetvdb.com.v4.python

TheTVDB Official Kodi TV plugin
9 stars 3 forks source link

ERROR / EXCEPTION when scanning series without English translation (e.g. #423808 with lang setting English) #19

Closed klyco closed 1 year ago

klyco commented 1 year ago

HI there, When it tries to Scrape the new series Prisma (2022), which does not have English season 1 yet, it throws this error: 2022-09-21 22:17:12.175 T:7036 ERROR : [metadata.tvshows.thetvdb.com.v4.python (1.1.0)]: Unhandled exception detected #################################################################################################### Diagnostic info

                                               Exception type  : HTTPError
                                               Exception value : HTTPError: 404 for url: https://api4.thetvdb.com/v4/episodes/9318377/translations/eng
                                               System info     : uname_result(system='Windows', node='INFINIFLIX-MTRX', release='10', version='10.0.22000', machine='AMD64', processor='Intel64 Family 6 Model 140 Stepping 1, GenuineIntel')
                                               Python version  : 3.8.5 (default, Feb 11 2021, 15:28:04) [MSC v.1928 64 bit (AMD64)]
                                               Kodi version    : 19.4 (19.4.0) Git:20220302-e12e66e019
                                               sys.argv        : ['plugin://metadata.tvshows.thetvdb.com.v4.python/',
                                                '703',
                                                '?action=getepisodedetails&url=9318377&pathSettings=%7b%22gender%22%3a%22Other%22%2c%22language%22%3a%22English%22%2c%22pin%22%3a%22%22%2c%22season_type%22%3a%221%22%2c%22year%22%3a1900%7d',
                                                'resume:false']
                                               ----------------------------------------------------------------------------------------------------
                                               sys.path:
                                               ['C:\\Kodi\\portable_data\\addons\\metadata.tvshows.thetvdb.com.v4.python',
                                                'C:\\Kodi\\system\\python\\Lib',
                                                'C:\\Kodi\\python3.8.zip',
                                                'C:\\Kodi\\system\\python\\DLLs',
                                                'C:\\Kodi',
                                                'C:\\Kodi\\system\\python',
                                                'C:\\Kodi\\system\\python\\lib\\site-packages']
                                               ####################################################################################################
                                                                                           Stack Trace
                                               ====================================================================================================
                                               File:
                                               C:\Kodi\portable_data\addons\metadata.tvshows.thetvdb.com.v4.python\resources\lib\exception_logger.py:134
                                               ----------------------------------------------------------------------------------------------------
                                               Code context:
                                                 132:     """
                                                 133:     try:
                                                 134:>        yield
                                                 135:     except Exception as exc:
                                                 136:         stack_trace = ''

                                               ----------------------------------------------------------------------------------------------------
                                               Local variables:
                                               exc = HTTPError: 404 for url: https://api4.thetvdb.com/v4/episodes/9318377/translations/eng
                                               frame_info = FrameInfo(frame=<frame at 0x000001C7E91DF7A0, file 'C:\\Kodi\\portable_data\\addons\\metadata.tvshows.thetvdb.com.v4.python\\resources\\lib\\exception_logger.py', line 138, code log_exception>, filename='C:\\Kodi\\portable_data\\addons\\metadata.tvshows.thetvdb.com.v4.python\\resources\\lib\\exception_logger.py', lineno=134, function='log_exception', code_context=['    """\n', '    try:\n', '        yield\n', '    except Exception as exc:\n', "        stack_trace = ''\n"], index=2)
                                               logger_func = <function logger.error at 0x000001C8445D2AF0>
                                               stack_trace = ''
                                               ====================================================================================================
                                               File:
                                               C:\Kodi\portable_data\addons\metadata.tvshows.thetvdb.com.v4.python\thetvdb.py:4
                                               ----------------------------------------------------------------------------------------------------
                                               Code context:
                                                   1: from resources.lib import actions, exception_logger
                                                   2: 
                                                   3: with exception_logger.log_exception():
                                                   4:>    actions.run()

                                               ----------------------------------------------------------------------------------------------------
                                               Local variables:
                                               actions = <module 'resources.lib.actions' from 'C:\\Kodi\\portable_data\\addons\\metadata.tvshows.thetvdb.com.v4.python\\resources\\lib\\actions.py'>
                                               exception_logger = <module 'resources.lib.exception_logger' from 'C:\\Kodi\\portable_data\\addons\\metadata.tvshows.thetvdb.com.v4.python\\resources\\lib\\exception_logger.py'>
                                               sys = <module 'sys' (built-in)>
                                               xbmc = <module 'xbmc' (built-in)>
                                               xbmcout = <class '__main__.xbmcout'>
                                               ====================================================================================================
                                               File:
                                               C:\Kodi\portable_data\addons\metadata.tvshows.thetvdb.com.v4.python\resources\lib\actions.py:54
                                               ----------------------------------------------------------------------------------------------------
                                               Code context:
                                                  52:         elif action == 'getepisodedetails' and 'url' in params:
                                                  53:             logger.debug("about to call get episode details")
                                                  54:>            get_episode_details(
                                                  55:                 urllib.parse.unquote_plus(params["url"]), settings, handle)
                                                  56:         elif action == 'getartwork' and 'id' in params:

                                               ----------------------------------------------------------------------------------------------------
                                               Local variables:
                                               _action = 'getepisodedetails'
                                               _settings = '{"gender":"Other","language":"English","pin":"","season_type":"1","year":1900}'
                                               _title = ''
                                               action = 'getepisodedetails'
                                               handle = 703
                                               params = {'action': 'getepisodedetails',
                                                'pathSettings': '{"gender":"Other","language":"English","pin":"","season_type":"1","year":1900}',
                                                'url': '9318377'}
                                               qs = 'action=getepisodedetails&url=9318377&pathSettings=%7b%22gender%22%3a%22Other%22%2c%22language%22%3a%22English%22%2c%22pin%22%3a%22%22%2c%22season_type%22%3a%221%22%2c%22year%22%3a1900%7d'
                                               settings = {'gender': 'Other',
                                                'language': 'English',
                                                'pin': '',
                                                'season_type': '1',
                                                'uuid': 'ac532d09-a73d-4906-bbde-d725080831d1',
                                                'year': 1900}
                                               title = ''
                                               uuid = 'ac532d09-a73d-4906-bbde-d725080831d1'
                                               year = None
                                               ====================================================================================================
                                               File:
                                               C:\Kodi\portable_data\addons\metadata.tvshows.thetvdb.com.v4.python\resources\lib\episodes.py:64
                                               ----------------------------------------------------------------------------------------------------
                                               Code context:
                                                  62:     logger.debug(f'Find info of episode with id {id}')
                                                  63:     client = tvdb.Client(settings)
                                                  64:>    ep = client.get_episode_details_api(id, settings)
                                                  65:     if not ep:
                                                  66:         xbmcplugin.setResolvedUrl(

                                               ----------------------------------------------------------------------------------------------------
                                               Local variables:
                                               client = <resources.lib.tvdb.TVDB object at 0x000001C72834CA90>
                                               handle = 703
                                               id = '9318377'
                                               settings = {'gender': 'Other',
                                                'language': 'English',
                                                'pin': '',
                                                'season_type': '1',
                                                'uuid': 'ac532d09-a73d-4906-bbde-d725080831d1',
                                                'year': 1900}
                                               ====================================================================================================
                                               File:
                                               C:\Kodi\portable_data\addons\metadata.tvshows.thetvdb.com.v4.python\resources\lib\tvdb.py:473
                                               ----------------------------------------------------------------------------------------------------
                                               Code context:
                                                 471:             trans = self.get_episode_translation(id, language)
                                                 472:         except requests.HTTPError:
                                                 473:>            trans = self.get_episode_translation(id, "eng")
                                                 474:         overview = trans.get("overview") or ''
                                                 475:         name = trans.get("name") or ''

                                               ----------------------------------------------------------------------------------------------------
                                               Local variables:
                                               ep = {'aired': '2022-09-21',
                                                'awards': [],
                                                'characters': None,
                                                'companies': [{'activeDate': None,
                                                               'aliases': [{'language': 'eng,Prime Video',
                                                                            'name': 'Prime Video'}],
                                                               'companyType': {'companyTypeId': 1,
                                                                               'companyTypeName': 'Network'},
                                                               'country': 'usa',
                                                               'id': 4226,
                                                               'inactiveDate': None,
                                                               'name': 'Amazon Prime Video',
                                                               'nameTranslations': ['eng,spa'],
                                                               'overviewTranslations': ['spa'],
                                                               'parentCompany': {'id': None,
                                                                                 'name': None,
                                                                                 'relation': {'id': None, 'typeName': None}},
                                                               'primaryCompanyType': 1,
                                                               'slug': 'amazon-prime-video',
                                                               'tagOptions': None},
                                                              {'activeDate': None,
                                                               'aliases': [{'language': 'eng,Prime Video',
                                                                            'name': 'Prime Video'}],
                                                               'companyType': {'companyTypeId': 3,
                                                                               'companyTypeName': 'Production Company'},
                                                               'country': 'usa',
                                                               'id': 4226,
                                                               'inactiveDate': None,
                                                               'name': 'Amazon Prime Video',
                                                               'nameTranslations': ['eng,spa'],
                                                               'overviewTranslations': ['spa'],
                                                               'parentCompany': {'id': None,
                                                                                 'name': None,
                                                                                 'relation': {'id': None, 'typeName': None}},
                                                               'primaryCompanyType': 1,
                                                               'slug': 'amazon-prime-video',
                                                               'tagOptions': None}],
                                                'contentRatings': [],
                                                'finaleType': None,
                                                'id': 9318377,
                                                'image': None,
                                                'imageType': None,
                                                'isMovie': 0,
                                                'lastUpdated': '2022-09-21 18:20:54',
                                                'name': 'Rosso',
                                                'nameTranslations': ['ita', 'spa'],
                                                'networks': None,
                                                'nominations': None,
                                                'number': 1,
                                                'overview': 'È iniziato l’anno scolastico a Latina e i gemelli Risorio, '
                                                            "Andrea e Marco, riprendono la loro vita. All'apparenza sono "
                                                            'identici, ma i loro caratteri non potrebbero essere più diversi. '
                                                            'Marco è nervoso e schiacciato dalle aspettative della sua '
                                                            'famiglia, mentre Andrea si ritrova sdoppiato tra una vita alla '
                                                            'luce del sole e una segreta.',
                                                'overviewTranslations': ['ita', 'spa'],
                                                'productionCode': '',
                                                'remoteIds': [],
                                                'runtime': 44,
                                                'seasonNumber': 1,
                                                'seasons': [{'companies': {'distributor': None,
                                                                           'network': None,
                                                                           'production': None,
                                                                           'special_effects': None,
                                                                           'studio': None},
                                                             'id': 2015741,
                                                             'lastUpdated': None,
                                                             'nameTranslations': None,
                                                             'number': 1,
                                                             'overviewTranslations': None,
                                                             'seriesId': 423808,
                                                             'type': {'alternateName': None,
                                                                      'id': 1,
                                                                      'name': 'Aired Order',
                                                                      'type': 'official'}}],
                                                'seriesId': 423808,
                                                'studios': None,
                                                'tagOptions': [],
                                                'trailers': []}
                                               id = '9318377'
                                               language = 'eng'
                                               self = <resources.lib.tvdb.TVDB object at 0x000001C72834CA90>
                                               settings = {'gender': 'Other',
                                                'language': 'English',
                                                'pin': '',
                                                'season_type': '1',
                                                'uuid': 'ac532d09-a73d-4906-bbde-d725080831d1',
                                                'year': 1900}
                                               ====================================================================================================
                                               File:
                                               C:\Kodi\portable_data\addons\metadata.tvshows.thetvdb.com.v4.python\resources\lib\tvdb.py:369
                                               ----------------------------------------------------------------------------------------------------
                                               Code context:
                                                 367:         """Returns an episode translation dictionary"""
                                                 368:         url = self.url.episode_translation_url(id, lang)
                                                 369:>        return self.request.make_api_request(url)
                                                 370: 
                                                 371:     def get_episode_extended(self, id: int) -> dict:

                                               ----------------------------------------------------------------------------------------------------
                                               Local variables:
                                               id = '9318377'
                                               lang = 'eng'
                                               self = <resources.lib.tvdb.TVDB object at 0x000001C72834CA90>
                                               url = 'https://api4.thetvdb.com/v4/episodes/9318377/translations/eng'
                                               ====================================================================================================
                                               File:
                                               C:\Kodi\portable_data\addons\metadata.tvshows.thetvdb.com.v4.python\resources\lib\tvdb.py:74
                                               ----------------------------------------------------------------------------------------------------
                                               Code context:
                                                  72:         response = requests.get(url, headers=headers)
                                                  73:         if not response.ok:
                                                  74:>            response.raise_for_status()
                                                  75:         data = response.json()['data']
                                                  76:         self.cache[url] = data

                                               ----------------------------------------------------------------------------------------------------
                                               Local variables:
                                               data = None
                                               headers = {'Accept': 'application/json',
                                                'Authorization': 'Bearer '
                                                                 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZ2UiOiIiLCJhcGlrZXkiOiJlZGFlNjBkYy0xYjQ0LTRiYWMtOGRiNy02NWMwYWFmNTI1OGIiLCJjb21tdW5pdHlfc3VwcG9ydGVkIjpmYWxzZSwiZXhwIjoxNjY2NDQxMDUwLCJnZW5kZXIiOiJPdGhlciIsImhpdHNfcGVyX2RheSI6MTAwMDAwMDAwLCJoaXRzX3Blcl9tb250aCI6MTAwMDAwMDAwLCJpZCI6IjEiLCJpc19tb2QiOnRydWUsImlzX3N5c3RlbV9rZXkiOmZhbHNlLCJpc190cnVzdGVkIjpmYWxzZSwicGluIjpudWxsLCJ1dWlkIjoiYWM1MzJkMDktYTczZC00OTA2LWJiZGUtZDcyNTA4MDgzMWQxIn0.ZtA1m0iOsKtLmU3uTXKToQ_pahYl3enguvY81WrIvnSFsbekICAJyAgysJRKlCVkoLUP4WixJXDMolmdnEg5gpxeeJN2ItmFAuTCDIwObpXWfMIwMcOrbABmQ2QjC-PhgFfg6kf6hlxG5ZdkxjTHxetb0SzQG7IEzsZ9AEqQ4d0lXsf_0ZypAfQv6-s041pm1TI-GcX_WqVHxGOG4BlEpf4ANSFwjjTGaEKCPw___RegryfdKsbdMG3Nm_1n3SPQAnu1oUUthBgTAB0lk_WNA0jViYkMum4EZd8qCV2ZAWAmPcFPkr3T7t3oZmoKG2tYkBJWCyjdHhU2WXMh6gAKuY5ezice-_cEyl2Avk41k-CBnqfTm_eE1owIvp1c19mPCHd8ICHdCXSCujougrDVQxYRqyvcpv-Bjg_aQPUVfnr1AvrnOyNaWx0udbF1eocVL482QTSHnthVo8HRg8s2us3OJ-O_kx8uTp2_X4ZmS6plKW4nsTyvy-ZNkdTxXB0UA9DI0DmajFJyNOMw-k1zYbGpqlpDYoXl293LUZM8xZVr1HS986tLe58jDH8Q3UwMaXOP918PYAomQ3QpS7UVMlGenFck_qz5et-RYac2vlsa3Otx4pAvQbf6W9Ni2n2tSUr0KgCMWQqolQIue48vyp2og_m-U24wj4ACEWr6Fts',
                                                'User-Agent': 'TheTVDB v.4 TV Scraper for Kodi'}
                                               response = <Response [404]>
                                               self = <resources.lib.tvdb.Request object at 0x000001C727102D90>
                                               url = 'https://api4.thetvdb.com/v4/episodes/9318377/translations/eng'
                                               ====================================================================================================
                                               File:
                                               C:\Kodi\portable_data\addons\metadata.tvshows.thetvdb.com.v4.python\resources\lib\simple_requests.py:132
                                               ----------------------------------------------------------------------------------------------------
                                               Code context:
                                                 130:     def raise_for_status(self) -> None:
                                                 131:         if not self.ok:
                                                 132:>            raise HTTPError(self)
                                                 133: 
                                                 134: 

                                               ----------------------------------------------------------------------------------------------------
                                               Local variables:
                                               self = <Response [404]>
                                               ====================================================================================================

                                               ************************************* End of diagnostic info ***************************************

2022-09-21 22:17:12.176 T:7036 ERROR : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--

CHeers, Ken

antheaezzell commented 1 year ago

I have ticketed this for internal investigation here - https://mediamorph.atlassian.net/browse/TVD-3411

klyco commented 1 year ago

Wonderful thanks so much! Is there any way that I can track the progress? If I use your link, apparently it says I don't have access.

antheaezzell commented 1 year ago

It's just an internal ticket, so unfortunately, you can't access. When the work is released, I will update this ticket.

klyco commented 1 year ago

All good, I was just making sure that I didn't miss something. Thanks for your reply. :-)

LostEchoes commented 1 year ago

Hello. I have the same issue with KODI 19.3 on my Chromecast with Google TV (HD). Here is the log.

https://paste.kodi.tv/eyiligedek

antheaezzell commented 1 year ago

@LostEchoes I have added your log for troubleshooting purposes to the developer's ticket. Thank you.

sopparus commented 1 year ago

i too have this error using nexus and this plugin

antheaezzell commented 1 year ago

@sopparus I think we may be able to release this work soon.

antheaezzell commented 1 year ago

@klyco @sopparus and @LostEchoes I believe this work was done in our most recent release. Let me know if you are still experiencing issues.

klyco commented 1 year ago

Thanks so much for the great work! I will test and let you know.

LostEchoes commented 1 year ago

It seems to be fixed now, indeed. Thank you. Have a great year everybody !