Community Channel
- Supporto a Pagination - Visualizzazione in Stagioni - Filtri nel menu di 2° livello - Thumbnails e plot nei filtri
This commit is contained in:
+1
-2
@@ -76,9 +76,8 @@ def episodios(item):
|
|||||||
episodes = support.match(item, r'<a href="([^"]+)">(\d+)<', '<h3>EPISODIO</h3><ul>(.*?)</ul>', headers, season_url)[0]
|
episodes = support.match(item, r'<a href="([^"]+)">(\d+)<', '<h3>EPISODIO</h3><ul>(.*?)</ul>', headers, season_url)[0]
|
||||||
for episode_url, episode in episodes:
|
for episode_url, episode in episodes:
|
||||||
episode_url = support.urlparse.urljoin(url, episode_url)
|
episode_url = support.urlparse.urljoin(url, episode_url)
|
||||||
title = season + "x" + episode.zfill(2)
|
title = season + "x" + episode.zfill(2) + ' - ' + item.fulltitle
|
||||||
data += title + '|' + episode_url + '\n'
|
data += title + '|' + episode_url + '\n'
|
||||||
support.log('DaTa= ',data)
|
|
||||||
patron = r'(?P<title>[^\|]+)\|(?P<url>[^\n]+)\n'
|
patron = r'(?P<title>[^\|]+)\|(?P<url>[^\n]+)\n'
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
return locals()
|
return locals()
|
||||||
|
|||||||
@@ -834,8 +834,6 @@ def add_tvshow(item, channel=None):
|
|||||||
|
|
||||||
# Obtiene el listado de episodios
|
# Obtiene el listado de episodios
|
||||||
if item.channel == 'community':
|
if item.channel == 'community':
|
||||||
itemlist = getattr(channel, 'get_seasons')(item)
|
|
||||||
else:
|
|
||||||
itemlist = getattr(channel, item.action)(item)
|
itemlist = getattr(channel, item.action)(item)
|
||||||
|
|
||||||
insertados, sobreescritos, fallidos, path = save_tvshow(item, itemlist)
|
insertados, sobreescritos, fallidos, path = save_tvshow(item, itemlist)
|
||||||
|
|||||||
@@ -608,7 +608,8 @@ def set_context_commands(item, parent_item):
|
|||||||
|
|
||||||
# elif item.contentSerieName:
|
# elif item.contentSerieName:
|
||||||
# Descargar serie
|
# Descargar serie
|
||||||
elif item.contentType == "tvshow" and item.action in ["episodios"]:
|
elif (item.contentType == "tvshow" and item.action in ["episodios"]) or \
|
||||||
|
(item.contentType == "tvshow" and item.action in ['get_seasons'] and config.get_setting('show_seasons',item.channel) == False):
|
||||||
item.contentType == "tvshow"
|
item.contentType == "tvshow"
|
||||||
context_commands.append((config.get_localized_string(60355), "XBMC.RunPlugin(%s?%s)" %
|
context_commands.append((config.get_localized_string(60355), "XBMC.RunPlugin(%s?%s)" %
|
||||||
(sys.argv[0], item.clone(channel="downloads", action="save_download",
|
(sys.argv[0], item.clone(channel="downloads", action="save_download",
|
||||||
|
|||||||
+14
-17
@@ -3,31 +3,28 @@
|
|||||||
"name": "Community",
|
"name": "Community",
|
||||||
"active": true,
|
"active": true,
|
||||||
"adult": false,
|
"adult": false,
|
||||||
"language": ["cast", "lat"],
|
"language": ["*"],
|
||||||
"thumbnail": "",
|
"thumbnail": "",
|
||||||
"banner": "",
|
"banner": "",
|
||||||
"fanart": "",
|
"fanart": "",
|
||||||
"categories": [
|
"categories": [],
|
||||||
"direct",
|
|
||||||
"movie",
|
|
||||||
"tvshow",
|
|
||||||
"vo"
|
|
||||||
],
|
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
"id": "filterlanguages",
|
"id": "pagination",
|
||||||
"type": "list",
|
"type": "list",
|
||||||
"label": "Mostrar enlaces del canal en idioma...",
|
"label": "Pagination",
|
||||||
"default": 3,
|
"default": 2,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"visible": true,
|
"visible": true,
|
||||||
"lvalues": [
|
"lvalues": ["@70708", "20", "40", "60", "80", "100"]
|
||||||
"No Filtrar",
|
},
|
||||||
"LAT",
|
{
|
||||||
"CAST",
|
"id": "show_seasons",
|
||||||
"VO",
|
"type": "bool",
|
||||||
"VOSE"
|
"label": "Show Seasons",
|
||||||
]
|
"default": false,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
+248
-89
@@ -1,9 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# -*- Channel Community -*-
|
# -*- Channel Community -*-
|
||||||
# -*- Created for Alfa-addon -*-
|
|
||||||
# -*- By the Alfa Develop Group -*-
|
|
||||||
|
|
||||||
import re, os, inspect, requests
|
import re, os, inspect, requests, xbmc, xbmcaddon
|
||||||
|
|
||||||
from core import httptools, scrapertoolsV2, servertools, jsontools, tmdb, support
|
from core import httptools, scrapertoolsV2, servertools, jsontools, tmdb, support
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
@@ -12,15 +10,15 @@ from channelselector import get_thumb
|
|||||||
from platformcode import config, platformtools
|
from platformcode import config, platformtools
|
||||||
from specials import autoplay
|
from specials import autoplay
|
||||||
|
|
||||||
import xbmc, xbmcaddon
|
|
||||||
|
|
||||||
addon = xbmcaddon.Addon('metadata.themoviedb.org')
|
addon = xbmcaddon.Addon('metadata.themoviedb.org')
|
||||||
lang = addon.getSetting('language')
|
lang = addon.getSetting('language')
|
||||||
|
|
||||||
|
defpage = ["", "20", "40", "60", "80", "100"]
|
||||||
|
defp = defpage[config.get_setting('pagination','community')]
|
||||||
|
show_seasons = config.get_setting('show_seasons','community')
|
||||||
|
|
||||||
list_data = {}
|
list_data = {}
|
||||||
|
|
||||||
# list_language = ['ITA', 'SUB-ITA']
|
|
||||||
list_servers = ['directo', 'akvideo', 'verystream', 'openload']
|
list_servers = ['directo', 'akvideo', 'verystream', 'openload']
|
||||||
list_quality = ['SD', '720', '1080', '4k']
|
list_quality = ['SD', '720', '1080', '4k']
|
||||||
|
|
||||||
@@ -68,7 +66,7 @@ def show_channels(item):
|
|||||||
if file_path.startswith('http'): file_url = httptools.downloadpage(file_path, follow_redirects=True).data
|
if file_path.startswith('http'): file_url = httptools.downloadpage(file_path, follow_redirects=True).data
|
||||||
else: file_url = open(file_path, "r").read()
|
else: file_url = open(file_path, "r").read()
|
||||||
|
|
||||||
# loa djson
|
# load json
|
||||||
json_url = jsontools.load(file_url)
|
json_url = jsontools.load(file_url)
|
||||||
|
|
||||||
thumbnail = relative('thumbnail', json_url, path)
|
thumbnail = relative('thumbnail', json_url, path)
|
||||||
@@ -85,6 +83,9 @@ def show_channels(item):
|
|||||||
channel_id = key,
|
channel_id = key,
|
||||||
context=context,
|
context=context,
|
||||||
path=path))
|
path=path))
|
||||||
|
|
||||||
|
autoplay.show_option(item.channel, itemlist)
|
||||||
|
support.channel_config(item, itemlist)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -93,56 +94,111 @@ def show_menu(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
support.log()
|
support.log()
|
||||||
|
|
||||||
json_data = load_json(item)
|
# If Second Level Menu
|
||||||
|
if item.menu:
|
||||||
|
menu = item.menu
|
||||||
|
item.menu = None
|
||||||
|
itemlist.append(item)
|
||||||
|
for key in menu:
|
||||||
|
if key != 'search':
|
||||||
|
if type(menu[key]) == dict:
|
||||||
|
title = menu[key]['title'] if menu[key].has_key('title') else item.title
|
||||||
|
thumbnail = relative('thumbnail', menu[key], item.path)
|
||||||
|
plot = menu[key]['plot'] if menu[key].has_key('plot') else ''
|
||||||
|
else:
|
||||||
|
title = menu[key]
|
||||||
|
thumbnail = item.thumbnail
|
||||||
|
plot = ''
|
||||||
|
|
||||||
if "menu" in json_data:
|
itemlist.append(Item(channel=item.channel,
|
||||||
for option in json_data['menu']:
|
title=typo(title,'submenu'),
|
||||||
thumbnail = relative('thumbnail', option, item.path)
|
url=item.url,
|
||||||
fanart = relative('fanart', option, item.path)
|
path=item.path,
|
||||||
plot = option['plot'] if option.has_key('plot') else item.plot
|
thumbnail=thumbnail,
|
||||||
url = relative('link', option, item.path)
|
plot=plot,
|
||||||
submenu = option['submenu'] if option.has_key('submenu') else []
|
action='submenu',
|
||||||
|
filterkey=key))
|
||||||
|
|
||||||
|
if menu.has_key('search'):
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
title=format_title(option['title']),
|
title=typo('Cerca ' + item.fulltitle +'...','color kod bold'),
|
||||||
thumbnail=thumbnail,
|
thumbnail=get_thumb('search.png'),
|
||||||
fanart=fanart,
|
action='search',
|
||||||
plot=plot,
|
url=item.url,
|
||||||
action='show_menu',
|
path=item.path))
|
||||||
url=url,
|
|
||||||
path=item.path))
|
|
||||||
if submenu:
|
|
||||||
for key in submenu:
|
|
||||||
if key != 'search':
|
|
||||||
itemlist.append(Item(channel=item.channel,
|
|
||||||
title=typo(submenu[key],'submenu'),
|
|
||||||
url=url,
|
|
||||||
path=item.path,
|
|
||||||
thumbnail=item.thumbnail,
|
|
||||||
action='submenu',
|
|
||||||
filterkey=key))
|
|
||||||
if submenu.has_key('search'):
|
|
||||||
itemlist.append(Item(channel=item.channel,
|
|
||||||
title=typo('Cerca ' + option['title'] +'...','color kod bold'),
|
|
||||||
thumbnail=get_thumb('search.png'),
|
|
||||||
action='search',
|
|
||||||
url=url,
|
|
||||||
path=item.path))
|
|
||||||
# add Search
|
|
||||||
itemlist.append(Item(channel=item.channel,
|
|
||||||
title=typo('Cerca nel Canale...','color kod bold'),
|
|
||||||
thumbnail=get_thumb('search.png'),
|
|
||||||
action='search',
|
|
||||||
url=item.url,
|
|
||||||
path=item.path))
|
|
||||||
# autoplay config only in main menu
|
|
||||||
if json_data.has_key('channel_name'): autoplay.show_option(item.channel, itemlist)
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
# select type of list
|
else:
|
||||||
if json_data.has_key("movies_list"): item.media_type= 'movies_list'
|
json_data = load_json(item)
|
||||||
elif json_data.has_key("tvshows_list"): item.media_type = 'tvshows_list'
|
|
||||||
elif json_data.has_key("episodes_list"): item.media_type = 'episodes_list'
|
if "menu" in json_data:
|
||||||
elif json_data.has_key("generic_list"): item.media_type= 'generic_list'
|
for option in json_data['menu']:
|
||||||
|
thumbnail = relative('thumbnail', option, item.path)
|
||||||
|
fanart = relative('fanart', option, item.path)
|
||||||
|
plot = option['plot'] if option.has_key('plot') else item.plot
|
||||||
|
url = relative('link', option, item.path)
|
||||||
|
submenu = option['submenu'] if option.has_key('submenu') else []
|
||||||
|
level2 = option['level2'] if option.has_key('level2') else []
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title=format_title(option['title']),
|
||||||
|
fulltitle=option['title'],
|
||||||
|
thumbnail=thumbnail,
|
||||||
|
fanart=fanart,
|
||||||
|
plot=plot,
|
||||||
|
action='show_menu',
|
||||||
|
url=url,
|
||||||
|
path=item.path,
|
||||||
|
menu=level2))
|
||||||
|
|
||||||
|
if submenu:
|
||||||
|
for key in submenu:
|
||||||
|
if key != 'search':
|
||||||
|
if type(submenu[key]) == dict:
|
||||||
|
title = submenu[key]['title'] if submenu[key].has_key('title') else item.title
|
||||||
|
thumbnail = relative('thumbnail', submenu[key], item.path)
|
||||||
|
plot = submenu[key]['plot'] if submenu[key].has_key('plot') else ''
|
||||||
|
else:
|
||||||
|
title = submenu[key]
|
||||||
|
thumbnail = item.thumbnail
|
||||||
|
plot = ''
|
||||||
|
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title=typo(title,'submenu'),
|
||||||
|
url=url,
|
||||||
|
path=item.path,
|
||||||
|
thumbnail=thumbnail,
|
||||||
|
plot=plot,
|
||||||
|
action='submenu',
|
||||||
|
filterkey=key))
|
||||||
|
if submenu.has_key('search'):
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title=typo('Cerca ' + option['title'] +'...','color kod bold'),
|
||||||
|
thumbnail=get_thumb('search.png'),
|
||||||
|
action='search',
|
||||||
|
url=url,
|
||||||
|
path=item.path))
|
||||||
|
# add Search
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title=typo('Cerca nel Canale...','color kod bold'),
|
||||||
|
thumbnail=get_thumb('search.png'),
|
||||||
|
action='search',
|
||||||
|
url=item.url,
|
||||||
|
path=item.path))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
# select type of list
|
||||||
|
if json_data.has_key("movies_list"):
|
||||||
|
item.media_type = 'movies_list'
|
||||||
|
item.contentType = 'movie'
|
||||||
|
elif json_data.has_key("tvshows_list"):
|
||||||
|
item.media_type = 'tvshows_list'
|
||||||
|
item.contentType = 'tvshow'
|
||||||
|
elif json_data.has_key("episodes_list"):
|
||||||
|
item.media_type = 'episodes_list'
|
||||||
|
item.contentType = 'episode'
|
||||||
|
elif json_data.has_key("generic_list"):
|
||||||
|
item.media_type= 'generic_list'
|
||||||
|
|
||||||
return list_all(item)
|
return list_all(item)
|
||||||
|
|
||||||
@@ -152,6 +208,7 @@ def submenu(item):
|
|||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
filter_list = []
|
filter_list = []
|
||||||
|
plot = item.plot
|
||||||
|
|
||||||
json_data = load_json(item)
|
json_data = load_json(item)
|
||||||
if json_data.has_key("movies_list"): item.media_type= 'movies_list'
|
if json_data.has_key("movies_list"): item.media_type= 'movies_list'
|
||||||
@@ -195,7 +252,12 @@ def submenu(item):
|
|||||||
|
|
||||||
|
|
||||||
def list_all(item):
|
def list_all(item):
|
||||||
support.log()
|
support.log('CONTENT TYPE ', item.contentType)
|
||||||
|
|
||||||
|
if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']:
|
||||||
|
pagination = int(defp) if defp.isdigit() else ''
|
||||||
|
else: pagination = ''
|
||||||
|
pag = item.page if item.page else 1
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
media_type = item.media_type
|
media_type = item.media_type
|
||||||
@@ -204,8 +266,9 @@ def list_all(item):
|
|||||||
infoLabels = item.infoLabels if item.infoLabels else {}
|
infoLabels = item.infoLabels if item.infoLabels else {}
|
||||||
|
|
||||||
if json_data:
|
if json_data:
|
||||||
for media in json_data[media_type]:
|
for i, media in enumerate(json_data[media_type]):
|
||||||
support.log(media)
|
if pagination and (pag - 1) * pagination > i: continue # pagination
|
||||||
|
if pagination and i >= pag * pagination: break # pagination
|
||||||
|
|
||||||
quality, language, plot, poster = set_extra_values(media, item.path)
|
quality, language, plot, poster = set_extra_values(media, item.path)
|
||||||
|
|
||||||
@@ -247,6 +310,19 @@ def list_all(item):
|
|||||||
contentSerieName=contentSerieName,
|
contentSerieName=contentSerieName,
|
||||||
infoLabels=infoLabels,
|
infoLabels=infoLabels,
|
||||||
action=action))
|
action=action))
|
||||||
|
if pagination and len(json_data[media_type]) >= pag * pagination:
|
||||||
|
if inspect.stack()[1][3] != 'get_newest':
|
||||||
|
itemlist.append(
|
||||||
|
Item(channel=item.channel,
|
||||||
|
action = item.action,
|
||||||
|
contentType=contentType,
|
||||||
|
title=typo(config.get_localized_string(30992), 'color kod bold'),
|
||||||
|
fulltitle= item.fulltitle,
|
||||||
|
show= item.show,
|
||||||
|
url=item.url,
|
||||||
|
args=item.args,
|
||||||
|
page=pag + 1,
|
||||||
|
thumbnail=support.thumb()))
|
||||||
|
|
||||||
if not 'generic_list' in json_data:
|
if not 'generic_list' in json_data:
|
||||||
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
||||||
@@ -259,6 +335,11 @@ def list_all(item):
|
|||||||
def list_filtered(item):
|
def list_filtered(item):
|
||||||
support.log()
|
support.log()
|
||||||
|
|
||||||
|
if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']:
|
||||||
|
pagination = int(defp) if defp.isdigit() else ''
|
||||||
|
else: pagination = ''
|
||||||
|
pag = item.page if item.page else 1
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
media_type = item.media_type
|
media_type = item.media_type
|
||||||
json_data = load_json(item)
|
json_data = load_json(item)
|
||||||
@@ -266,7 +347,9 @@ def list_filtered(item):
|
|||||||
infoLabels = item.infoLabels if item.infoLabels else {}
|
infoLabels = item.infoLabels if item.infoLabels else {}
|
||||||
|
|
||||||
if json_data:
|
if json_data:
|
||||||
for media in json_data[media_type]:
|
for i, media in enumerate(json_data[media_type]):
|
||||||
|
if pagination and (pag - 1) * pagination > i: continue # pagination
|
||||||
|
if pagination and i >= pag * pagination: break # pagination
|
||||||
if media.has_key(item.filterkey):
|
if media.has_key(item.filterkey):
|
||||||
filter_keys = [it.lower() for it in media[item.filterkey]] if type(media[item.filterkey]) == list else media[item.filterkey].lower()
|
filter_keys = [it.lower() for it in media[item.filterkey]] if type(media[item.filterkey]) == list else media[item.filterkey].lower()
|
||||||
if item.filter.lower() in filter_keys:
|
if item.filter.lower() in filter_keys:
|
||||||
@@ -312,15 +395,30 @@ def list_filtered(item):
|
|||||||
infoLabels=infoLabels,
|
infoLabels=infoLabels,
|
||||||
action=action))
|
action=action))
|
||||||
|
|
||||||
|
if pagination and len(json_data[media_type]) >= pag * pagination and len(itemlist) >= pag * pagination:
|
||||||
|
if inspect.stack()[1][3] != 'get_newest':
|
||||||
|
itemlist.append(
|
||||||
|
Item(channel=item.channel,
|
||||||
|
action = item.action,
|
||||||
|
contentType=contentType,
|
||||||
|
title=typo(config.get_localized_string(30992), 'color kod bold'),
|
||||||
|
fulltitle= item.fulltitle,
|
||||||
|
show= item.show,
|
||||||
|
url=item.url,
|
||||||
|
args=item.args,
|
||||||
|
page=pag + 1,
|
||||||
|
thumbnail=support.thumb()))
|
||||||
|
|
||||||
if not 'generic_list' in json_data:
|
if not 'generic_list' in json_data:
|
||||||
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
if item.personal_plot != item.plot and item.personal_plot:
|
if item.personal_plot != item.plot and item.personal_plot:
|
||||||
item.plot = '\n\n' + typo('','submenu') + '\n' + item.personal_plot + '\n' + typo('','submenu') + '\n\n' + item.plot
|
item.plot = '\n\n' + typo('','submenu') + '\n' + item.personal_plot + '\n' + typo('','submenu') + '\n\n' + item.plot
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def get_seasons(item):
|
def get_seasons(item):
|
||||||
|
itm = item
|
||||||
support.log()
|
support.log()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
infoLabels = item.infoLabels if item.infolabels else {}
|
infoLabels = item.infoLabels if item.infolabels else {}
|
||||||
@@ -343,12 +441,27 @@ def get_seasons(item):
|
|||||||
contentType='tvshow'))
|
contentType='tvshow'))
|
||||||
|
|
||||||
|
|
||||||
if inspect.stack()[1][3] in ['add_tvshow', "get_seasons"]:
|
if inspect.stack()[1][3] in ['add_tvshow', "get_seasons"] or show_seasons == False:
|
||||||
it = []
|
it = []
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
it += episodios(item)
|
it += episodios(item)
|
||||||
|
|
||||||
itemlist = it
|
itemlist = it
|
||||||
|
|
||||||
|
if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'get_newest']:
|
||||||
|
pagination = int(defp) if defp.isdigit() else ''
|
||||||
|
pag = itm.page if itm.page else 1
|
||||||
|
it = []
|
||||||
|
for i, item in enumerate(itemlist):
|
||||||
|
if pagination and (pag - 1) * pagination > i: continue # pagination
|
||||||
|
if pagination and i >= pag * pagination: break # pagination
|
||||||
|
it.append(item)
|
||||||
|
|
||||||
|
if pagination and len(itemlist) >= pag * pagination:
|
||||||
|
itm.page = pag + 1
|
||||||
|
itm.title=typo(config.get_localized_string(30992), 'color kod bold')
|
||||||
|
itm.thumbnail=support.thumb()
|
||||||
|
it.append(itm)
|
||||||
|
itemlist = it
|
||||||
else:
|
else:
|
||||||
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
||||||
itemlist = sorted(itemlist, key=lambda i: i.title)
|
itemlist = sorted(itemlist, key=lambda i: i.title)
|
||||||
@@ -359,13 +472,22 @@ def get_seasons(item):
|
|||||||
|
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
support.log()
|
support.log()
|
||||||
|
itm = item
|
||||||
|
|
||||||
|
if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']:
|
||||||
|
pagination = int(defp) if defp.isdigit() else ''
|
||||||
|
else: pagination = ''
|
||||||
|
pag = item.page if item.page else 1
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
json_data = load_json(item)
|
json_data = load_json(item)
|
||||||
infoLabels = item.infoLabels
|
infoLabels = item.infoLabels
|
||||||
ep = 1
|
ep = 1
|
||||||
season_number = infoLabels['season'] if infoLabels.has_key('season') else item.contentSeason if item.contentSeason else 1
|
season = infoLabels['season'] if infoLabels.has_key('season') else item.contentSeason if item.contentSeason else 1
|
||||||
for episode in json_data['episodes_list']:
|
|
||||||
|
for i, episode in enumerate(json_data['episodes_list']):
|
||||||
|
if pagination and (pag - 1) * pagination > i: continue # pagination
|
||||||
|
if pagination and i >= pag * pagination: break # pagination
|
||||||
match = []
|
match = []
|
||||||
if episode.has_key('number'): match = support.match(episode['number'], r'(?P<season>\d+)x(?P<episode>\d+)')[0][0]
|
if episode.has_key('number'): match = support.match(episode['number'], r'(?P<season>\d+)x(?P<episode>\d+)')[0][0]
|
||||||
if not match and episode.has_key('title'): match = support.match(episode['title'], r'(?P<season>\d+)x(?P<episode>\d+)')[0][0]
|
if not match and episode.has_key('title'): match = support.match(episode['title'], r'(?P<season>\d+)x(?P<episode>\d+)')[0][0]
|
||||||
@@ -374,34 +496,70 @@ def episodios(item):
|
|||||||
ep = int(match[1]) + 1
|
ep = int(match[1]) + 1
|
||||||
season_number = match[0]
|
season_number = match[0]
|
||||||
else:
|
else:
|
||||||
season_number = episode['season'] if episode.has_key('season') else 1
|
season_number = episode['season'] if episode.has_key('season') else season if season else 1
|
||||||
episode_number = episode['number'] if episode.has_key('number') else ''
|
episode_number = episode['number'] if episode.has_key('number') else ''
|
||||||
ep = int(episode_number) if episode_number else ep
|
if not episode_number.isdigit():
|
||||||
if not episode_number:
|
episode_number = support.match(episode['title'], r'(?P<episode>\d+)')[0][0]
|
||||||
episode_number = str(ep).zfill(2)
|
ep = int(episode_number) if episode_number else ep
|
||||||
ep += 1
|
if not episode_number:
|
||||||
|
episode_number = str(ep).zfill(2)
|
||||||
|
ep += 1
|
||||||
|
|
||||||
infoLabels['season'] = season_number
|
infoLabels['season'] = season_number
|
||||||
infoLabels['episode'] = episode_number
|
infoLabels['episode'] = episode_number
|
||||||
|
|
||||||
plot = episode['plot'] if episode.has_key('plot') else item.plot
|
plot = episode['plot'] if episode.has_key('plot') else item.plot
|
||||||
thumbnail = episode['poster'] if episode.has_key('poster') else episode['thumbnail'] if episode.has_key('thumbnail') else item.thumbnail
|
thumbnail = episode['poster'] if episode.has_key('poster') else episode['thumbnail'] if episode.has_key('thumbnail') else item.thumbnail
|
||||||
|
|
||||||
title = ' - ' + episode['title'] if episode.has_key('title') else ''
|
title = ' - ' + episode['title'] if episode.has_key('title') else ''
|
||||||
title = '%sx%s%s' % (season_number, episode_number, title)
|
title = '%sx%s%s' % (season_number, episode_number, title)
|
||||||
|
if season_number == item.filter or not item.filterseason:
|
||||||
|
itemlist.append(Item(channel= item.channel,
|
||||||
|
title= format_title(title),
|
||||||
|
fulltitle = item.fulltitle,
|
||||||
|
show = item.show,
|
||||||
|
url= episode,
|
||||||
|
action= 'findvideos',
|
||||||
|
plot= plot,
|
||||||
|
thumbnail= thumbnail,
|
||||||
|
contentSeason= season_number,
|
||||||
|
contentEpisode= episode_number,
|
||||||
|
infoLabels= infoLabels,
|
||||||
|
contentType= 'episode'))
|
||||||
|
|
||||||
itemlist.append(Item(channel= item.channel,
|
|
||||||
title= format_title(title),
|
if show_seasons == True and inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes'] and not item.filterseason:
|
||||||
fulltitle = item.fulltitle,
|
itm.contentType='season'
|
||||||
show = item.show,
|
season_list = []
|
||||||
url= episode,
|
for item in itemlist:
|
||||||
action= 'findvideos',
|
if item.contentSeason not in season_list:
|
||||||
plot= plot,
|
season_list.append(item.contentSeason)
|
||||||
thumbnail= thumbnail,
|
itemlist = []
|
||||||
contentSeason= season_number,
|
for season in season_list:
|
||||||
contentEpisode= episode_number,
|
itemlist.append(Item(channel=item.channel,
|
||||||
infoLabels= infoLabels,
|
title=format_title(config.get_localized_string(60027) % season),
|
||||||
contentType= 'episode'))
|
fulltitle=itm.fulltitle,
|
||||||
|
show=itm.show,
|
||||||
|
thumbnails=itm.thumbnails,
|
||||||
|
url=itm.url,
|
||||||
|
action='episodios',
|
||||||
|
contentSeason=season,
|
||||||
|
infoLabels=infoLabels,
|
||||||
|
filterseason=season))
|
||||||
|
|
||||||
|
elif pagination and len(json_data['episodes_list']) >= pag * pagination:
|
||||||
|
if inspect.stack()[1][3] != 'get_newest':
|
||||||
|
itemlist.append(
|
||||||
|
Item(channel=item.channel,
|
||||||
|
action = item.action,
|
||||||
|
contentType='episode',
|
||||||
|
title=typo(config.get_localized_string(30992), 'color kod bold'),
|
||||||
|
fulltitle= item.fulltitle,
|
||||||
|
show= item.show,
|
||||||
|
url=item.url,
|
||||||
|
args=item.args,
|
||||||
|
page=pag + 1,
|
||||||
|
thumbnail=support.thumb()))
|
||||||
|
|
||||||
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -421,7 +579,8 @@ def findvideos(item):
|
|||||||
|
|
||||||
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
||||||
|
|
||||||
autoplay.start(itemlist, item)
|
if inspect.stack()[2][3] != 'start_download':
|
||||||
|
autoplay.start(itemlist, item)
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|||||||
@@ -829,7 +829,7 @@ def save_download(item):
|
|||||||
item.contentAction = item.from_action if item.from_action else item.action
|
item.contentAction = item.from_action if item.from_action else item.action
|
||||||
|
|
||||||
if item.contentType in ["tvshow", "episode", "season"]:
|
if item.contentType in ["tvshow", "episode", "season"]:
|
||||||
if 'download' in item and item.channel != 'community':
|
if 'download' in item and config.get_setting('show_seasons',item.channel) == False:
|
||||||
heading = config.get_localized_string(70594) # <- Enter the season number
|
heading = config.get_localized_string(70594) # <- Enter the season number
|
||||||
item.dlseason = platformtools.dialog_numeric(0, heading, '')
|
item.dlseason = platformtools.dialog_numeric(0, heading, '')
|
||||||
if item.dlseason:
|
if item.dlseason:
|
||||||
|
|||||||
Reference in New Issue
Block a user