Nome server Directo nelle traduzioni

This commit is contained in:
Alhaziel01
2020-08-12 09:21:13 +02:00
parent 5e6618c495
commit 486b969bea
11 changed files with 21 additions and 15 deletions

View File

@@ -110,7 +110,7 @@ def findvideos(item):
for title, url in matches:
get_video_list(url, title, itemlist)
else:
get_video_list(item.url, 'Diretto', itemlist)
get_video_list(item.url, support.config.get_localized_string(30137), itemlist)
return support.server(item, itemlist=itemlist)

View File

@@ -149,6 +149,6 @@ def findvideos(item):
if url.startswith('//'): url = 'https:' + url
elif url.startswith('/'): url = 'https:/' + url
if 'vvvvid' in url: itemlist.append(item.clone(action="play", title='VVVVID', url=url, server='vvvvid'))
else: itemlist.append(item.clone(action="play", title='Diretto', url=url, server='directo'))
else: itemlist.append(item.clone(action="play", title=support.config.get_localized_string(30137), url=url, server='directo'))
return support.server(item, itemlist=itemlist)

View File

@@ -219,4 +219,4 @@ def episodios(item):
def findvideos(item):
support.log()
return support.server(item,itemlist=[item.clone(title='Diretto', server='directo', action='play')])
return support.server(item,itemlist=[item.clone(title=support.config.get_localized_string(30137), server='directo', action='play')])

View File

@@ -111,7 +111,7 @@ def findvideos(item):
for title, url in matches:
get_video_list(url, title, itemlist)
else:
get_video_list(item.url, 'Diretto', itemlist)
get_video_list(item.url, support.config.get_localized_string(30137), itemlist)
return support.server(item, itemlist=itemlist)

View File

@@ -68,7 +68,7 @@ def findvideos(item):
matches = support.match(item, patron=r'filename: "(.*?)"').matches
for url in matches:
itemlist.append(item.clone(action="play", title='Diretto', server='directo', url=host + url))
itemlist.append(item.clone(action="play", title=support.config.get_localized_string(30137), server='directo', url=host + url))
return support.server(item, itemlist=itemlist)

View File

@@ -288,7 +288,7 @@ def findvideos(item):
else:
url = item.url
itemlist.append(item.clone(server = 'directo', title = 'Diretto', fanart = item.json, url = getUrl(url), action = 'play' ))
itemlist.append(item.clone(server = 'directo', title = support.config.get_localized_string(30137), fanart = item.json, url = getUrl(url), action = 'play' ))
return support.server(item, itemlist=itemlist, Download=False)

View File

@@ -179,5 +179,5 @@ def findvideos(item):
url = support.match(support.match(item).data.replace('"','"').replace('\\',''), patron=r'video_url"\s*:\s*"([^"]+)"').match
playlist = support.match(url, patron=r'\./([^.]+)').matches
for res in playlist:
itemlist.append(item.clone(title='Diretto', server='directo', url=url.replace('playlist',res), quality=res, action='play'))
itemlist.append(item.clone(title=support.config.get_localized_string(30137), server='directo', url=url.replace('playlist',res), quality=res, action='play'))
return support.server(item, itemlist=itemlist)

View File

@@ -191,7 +191,7 @@ def findvideosbyserver(data, serverid):
for x in range(len(match.groups())):
url = url.replace("\\%s" % (x + 1), match.groups()[x])
msg += "\nfound url: %s" % url
value = server_parameters["name"], url, serverid, server_parameters.get("thumbnail", "")
value = translate_server_name(server_parameters["name"]) , url, serverid, server_parameters.get("thumbnail", "")
if value not in devuelve and url not in server_parameters["find_videos"].get("ignore_urls", []):
devuelve.append(value)
logger.info(msg)
@@ -235,7 +235,7 @@ def get_server_from_url(url):
for x in range(len(match.groups())):
url = url.replace("\\%s" % (x + 1), match.groups()[x])
msg += "\nurl encontrada: %s" % url
value = server_parameters["name"], url, serverid, server_parameters.get("thumbnail", "")
value = translate_server_name(server_parameters["name"]), url, serverid, server_parameters.get("thumbnail", "")
if url not in server_parameters["find_videos"].get("ignore_urls", []):
logger.info(msg)
return value
@@ -274,7 +274,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
if isinstance(video_password, list):
return video_password, len(video_password) > 0, "<br/>".join(error_messages)
logger.info("Server: %s, url is good" % server)
video_urls.append(["%s [%s]" % (urlparse.urlparse(url)[2][-4:], server), url])
video_urls.append(["%s [%s]" % (urlparse.urlparse(url)[2][-4:], config.get_localized_string(30137)), url])
# Find out the video URL
else:
@@ -286,7 +286,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
if server_parameters:
# Show a progress dialog
if muestra_dialogo:
progreso = (platformtools.dialog_progress_bg if background_dialog else platformtools.dialog_progress)(config.get_localized_string(20000), config.get_localized_string(70180) % server_parameters["name"])
progreso = (platformtools.dialog_progress_bg if background_dialog else platformtools.dialog_progress)(config.get_localized_string(20000), config.get_localized_string(70180) % translate_server_name(server_parameters["name"]))
# Count the available options, to calculate the percentage
@@ -346,7 +346,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
# Own free and premium option uses the same server
if opcion == "free" or opcion == server:
serverid = server_module
server_name = server_parameters["name"]
server_name = translate_server_name(server_parameters["name"])
# Rest of premium options use a debrider
else:
@@ -788,3 +788,9 @@ def check_video_link(item, timeout=3):
logger.info("[check_video_link] There is no test_video_exists for server: %s" % server)
return item, NK
def translate_server_name(name):
if '@' in name:
return config.get_localized_string(int(name.replace('@','')))
else:
return name

View File

@@ -1177,7 +1177,7 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
log(findS)
if not findS:
if item.channel == 'community':
findS= ('Diretto', videoitem.url, 'directo')
findS= (support.config.get_localized_string(30137), videoitem.url, 'directo')
else:
videoitem.url = unshortenit.unshorten_only(videoitem.url)[0]
findS = servertools.get_server_from_url(videoitem.url)

View File

@@ -1113,7 +1113,7 @@ def install_widevine():
path = xbmc.translatePath(Addon('inputstream.adaptive').getSetting('DECRYPTERPATH'))
# if Widevine CDM is not installed
if not os.path.exists(path):
if not os.path.exists(path) or not os.path.listdir(path):
select = dialog_yesno('Widevine CDM', config.get_localized_string(70808))
if select > 0:
if not 'arm' in platform['arch']:

View File

@@ -44,7 +44,7 @@
},
"free": true,
"id": "directo",
"name": "Direct",
"name": "@30137",
"settings": [
{
"default": false,