def run(self):
     xbmc.log('[ plugin.video.venom ]  Addon checking available updates', 2)
     try:
         import re
         import requests
         repo_xml = requests.get(
             'https://raw.githubusercontent.com/123Venom/zips/master/addons.xml'
         )
         if not repo_xml.status_code == 200:
             xbmc.log(
                 '[ plugin.video.venom ]  Could not connect to remote repo XML: status code = %s'
                 % repo_xml.status_code, 2)
             return
         repo_version = re.findall(
             r'<addon id=\"plugin.video.venom\".+version=\"(\d*.\d*.\d*)\"',
             repo_xml.text)[0]
         local_version = control.getVenomVersion()
         if control.check_version_numbers(local_version, repo_version):
             while control.condVisibility('Library.IsScanningVideo'):
                 control.sleep(10000)
             xbmc.log(
                 '[ plugin.video.venom ]  A newer version is available. Installed Version: v%s, Repo Version: v%s'
                 % (local_version, repo_version), 2)
             control.notification(message=control.lang(35523) %
                                  repo_version)
         return xbmc.log(
             '[ plugin.video.venom ]  Addon update check complete', 2)
     except:
         log_utils.error()
Exemple #2
0
 def run(self):
     try:
         if control.setting('general.checkAddonUpdates') == 'false':
             return
         import re
         import requests
         repo_xml = requests.get(
             'https://raw.githubusercontent.com/123Venom/zips/master/addons.xml'
         )
         if not repo_xml.status_code == 200:
             log_utils.log(
                 'Could not connect to repo XML, status: %s' %
                 repo_xml.status_code, log_utils.LOGNOTICE)
             return
         repo_version = re.findall(
             r'<addon id=\"plugin.video.venom\".+version=\"(\d*.\d*.\d*)\"',
             repo_xml.text)[0]
         local_version = control.getVenomVersion()
         if control.check_version_numbers(local_version, repo_version):
             while control.condVisibility('Library.IsScanningVideo'):
                 control.sleep(10000)
             log_utils.log(
                 'A newer version of Venom is available. Installed Version: v%s, Repo Version: v%s'
                 % (local_version, repo_version), log_utils.LOGNOTICE)
             control.notification(title='default',
                                  message=control.lang(35523) %
                                  repo_version,
                                  icon='default',
                                  time=5000,
                                  sound=False)
     except:
         log_utils.error()
         pass