aggiunta la possibilita di aprire link nel browser (o in alternativa ottenere un link corto)
This commit is contained in:
@@ -136,6 +136,13 @@ def run(item=None):
|
|||||||
elif item.action == "itemInfo":
|
elif item.action == "itemInfo":
|
||||||
import base64
|
import base64
|
||||||
platformtools.dialog_textviewer('Item info', item.parent)
|
platformtools.dialog_textviewer('Item info', item.parent)
|
||||||
|
elif item.action == "open_browser":
|
||||||
|
try:
|
||||||
|
import webbrowser
|
||||||
|
webbrowser.open(item.url)
|
||||||
|
except:
|
||||||
|
short = urllib2.urlopen('https://u.nu/api.php?action=shorturl&format=simple&url=' + item.url).read()
|
||||||
|
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(70740) % short)
|
||||||
# Action in certain channel specified in "action" and "channel" parameters
|
# Action in certain channel specified in "action" and "channel" parameters
|
||||||
else:
|
else:
|
||||||
# Entry point for a channel is the "mainlist" action, so here we check parental control
|
# Entry point for a channel is the "mainlist" action, so here we check parental control
|
||||||
|
|||||||
@@ -538,7 +538,9 @@ def set_context_commands(item, parent_item):
|
|||||||
and parent_item.action != "mainlist":
|
and parent_item.action != "mainlist":
|
||||||
context_commands.append((config.get_localized_string(60349), "XBMC.Container.Refresh (%s?%s)" %
|
context_commands.append((config.get_localized_string(60349), "XBMC.Container.Refresh (%s?%s)" %
|
||||||
(sys.argv[0], Item(channel=item.channel, action="mainlist").tourl())))
|
(sys.argv[0], Item(channel=item.channel, action="mainlist").tourl())))
|
||||||
|
context_commands.insert(2, (config.get_localized_string(70739),
|
||||||
|
"XBMC.Container.Update (%s?%s)" % (sys.argv[0], Item(action="open_browser",
|
||||||
|
url=item.url).tourl())))
|
||||||
# Añadir a Favoritos
|
# Añadir a Favoritos
|
||||||
if num_version_xbmc < 17.0 and \
|
if num_version_xbmc < 17.0 and \
|
||||||
((item.channel not in ["favorites", "videolibrary", "help", ""]
|
((item.channel not in ["favorites", "videolibrary", "help", ""]
|
||||||
|
|||||||
@@ -5672,3 +5672,11 @@ msgstr ""
|
|||||||
msgctxt "#70738"
|
msgctxt "#70738"
|
||||||
msgid "Ready channels %d/%d"
|
msgid "Ready channels %d/%d"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#70739"
|
||||||
|
msgid "Open link in browser"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#70740"
|
||||||
|
msgid "Your system does not have a web browser, so here's the short link you can open in another device:\n%s"
|
||||||
|
msgstr ""
|
||||||
@@ -5676,3 +5676,11 @@ msgstr "[B]MENU LATERALE[/B]"
|
|||||||
msgctxt "#70738"
|
msgctxt "#70738"
|
||||||
msgid "Ready channels %d/%d"
|
msgid "Ready channels %d/%d"
|
||||||
msgstr "Canali pronti %d/%d"
|
msgstr "Canali pronti %d/%d"
|
||||||
|
|
||||||
|
msgctxt "#70739"
|
||||||
|
msgid "Open link in browser"
|
||||||
|
msgstr "Apri link nel browser"
|
||||||
|
|
||||||
|
msgctxt "#70740"
|
||||||
|
msgid "Your system does not have a web browser, so here's the short link you can open in another device:\n%s"
|
||||||
|
msgstr "Il tuo sistema non ha un browser, quindi ecco un link corto che puoi aprire in un altro dispositivo\n%s"
|
||||||
Reference in New Issue
Block a user