From 7c4f18da4bc41cad68dbd02a2abb150c83084236 Mon Sep 17 00:00:00 2001
From: marco <10120390+mac12m99@users.noreply.github.com>
Date: Sun, 8 Nov 2020 11:35:14 +0100
Subject: [PATCH 1/2] workaround corruzzione settings.xml
---
platformcode/launcher.py | 16 +++++++++++++---
service.py | 3 +++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/platformcode/launcher.py b/platformcode/launcher.py
index d16ddf26..4d950d4b 100644
--- a/platformcode/launcher.py
+++ b/platformcode/launcher.py
@@ -72,9 +72,19 @@ def run(item=None):
else:
item = Item(channel="channelselector", action="getmainlist", viewmode="movie")
if not config.get_setting('show_once'):
- from platformcode import xbmc_videolibrary
- xbmc_videolibrary.ask_set_content(silent=False)
- config.set_setting('show_once', True)
+ if not config.get_all_settings_addon():
+ logger.error('corrupted settings.xml!!')
+ settings_xml = os.path.join(config.get_data_path(), "settings.xml")
+ settings_bak = os.path.join(config.get_data_path(), "settings.bak")
+ if filetools.exists(settings_bak):
+ filetools.copy(settings_bak, settings_xml, True)
+ logger.info('restored settings.xml from backup')
+ else:
+ filetools.write(settings_xml, '\n') # resetted settings
+ else:
+ from platformcode import xbmc_videolibrary
+ xbmc_videolibrary.ask_set_content(silent=False)
+ config.set_setting('show_once', True)
logger.info(item.tostring())
diff --git a/service.py b/service.py
index ada1b043..ad4182fe 100644
--- a/service.py
+++ b/service.py
@@ -326,6 +326,9 @@ class AddonMonitor(xbmc.Monitor):
def onSettingsChanged(self):
logger.debug('settings changed')
settings_post = config.get_all_settings_addon()
+ if settings_post: # backup settings
+ filetools.copy(os.path.join(config.get_data_path(), "settings.xml"),
+ os.path.join(config.get_data_path(), "settings.bak"), True)
from platformcode import xbmc_videolibrary
if self.settings_pre.get('downloadpath', None) != settings_post.get('downloadpath', None):
From f0849af647d7e282eecfc9bb2e5f435c7c697f24 Mon Sep 17 00:00:00 2001
From: marco <10120390+mac12m99@users.noreply.github.com>
Date: Sun, 8 Nov 2020 16:06:15 +0100
Subject: [PATCH 2/2] fix ricerca altadefinizioneclick e altre piccole
modifiche
---
channels.json | 2 +-
channels/altadefinizioneclick.py | 2 +-
channels/filmpertutti.py | 10 +++++-----
core/support.py | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/channels.json b/channels.json
index bf33df54..134505f7 100644
--- a/channels.json
+++ b/channels.json
@@ -6,6 +6,7 @@
"cineblog01": "https://cb01.uno",
"eurostreaming": "https://eurostreaming.link",
"film4k": "https://film4k-nuovo.link",
+ "filmpertutti": "https://filmpertutti.nuovo.live",
"ilcorsaronero": "https://lagazzettadelcorsaro.com",
"seriehd": "https://nuovoindirizzo.info/seriehd/",
"serietvonline": "https://serietvonline.online",
@@ -32,7 +33,6 @@
"fastsubita": "https://fastsubita.uno",
"filmgratis": "https://www.filmaltadefinizione.co",
"filmigratis": "https://filmigratis.org",
- "filmpertutti": "https://www.filmpertutti.voto",
"filmsenzalimiticc": "https://www.filmsenzalimiti01.club",
"filmstreaming01": "https://filmstreaming01.com",
"guardaserie_stream": "https://guardaserie.host",
diff --git a/channels/altadefinizioneclick.py b/channels/altadefinizioneclick.py
index 67fbcd2c..535e8ff9 100644
--- a/channels/altadefinizioneclick.py
+++ b/channels/altadefinizioneclick.py
@@ -99,7 +99,7 @@ def search(item, texto):
support.info("search ", texto)
item.args = 'search'
- item.url = host + "/?s=" + texto
+ item.url = host + "/search/" + texto
try:
return peliculas(item)
# Continua la ricerca in caso di errore
diff --git a/channels/filmpertutti.py b/channels/filmpertutti.py
index 2f58701d..eaeb8f3e 100644
--- a/channels/filmpertutti.py
+++ b/channels/filmpertutti.py
@@ -7,12 +7,12 @@ from core import httptools, support
from core.item import Item
from platformcode import config
-# def findhost(url):
-# page = httptools.downloadpage("https://filmpertutti.nuovo.live/").data
-# url = scrapertools.find_single_match(page, 'Il nuovo indirizzo di FILMPERTUTTI è \s+<', '> <', data)
+ data = re.sub(r'>\s{2,}<', '> <', data)
# replace all ' with " and eliminate newline, so we don't need to worry about
scrapingTime = time()
if patronBlock: