Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def SPORTS_DEVIL_FIX():
- SPORTS_DEVIL_FOLDER = xbmc.translatePath(os.path.join('special://home/addons','plugin.video.SportsDevil'))
- PYDEV_FOLDER = xbmc.translatePath(os.path.join('special://home/addons','script.module.pydevd'))
- REPO_FOLDER = xbmc.translatePath(os.path.join('special://home/addons','repository.echo'))
- path = xbmc.translatePath(os.path.join('special://home/addons','packages'))
- choice = xbmcgui.Dialog().yesno(AddonTitle,'This option will remove all traces of Sports Devil (If Installed) and install a clean version along with the ECHO Repo.','Would you like to continue?',yeslabel='[B][COLOR lime]YES[/COLOR][/B]',nolabel='[B][COLOR lightskyblue]NO[/COLOR][/B]')
- if choice == 0:
- sys.exit(1)
- dialog = xbmcgui.Dialog()
- if os.path.exists(SPORTS_DEVIL_FOLDER):
- try:
- shutil.rmtree(SPORTS_DEVIL_FOLDER)
- except: pass
- if os.path.exists(PYDEV_FOLDER):
- try:
- shutil.rmtree(PYDEV_FOLDER)
- except: pass
- purgePath = xbmc.translatePath('special://home/addons/packages')
- for root, dirs, files in os.walk(purgePath):
- file_count = 0
- file_count += len(files)
- for root, dirs, files in os.walk(purgePath):
- file_count = 0
- file_count += len(files)
- if file_count > 0:
- for f in files:
- os.unlink(os.path.join(root, f))
- for d in dirs:
- shutil.rmtree(os.path.join(root, d))
- if not os.path.exists(path):
- os.makedirs(path)
- url = ('https://github.com/echocoderkodi/echo.addon.installer/raw/master/dependencies/script.module.pydevd-3.4.1.zip')
- dp = xbmcgui.DialogProgress()
- dp.create(AddonTitle,"","","Installing Dependencies")
- lib=os.path.join(path, 'addon.zip')
- try:
- os.remove(lib)
- except:
- pass
- downloader.download(url, lib, dp)
- addonfolder = xbmc.translatePath(os.path.join('special://home','addons'))
- time.sleep(2)
- dp.update(0,"","Extracting Zip Please Wait","")
- extract.all(lib,addonfolder,dp)
- url = ('https://github.com/echocoderkodi/echo.addon.installer/raw/master/addons/Plugins/plugin.video.SportsDevil.zip')
- dp = xbmcgui.DialogProgress()
- dp.create(AddonTitle,"","","Installing Sports Devil")
- lib=os.path.join(path, 'addon.zip')
- try:
- os.remove(lib)
- except:
- pass
- downloader.download(url, lib, dp)
- addonfolder = xbmc.translatePath(os.path.join('special://home','addons'))
- time.sleep(2)
- dp.update(0,"","Extracting Zip Please Wait","")
- extract.all(lib,addonfolder,dp)
- try:
- os.remove(lib)
- except:
- pass
- xbmc.executebuiltin("UpdateAddonRepos")
- xbmc.executebuiltin("UpdateLocalAddons")
- dialog.ok(AddonTitle,"[COLOR white]The Sportd Devil plugin should now be fixed and working correctly. If you have any issues please turn AUTO UPDATE OFF on Sports Devil and run this fix again.[/COLOR]")
- sys.exit(0)
Advertisement
Add Comment
Please, Sign In to add comment