Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -175,10 +175,9 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
|
||||
support.info()
|
||||
itemlist=[]
|
||||
url = support.match(support.match(item).data.replace('"','"').replace('\\',''), patron=r'video_url"\s*:\s*"([^"]+)"').match
|
||||
playlist = support.match(url.replace('https','http'), patron=r'\./([^.]+)').matches
|
||||
for res in playlist:
|
||||
itemlist.append(item.clone(title=support.config.get_localized_string(30137), server='directo', url=url.replace('playlist',res), quality=res, action='play'))
|
||||
itemlist=[item.clone(title=support.config.get_localized_string(30137), server='directo', url=url, action='play')]
|
||||
return support.server(item, itemlist=itemlist)
|
||||
+5
-2
@@ -163,7 +163,7 @@ def set_infoLabels_item(item):
|
||||
if 'infoLabels' in item and 'fanart' in item.infoLabels['fanart']:
|
||||
item.fanart = item.infoLabels['fanart']
|
||||
|
||||
if 'infoLabels' in item and 'season' in item.infoLabels:
|
||||
if 'infoLabels' in item and 'season' in item.infoLabels and item.contentType == 'episode':
|
||||
try:
|
||||
int_season = int(item.infoLabels['season'])
|
||||
except ValueError:
|
||||
@@ -659,10 +659,12 @@ class Tvdb(object):
|
||||
|
||||
url = HOST + "/episodes/%s" % _id
|
||||
|
||||
# from core.support import dbg;dbg()
|
||||
|
||||
try:
|
||||
DEFAULT_HEADERS["Accept-Language"] = lang
|
||||
logger.debug("url: %s, \nheaders: %s" % (url, DEFAULT_HEADERS))
|
||||
dict_html = requests.get(url, headers=DEFAULT_HEADERS).json
|
||||
req = requests.get(url, headers=DEFAULT_HEADERS)
|
||||
|
||||
except Exception as ex:
|
||||
# if isinstance(ex, urllib).HTTPError:
|
||||
@@ -671,6 +673,7 @@ class Tvdb(object):
|
||||
logger.error("error en: %s" % message)
|
||||
|
||||
else:
|
||||
dict_html = req.json()
|
||||
# logger.info("dict_html %s" % dict_html)
|
||||
self.episodes[_id] = dict_html.pop("data") if 'Error' not in dict_html else {}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ class autorenumber():
|
||||
from specials.videolibrary import update_videolibrary
|
||||
check_renumber_options(self.item)
|
||||
update_videolibrary(self.item)
|
||||
if self.title in self.dictSeries:
|
||||
if self.title in self.dictSeries and ID in self.dictSeries[self.title] and self.dictSeries[self.title][ID] != '0':
|
||||
self.id = self.dictSeries[self.title][ID]
|
||||
self.Episodes = b64(self.dictSeries[self.title][EPISODE], 'decode')
|
||||
self.Season = self.dictSeries[self.title][SEASON]
|
||||
@@ -143,7 +143,6 @@ class autorenumber():
|
||||
self.item.contentSerieName = self.title.rstrip('123456789 ')
|
||||
|
||||
while not self.item.exit:
|
||||
self.item = platformtools.dialog_info(self.item, 'tvdb') # <- Enter title to search
|
||||
tvdb.find_and_set_infoLabels(self.item)
|
||||
if self.item.infoLabels['tvdb_id']: self.item.exit = True
|
||||
|
||||
@@ -162,7 +161,7 @@ class autorenumber():
|
||||
self.renumber()
|
||||
|
||||
def renumber(self):
|
||||
if not self.item.renumber and self.itemlist and len(self.Episodes) >= len(self.itemlist) and match(self.itemlist[0].title, patron=r'(\d+)').match in self.Episodes:
|
||||
if not self.item.renumber and self.itemlist and match(self.itemlist[0].title, patron=r'(\d+)').match.lstrip('0') in self.Episodes:
|
||||
if '|' in self.Season:
|
||||
season = int(self.Season.split('|')[0])
|
||||
addNumber = int(self.Season.split('|')[-1]) - 1
|
||||
@@ -171,16 +170,16 @@ class autorenumber():
|
||||
addNumber = 0
|
||||
|
||||
for item in self.itemlist:
|
||||
number = match(item.title, patron=r'(\d+)').match
|
||||
number = number.lstrip('0')
|
||||
if number:
|
||||
if number in self.Episodes:
|
||||
if season > 0: item.title = typo(self.Episodes[number] + ' - ', 'bold') + item.title
|
||||
else: item.title = typo('0x%s - ' % str(int(number) + addNumber), 'bold') + item.title
|
||||
else:
|
||||
self.makelist()
|
||||
if season > 0: item.title = typo(self.Episodes[number] + ' - ', 'bold') + item.title
|
||||
else: item.title = typo('0x%s - ' % str(int(number) + addNumber), 'bold') + item.title
|
||||
if not match(item.title, patron=r'(\d+)x(\d+)').match:
|
||||
number = match(item.title, patron=r'(\d+)').match.lstrip('0')
|
||||
if number:
|
||||
if number in self.Episodes:
|
||||
if season > 0: item.title = typo(self.Episodes[number] + ' - ', 'bold') + item.title
|
||||
else: item.title = typo('0x%s - ' % str(int(number) + addNumber), 'bold') + item.title
|
||||
else:
|
||||
self.makelist()
|
||||
if season > 0: item.title = typo(self.Episodes[number] + ' - ', 'bold') + item.title
|
||||
else: item.title = typo('0x%s - ' % str(int(number) + addNumber), 'bold') + item.title
|
||||
else:
|
||||
self.makelist()
|
||||
|
||||
@@ -270,24 +269,25 @@ class autorenumber():
|
||||
# specialsCount = 1
|
||||
# pdialog.update(80, 'rinumerazione')
|
||||
for item in itemlist:
|
||||
# Otiene Numerazione Episodi
|
||||
scraped_ep = match(re.sub(r'\[[^\]]+\]','',item.title), patron=r'(\d+)').match
|
||||
if scraped_ep:
|
||||
episode = int(scraped_ep)
|
||||
number = episode + FirstOfSeason - addiction
|
||||
if episode == 0:
|
||||
self.Episodes[str(episode)] = str(self.complete[self.regular[FirstOfSeason+1][2]][0])
|
||||
elif episode in Specials:
|
||||
self.Episodes[str(episode)] = Specials[episode]
|
||||
addiction += 1
|
||||
elif number <= len(self.regular) and number in self.regular:
|
||||
self.Episodes[str(episode)] = str(self.regular[number][0])
|
||||
else:
|
||||
try: Episodes[str(episode)] = str(self.complete[self.regular[number+2][2]][0])
|
||||
except: self.Episodes[str(episode)] = '0x0'
|
||||
if not match(re.sub(r'\[[^\]]+\]','',item.title), patron=r'(\d+)x(\d+)').match:
|
||||
# Otiene Numerazione Episodi
|
||||
scraped_ep = match(re.sub(r'\[[^\]]+\]','',item.title), patron=r'(\d+)').match
|
||||
if scraped_ep:
|
||||
episode = int(scraped_ep)
|
||||
number = episode + FirstOfSeason - addiction
|
||||
if episode == 0:
|
||||
self.Episodes[str(episode)] = str(self.complete[self.regular[FirstOfSeason+1][2]][0])
|
||||
elif episode in Specials:
|
||||
self.Episodes[str(episode)] = Specials[episode]
|
||||
addiction += 1
|
||||
elif number <= len(self.regular) and number in self.regular:
|
||||
self.Episodes[str(episode)] = str(self.regular[number][0])
|
||||
else:
|
||||
try: Episodes[str(episode)] = str(self.complete[self.regular[number+2][2]][0])
|
||||
except: self.Episodes[str(episode)] = '0x0'
|
||||
|
||||
|
||||
self.dictSeries[self.title][EPISODE] = b64(jsontools.dump(self.Episodes))
|
||||
if self.Episodes: self.dictSeries[self.title][EPISODE] = b64(jsontools.dump(self.Episodes))
|
||||
self.dictSeries[self.title][EPLIST] = b64(jsontools.dump(self.EpList))
|
||||
self.dictSeries[self.title][MODE] = self.Mode
|
||||
self.dictSeries[self.title][SEASON] = self.Season
|
||||
@@ -397,7 +397,7 @@ class SelectreNumerationWindow(xbmcgui.WindowXMLDialog):
|
||||
ep = '1'
|
||||
position = 0
|
||||
for i, item in enumerate(self.itemlist):
|
||||
title = match(item.title, patron=r'(\d+)').match
|
||||
title = match(item.title, patron=r'(\d+)').match.lstrip('0')
|
||||
it = xbmcgui.ListItem(title)
|
||||
if int(title) <= len(self.episodes):
|
||||
se, ep = self.episodes[title].split('x')
|
||||
@@ -420,11 +420,11 @@ class SelectreNumerationWindow(xbmcgui.WindowXMLDialog):
|
||||
self.getControl(SPECIALS).setVisible(False)
|
||||
self.getControl(MANUAL).setVisible(False)
|
||||
|
||||
for i, item in enumerate(self.itemlist):
|
||||
title = match(item.title, patron=r'(\d+)').match
|
||||
it = xbmcgui.ListItem(title)
|
||||
it.setProperty('index', str(i))
|
||||
self.items.append(it)
|
||||
for item in self.itemlist:
|
||||
if not match(item.title, patron=r'(\d+)x(\d+)').match:
|
||||
title = match(item.title, patron=r'(\d+)').match.lstrip('0')
|
||||
it = xbmcgui.ListItem(title)
|
||||
self.items.append(it)
|
||||
|
||||
self.getControl(POSTER).setImage(thumb)
|
||||
self.getControl(MPOSTER).setImage(thumb)
|
||||
|
||||
@@ -18,6 +18,9 @@ def download(item=None):
|
||||
|
||||
if filetools.exists(elementum_path):
|
||||
if platformtools.dialog_yesno(config.get_localized_string(70784), config.get_localized_string(70783)):
|
||||
addon_file = filetools.file_open(filetools.join(elementum_path,'addon.xml')).read()
|
||||
required = support.match(addon_file, patron=r'addon="([^"]+)').matches
|
||||
for r in required: xbmc.executebuiltin('InstallAddon(' + r + ')', wait=True)
|
||||
setting()
|
||||
platformtools.dialog_ok('Elementum', config.get_localized_string(70783))
|
||||
|
||||
@@ -32,6 +35,9 @@ def download(item=None):
|
||||
downloadtools.downloadfile(host + url, filename)
|
||||
extract()
|
||||
xbmc.sleep(1000)
|
||||
addon_file = filetools.file_open(filetools.join(elementum_path,'addon.xml')).read()
|
||||
required = support.match(addon_file, patron=r'addon="([^"]+)').matches
|
||||
for r in required: xbmc.executebuiltin('InstallAddon(' + r + ')', wait=True)
|
||||
setting()
|
||||
|
||||
|
||||
@@ -40,8 +46,8 @@ def extract():
|
||||
from platformcode.updater import fixZipGetHash
|
||||
support.info('Estraggo Elementum in:', elementum_path)
|
||||
try:
|
||||
hash = fixZipGetHash(filename)
|
||||
support.info(hash)
|
||||
# hash = fixZipGetHash(filename)
|
||||
# support.info(hash)
|
||||
|
||||
with zipfile.ZipFile(filetools.file_open(filename, 'rb', vfs=False)) as zip_ref:
|
||||
zip_ref.extractall(xbmc.translatePath(addon_path))
|
||||
|
||||
@@ -139,6 +139,10 @@ def run(item=None):
|
||||
from platformcode import backup
|
||||
return getattr(backup, item.action)(item)
|
||||
|
||||
elif item.channel == "elementum_download":
|
||||
from platformcode import elementum_download
|
||||
return getattr(elementum_download, item.action)(item)
|
||||
|
||||
elif item.channel == "shortcuts":
|
||||
from platformcode import shortcuts
|
||||
return getattr(shortcuts, item.action)(item)
|
||||
|
||||
@@ -20,6 +20,13 @@
|
||||
</animation>
|
||||
|
||||
<!-- BACKGROUND -->
|
||||
<control type="image">
|
||||
<width>1280</width>
|
||||
<height>720</height>
|
||||
<texture colordiffuse="FF232323">white.png</texture>
|
||||
</control>
|
||||
|
||||
<!-- FANART -->
|
||||
<control type="image" id='30000'>
|
||||
<width>1280</width>
|
||||
<height>720</height>
|
||||
|
||||
+10
-8
@@ -19,15 +19,17 @@ def test_video_exists(page_url):
|
||||
def get_video_url(page_url, video_password):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
video_urls = []
|
||||
from core.support import match
|
||||
matches = match(data, patron=r'(eval\(function\(p,a,c,k,e,d\).*?)\s+</script>').matches
|
||||
unpacked = ''
|
||||
for packed in matches:
|
||||
unpacked += jsunpack.unpack(packed) + '\n'
|
||||
|
||||
packed = scrapertools.find_single_match(data, r'(eval\(function\(p,a,c,k,e,d\).*?)\s+</script>')
|
||||
unpacked = jsunpack.unpack(packed)
|
||||
urls = match(unpacked, patron=r"videojs\d+[^;]+[^']+'[^']+'[^']+'(https://streamz.*?/get.*?.dll)").matches
|
||||
|
||||
url = scrapertools.find_single_match(unpacked, '(https://streamz.*?/get.*?.dll)')
|
||||
|
||||
url = url.replace("getmp4", "getlink").replace("getIink", "getlink")
|
||||
|
||||
url += "|User-Agent=%s" % httptools.get_user_agent()
|
||||
video_urls.append(["[streamZ]", url])
|
||||
for url in urls:
|
||||
url = url + "|User-Agent=%s" % httptools.get_user_agent()
|
||||
if not video_urls or url not in video_urls[-1]:
|
||||
video_urls.append(["[streamZ]", url])
|
||||
|
||||
return video_urls
|
||||
Reference in New Issue
Block a user