Altadefinizione Click e aggiungi alla videoteca per contentTpe non definiti
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
"language": ["ita","sub-ita"],
|
"language": ["ita","sub-ita"],
|
||||||
"thumbnail": "altadefinizioneclick.png",
|
"thumbnail": "altadefinizioneclick.png",
|
||||||
"bannermenu": "altadefinizioneciclk.png",
|
"bannermenu": "altadefinizioneciclk.png",
|
||||||
"categories": ["movie","vos"],
|
"categories": ["tvshow","movie","vos"],
|
||||||
|
"not_active":["include_in_newest_series"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,22 +2,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Canale per altadefinizioneclick
|
# Canale per altadefinizioneclick
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
"""
|
from platformcode import logger
|
||||||
|
|
||||||
Eccezioni che non superano il test del canale:
|
|
||||||
- indicare le eccezioni
|
|
||||||
|
|
||||||
Novità. Indicare in quale/i sezione/i è presente il canale:
|
|
||||||
- film
|
|
||||||
|
|
||||||
Avvisi:
|
|
||||||
- Eventuali avvisi per i tester
|
|
||||||
|
|
||||||
Ulteriori info:
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
from platformcode.logger import debug
|
|
||||||
from core import support
|
from core import support
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config
|
from platformcode import config
|
||||||
@@ -67,13 +52,13 @@ def peliculas(item):
|
|||||||
if not item.args:
|
if not item.args:
|
||||||
patronBlock = r'(?:ULTIMI INSERITI|Serie TV)(?P<block>.*?)</section'
|
patronBlock = r'(?:ULTIMI INSERITI|Serie TV)(?P<block>.*?)</section'
|
||||||
|
|
||||||
# nella pagina "CERCA", la voce "SUCCESSIVO" apre la maschera di inserimento dati
|
|
||||||
patronNext = r'<a class="next page-numbers" href="([^"]+)">'
|
patronNext = r'<a class="next page-numbers" href="([^"]+)">'
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
|
item.contentType = 'undefined'
|
||||||
action = 'peliculas'
|
action = 'peliculas'
|
||||||
patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
||||||
|
|
||||||
@@ -141,8 +126,6 @@ def check(item):
|
|||||||
data = ''
|
data = ''
|
||||||
episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches
|
episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches
|
||||||
for episode_url, episode in episodes:
|
for episode_url, episode in episodes:
|
||||||
# episode_url = support.urlparse.urljoin(item.url, episode_url)
|
|
||||||
# if '-' in episode: episode = episode.split('-')[0].zfill(2) + 'x' + episode.split('-')[1].zfill(2)
|
|
||||||
title = season + "x" + episode.zfill(2) + ' - ' + item.fulltitle
|
title = season + "x" + episode.zfill(2) + ' - ' + item.fulltitle
|
||||||
data += title + '|' + episode_url + '\n'
|
data += title + '|' + episode_url + '\n'
|
||||||
return data
|
return data
|
||||||
@@ -151,10 +134,11 @@ def check(item):
|
|||||||
patron_episode = '<div class="[^"]+" id="episodesModal"[^>]+>(.*?)</ul>'
|
patron_episode = '<div class="[^"]+" id="episodesModal"[^>]+>(.*?)</ul>'
|
||||||
patron_option = r'<a href="([^"]+?)".*?>(?:Stagione |Episodio )([^<]+?)</a>'
|
patron_option = r'<a href="([^"]+?)".*?>(?:Stagione |Episodio )([^<]+?)</a>'
|
||||||
|
|
||||||
url = support.match(item, patron=r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen').match
|
url = support.match(item, patron=r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen')
|
||||||
seasons = support.match(url, patronBlock=patron_season, patron=patron_option)
|
seasons = support.match(url.match, patronBlock=patron_season, patron=patron_option)
|
||||||
if not seasons.match:
|
if not seasons.match:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
|
item.data = url.data
|
||||||
return findvideos(item)
|
return findvideos(item)
|
||||||
|
|
||||||
data = ''
|
data = ''
|
||||||
@@ -186,10 +170,7 @@ def episodios(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info('findvideos', item)
|
logger.debug()
|
||||||
return support.hdpass_get_servers(item)
|
return support.hdpass_get_servers(item, item.data)
|
||||||
|
|
||||||
|
|
||||||
def play(item):
|
|
||||||
if 'hdpass' in item.url:
|
|
||||||
return support.hdpass_get_url(item)
|
|
||||||
return [item]
|
|
||||||
|
|||||||
+3
-2
@@ -25,7 +25,7 @@ from platformcode.logger import info
|
|||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
|
|
||||||
|
|
||||||
def hdpass_get_servers(item):
|
def hdpass_get_servers(item, data=''):
|
||||||
def get_hosts(url, quality):
|
def get_hosts(url, quality):
|
||||||
ret = []
|
ret = []
|
||||||
page = httptools.downloadpage(url, CF=False).data
|
page = httptools.downloadpage(url, CF=False).data
|
||||||
@@ -43,7 +43,8 @@ def hdpass_get_servers(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
if 'hdpass' in item.url or 'hdplayer' in item.url: url = item.url
|
if 'hdpass' in item.url or 'hdplayer' in item.url: url = item.url
|
||||||
else:
|
else:
|
||||||
data = httptools.downloadpage(item.url, CF=False).data.replace('\n', '')
|
if not data:
|
||||||
|
data = httptools.downloadpage(item.url, CF=False).data.replace('\n', '')
|
||||||
patron = r'<iframe(?: id="[^"]+")? width="[^"]+" height="[^"]+" src="([^"]+)"[^>]+><\/iframe>'
|
patron = r'<iframe(?: id="[^"]+")? width="[^"]+" height="[^"]+" src="([^"]+)"[^>]+><\/iframe>'
|
||||||
url = scrapertools.find_single_match(data, patron)
|
url = scrapertools.find_single_match(data, patron)
|
||||||
url = url.replace("&download=1", "")
|
url = url.replace("&download=1", "")
|
||||||
|
|||||||
+20
-14
@@ -682,9 +682,12 @@ def save_episodes(item, episodelist, extra_info, host, local_files, silent=False
|
|||||||
def add_to_videolibrary(item, channel):
|
def add_to_videolibrary(item, channel):
|
||||||
itemlist = getattr(channel, item.from_action)(item)
|
itemlist = getattr(channel, item.from_action)(item)
|
||||||
if itemlist and itemlist[0].contentType == 'episode':
|
if itemlist and itemlist[0].contentType == 'episode':
|
||||||
return add_tvshow(item, channel)
|
return add_tvshow(item, itemlist)
|
||||||
else:
|
elif itemlist and itemlist[0].server:
|
||||||
return add_movie(item)
|
return add_movie(item)
|
||||||
|
else:
|
||||||
|
videolibrarydb.close()
|
||||||
|
platformtools.dialog_ok(config.get_localized_string(30131), config.get_localized_string(70838) % item.contentTitle)
|
||||||
|
|
||||||
|
|
||||||
def add_movie(item):
|
def add_movie(item):
|
||||||
@@ -703,7 +706,8 @@ def add_movie(item):
|
|||||||
@param item: item to be saved.
|
@param item: item to be saved.
|
||||||
"""
|
"""
|
||||||
logger.debug()
|
logger.debug()
|
||||||
from platformcode.launcher import set_search_temp; set_search_temp(item)
|
item.contentType = 'movie'
|
||||||
|
# from platformcode.launcher import set_search_temp; set_search_temp(item)
|
||||||
|
|
||||||
# To disambiguate titles, TMDB is caused to ask for the really desired title
|
# To disambiguate titles, TMDB is caused to ask for the really desired title
|
||||||
# The user can select the title among those offered on the first screen
|
# The user can select the title among those offered on the first screen
|
||||||
@@ -731,7 +735,7 @@ def add_movie(item):
|
|||||||
videolibrarydb.close()
|
videolibrarydb.close()
|
||||||
|
|
||||||
|
|
||||||
def add_tvshow(item, channel=None):
|
def add_tvshow(item, channel=None, itemlist=[]):
|
||||||
"""
|
"""
|
||||||
Save content in the series library. This content can be one of these two:
|
Save content in the series library. This content can be one of these two:
|
||||||
- The series with all the chapters included in the episodelist.
|
- The series with all the chapters included in the episodelist.
|
||||||
@@ -753,7 +757,8 @@ def add_tvshow(item, channel=None):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
logger.debug("show=#" + item.show + "#")
|
logger.debug("show=#" + item.show + "#")
|
||||||
from platformcode.launcher import set_search_temp; set_search_temp(item)
|
item.contentType = 'tvshow'
|
||||||
|
# from platformcode.launcher import set_search_temp; set_search_temp(item)
|
||||||
|
|
||||||
if item.channel == "downloads":
|
if item.channel == "downloads":
|
||||||
itemlist = [item.clone()]
|
itemlist = [item.clone()]
|
||||||
@@ -792,7 +797,8 @@ def add_tvshow(item, channel=None):
|
|||||||
|
|
||||||
# Get the episode list
|
# Get the episode list
|
||||||
it = item.clone()
|
it = item.clone()
|
||||||
itemlist = getattr(channel, it.action)(it)
|
if not itemlist:
|
||||||
|
itemlist = getattr(channel, it.action)(it)
|
||||||
item.host = channel.host
|
item.host = channel.host
|
||||||
if itemlist:
|
if itemlist:
|
||||||
from platformcode.autorenumber import start, check
|
from platformcode.autorenumber import start, check
|
||||||
@@ -818,24 +824,24 @@ def add_tvshow(item, channel=None):
|
|||||||
|
|
||||||
elif not inserted and not overwritten and not failed:
|
elif not inserted and not overwritten and not failed:
|
||||||
filetools.rmdirtree(path)
|
filetools.rmdirtree(path)
|
||||||
platformtools.dialog_ok(config.get_localized_string(30131), config.get_localized_string(60067) % item.show)
|
platformtools.dialog_ok(config.get_localized_string(30131), config.get_localized_string(60067) % item.contentTitle)
|
||||||
logger.error("The string %s could not be added to the video library. Could not get any episode" % item.show)
|
logger.error("The string %s could not be added to the video library. Could not get any episode" % item.contentTitle)
|
||||||
|
|
||||||
elif failed == -1:
|
elif failed == -1:
|
||||||
filetools.rmdirtree(path)
|
filetools.rmdirtree(path)
|
||||||
platformtools.dialog_ok(config.get_localized_string(30131), config.get_localized_string(60068) % item.show)
|
platformtools.dialog_ok(config.get_localized_string(30131), config.get_localized_string(60068) % item.contentTitle)
|
||||||
logger.error("The string %s could not be added to the video library" % item.show)
|
logger.error("The string %s could not be added to the video library" % item.contentTitle)
|
||||||
|
|
||||||
elif failed == -2:
|
elif failed == -2:
|
||||||
filetools.rmdirtree(path)
|
filetools.rmdirtree(path)
|
||||||
|
|
||||||
elif failed > 0:
|
elif failed > 0:
|
||||||
platformtools.dialog_ok(config.get_localized_string(30131), config.get_localized_string(60069) % item.show)
|
platformtools.dialog_ok(config.get_localized_string(30131), config.get_localized_string(60069) % item.contentTitle)
|
||||||
logger.error("Could not add %s episodes of series %s to the video library" % (failed, item.show))
|
logger.error("Could not add %s episodes of series %s to the video library" % (failed, item.contentTitle))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_notification(config.get_localized_string(30131), config.get_localized_string(60070) % item.show)
|
platformtools.dialog_notification(config.get_localized_string(30131), config.get_localized_string(60070) % item.contentTitle)
|
||||||
logger.debug("%s episodes of series %s have been added to the video library" % (inserted, item.show))
|
logger.debug("%s episodes of series %s have been added to the video library" % (inserted, item.contentTitle))
|
||||||
if config.is_xbmc():
|
if config.is_xbmc():
|
||||||
if config.get_setting("sync_trakt_new_tvshow", "videolibrary"):
|
if config.get_setting("sync_trakt_new_tvshow", "videolibrary"):
|
||||||
import xbmc
|
import xbmc
|
||||||
|
|||||||
@@ -6163,6 +6163,10 @@ msgctxt "#70837"
|
|||||||
msgid "Enable/Disable Channels"
|
msgid "Enable/Disable Channels"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#70838"
|
||||||
|
msgid "There are no valid content for: %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
# DNS start [ settings and declaration ]
|
# DNS start [ settings and declaration ]
|
||||||
msgctxt "#707401"
|
msgctxt "#707401"
|
||||||
msgid "Enable DNS check alert"
|
msgid "Enable DNS check alert"
|
||||||
|
|||||||
@@ -6164,6 +6164,10 @@ msgctxt "#70837"
|
|||||||
msgid "Enable/Disable Channels"
|
msgid "Enable/Disable Channels"
|
||||||
msgstr "Abilita/Disabilita Canali"
|
msgstr "Abilita/Disabilita Canali"
|
||||||
|
|
||||||
|
msgctxt "#70838"
|
||||||
|
msgid "There are no valid content for: %s"
|
||||||
|
msgstr "Non ci sono contenti validi per: %s"
|
||||||
|
|
||||||
# DNS start [ settings and declaration ]
|
# DNS start [ settings and declaration ]
|
||||||
msgctxt "#707401"
|
msgctxt "#707401"
|
||||||
msgid "Enable DNS check alert"
|
msgid "Enable DNS check alert"
|
||||||
|
|||||||
Reference in New Issue
Block a user