From 8092b32eb17b105884da47709958cf44a8c57410 Mon Sep 17 00:00:00 2001 From: marco Date: Sat, 8 Feb 2020 15:19:03 +0100 Subject: [PATCH] fix apri nel browser kodi19 --- platformcode/launcher.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platformcode/launcher.py b/platformcode/launcher.py index 2cd80fd6..df812dc2 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -153,8 +153,12 @@ def run(item=None): if xbmc.getCondVisibility('system.platform.linux') and xbmc.getCondVisibility('system.platform.android'): # android xbmc.executebuiltin('StartAndroidActivity("", "android.intent.action.VIEW", "", "%s")' % (item.url)) else: - short = urllib2.urlopen( - 'https://u.nu/api.php?action=shorturl&format=simple&url=' + item.url).read() + try: + import urllib.request as urllib + except ImportError: + import urllib + short = urllib.urlopen( + 'https://u.nu/api.php?action=shorturl&format=simple&url=' + item.url).read().decode('utf-8') platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(70740) % short) # Action in certain channel specified in "action" and "channel" parameters