Fix Kodi 19.3 addons / scrapers on Xbox

There is an issue in the release of Kodi 19.3 for Xbox that basically breaks Python if it tries to use the urllib library which is essentially used by every python add-on / scraper that needs to talk to the internet.

The below will fix any official add-ons / scrapers and most skins.
3rd party add-ons without a dependency on xbmc.python will need to also follow the "Fixing Other Add-ons" steps.
If the addons are not Matrix (Python3) compatible they won't work until updated by their authors.

How to fix

  1. Go to Kodi Settings > File Manager > Add Source
  2. Click <none> and type in https://f.mjh.nz/
  3. Move down and then name it MJH
  4. Go to Kodi settings > System > Add-ons > Enable Unknown Sources
  5. Go to Kodi settings > Addons > Install from zip file
  6. Select Yes to any warnings
  7. Navigate to MJH > xbox
  8. Select xbmc.python.zip to install it
  9. If using Slyguy Add-ons, repeat step 5-9 but select repository.slyguy.zip
  10. Go to Kodi settings > System > Add-ons > Disable Unknown Sources
  11. Restart Kodi

Revert the Fix

Once Kodi 19.4 with a fix is released, it's best to revert what was done above
so Kodi goes back to automatically updating those add-ons.

Revert xbmc.python

  1. Go to Kodi Settings > File Manager > Add Source
  2. Browse > Home Folder > addons and select OK
  3. Now in File Manager, select the new addons source
  4. Scroll until your highlighted on the xbmc.python folder
  5. Now open the Kodi context menu (X button), and then select Delete
  6. Restart Kodi

Revert repository.slyguy

  1. Go to Add-ons > My Add-ons > Add-on repository
  2. Scroll down to Slyguy Repository
  3. Select it, then select Versions and then select the version listed
  4. You should see it download and update Slyguy Repository
  5. Restart Kodi

Fixing Other Add-ons

If the above doesn't fix the permission issue for add-on X, then it's most likely because that add-on does not have a dependency on xbmc.python. You can work around this by editing the addon to add this dependency.
  1. Download that addon .zip to a computer
  2. Unzip the addon
  3. Go into the add-on folder and open the addon.xml with any text editor
  4. Find the section called <requires>
    After that, add <import addon="xbmc.python" version="3.0.0"/>
  5. Save the file & zip up the folder
  6. Install via zip as usual in kodi

What went wrong?

I suspect the issue is Xbox / MS / UWP not applying correct permissions to empty (0 byte) Python files.
Python urllib unfortunately uses an empty __init__.py where 99% of the other built-in libraries either have code or a comment in this file and they all work fine. 

How does the fix work?

The above fix works by including the urllib library inside the xbmc.python add-on which is used as a dependency by nearly every add-on / scraper that uses Python. By including it inside this, Python uses this urllib instead of the built-in. They are actually identical - but Xbox luckily doesn't have an issues with permissions of 0 byte files when they are outside of the uwp package (sandbox).

Discussion

Support