From 9d7d0efde919caccbdf8fc0a9bd8338c79269a35 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Thu, 10 Jun 2021 16:48:04 +0200 Subject: [PATCH 001/139] Contextmenu: rimuovi episodi locali ed elimina serie/canale --- platformcode/contextmenu/contextmenu.json | 2 +- .../{update_tv_show.py => tvshow_options.py} | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) rename platformcode/contextmenu/{update_tv_show.py => tvshow_options.py} (91%) diff --git a/platformcode/contextmenu/contextmenu.json b/platformcode/contextmenu/contextmenu.json index 0bd8617f..3acd6121 100644 --- a/platformcode/contextmenu/contextmenu.json +++ b/platformcode/contextmenu/contextmenu.json @@ -1,5 +1,5 @@ [ "platformcode.contextmenu.search", - "platformcode.contextmenu.update_tv_show", + "platformcode.contextmenu.tvshow_options", "platformcode.contextmenu.trailer" ] \ No newline at end of file diff --git a/platformcode/contextmenu/update_tv_show.py b/platformcode/contextmenu/tvshow_options.py similarity index 91% rename from platformcode/contextmenu/update_tv_show.py rename to platformcode/contextmenu/tvshow_options.py index 8c40e50e..fd501db8 100644 --- a/platformcode/contextmenu/update_tv_show.py +++ b/platformcode/contextmenu/tvshow_options.py @@ -148,7 +148,18 @@ def get_menu_items(): lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?{}&title={}&action=mark_tvshow_as_updatable&channel=videolibrary&active={})".format(item_url, update_text, str(value))))) if item.local_episodes_path == "": items.append((config.get_localized_string(80048), lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?{}&action=add_local_episodes&channel=videolibrary&path={})".format(item_url, path)))) + else: + items.append((config.get_localized_string(80049), lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?{}&action=remove_local_episodes&channel=videolibrary&path={})".format(item_url, path)))) + # Context menu: Delete series / channel + channels_num = len(item.library_urls) + if channels_num > 1: + delete_text = config.get_localized_string(60024) + multichannel = True + else: + delete_text = config.get_localized_string(60025) + multichannel = False + items.append((delete_text, lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?{}&action=delete&channel=videolibrary&multichannel={}&path={})".format(item_url, str(multichannel), path)))) # if config.get_setting('downloadenabled'): # from core import videolibrarytools # from core import filetools From 43f2509a563969a8f0b902fe7a0c1d30a4f27a92 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Thu, 10 Jun 2021 17:15:59 +0200 Subject: [PATCH 002/139] resolverdns: non ripete la chiamata se andata in timeout Disattivati guardaseriecam e ilgeniodellostreaming_cam --- channels/guardaseriecam.json | 2 +- channels/ilgeniodellostreaming_cam.json | 2 +- core/resolverdns.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/channels/guardaseriecam.json b/channels/guardaseriecam.json index f0e78dfd..ccd7af1a 100644 --- a/channels/guardaseriecam.json +++ b/channels/guardaseriecam.json @@ -2,7 +2,7 @@ "id": "guardaseriecam", "name": "GuardaSerie Cam", "language": ["ita", "sub-ita"], - "active": true, + "active": false, "thumbnail": "https://raw.githubusercontent.com/32Dexter/DexterRepo/master/media/guardaserie_live.png", "banner": "", "categories": ["tvshow"], diff --git a/channels/ilgeniodellostreaming_cam.json b/channels/ilgeniodellostreaming_cam.json index f51f9627..78746f9b 100644 --- a/channels/ilgeniodellostreaming_cam.json +++ b/channels/ilgeniodellostreaming_cam.json @@ -1,7 +1,7 @@ { "id": "ilgeniodellostreaming_cam", "name": "IlGenioDelloStreaming CAM", - "active": true, + "active": false, "language": ["ita"], "thumbnail": "ilgeniodellostreaming.png", "banner": "ilgeniodellostreaming.png", diff --git a/core/resolverdns.py b/core/resolverdns.py index 8e87ecd2..325faf35 100644 --- a/core/resolverdns.py +++ b/core/resolverdns.py @@ -114,7 +114,7 @@ class CipherSuiteAdapter(host_header_ssl.HostHeaderSSLAdapter): ret = super(CipherSuiteAdapter, self).send(request, **kwargs) if 400 <= ret.status_code < 500: raise Exception - except Exception as e: + except (requests.exceptions.HTTPError, requests.exceptions.ConnectionError, requests.exceptions.SSLError) as e: logger.info('Request for ' + domain + ' with ip ' + ip + ' failed') logger.info(e) # if 'SSLError' in str(e): From e4755fd44c8971be5aa2ee26d18d76d49c706d85 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Thu, 10 Jun 2021 17:40:02 +0200 Subject: [PATCH 003/139] KoD 1.7 --- addon.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addon.xml b/addon.xml index dc06e2f4..934b03b4 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -28,8 +28,10 @@ resources/media/screenshot-2.png resources/media/screenshot-3.png - - Corretto blocco nella ricerca globale - - migliorie e fix vari ai canali e al core + - Aggiunto menu globale "opzioni di KoD" +- Aggiunto canale tapmovie e server annessi +- Notifica quando il tipo di vista viene salvata (con indicazione del tipo di contenuto) + Naviga velocemente sul web e guarda i contenuti presenti [COLOR red]The owners and submitters to this addon do not host or distribute any of the content displayed by these addons nor do they have any affiliation with the content providers.[/COLOR] [COLOR yellow]Kodi © is a registered trademark of the XBMC Foundation. We are not connected to or in any other way affiliated with Kodi, Team Kodi, or the XBMC Foundation. Furthermore, any software, addons, or products offered by us will receive no support in official Kodi channels, including the Kodi forums and various social networks.[/COLOR] From 2816a0880182fe71079ac7728628fbf7dc03e4b3 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Fri, 11 Jun 2021 09:35:37 +0200 Subject: [PATCH 004/139] Fix Tmdb, Menu contestuale, Autoplay --- core/tmdb.py | 5 +++-- platformcode/contextmenu/__init__.py | 1 + platformcode/platformtools.py | 10 ++++------ 3 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 platformcode/contextmenu/__init__.py diff --git a/core/tmdb.py b/core/tmdb.py index ee2133f3..452b4ccf 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -1537,12 +1537,13 @@ class Tmdb(object): return ret_dic def get_list_episodes(self): - url = '{}/tv/{}?api_key={}&language={}'.format(host=host, id=self.search_id, api=api, lang=self.search_language) + # from core.support import dbg;dbg() + url = '{}/tv/{}?api_key={}&language={}'.format(host, self.search_id, api, self.search_language) results = requests.get(url).json().get('seasons', []) seasons = [] if results and 'Error' not in results: for season in results: - url = '{host}/tv/{id}/season/{season}?api_key={api}&language={lang}'.format(host=host, id=self.search_id, season=season['season_number'], api=api, lang=self.search_language) + url = '{}/tv/{}/season/{}?api_key={}&language={}'.format(host, self.search_id, season['season_number'], api, self.search_language) try: start_from = requests.get(url).json()['episodes'][0]['episode_number'] except: start_from = 1 seasons.append({'season_number':season['season_number'], 'episode_count':season['episode_count'], 'start_from':start_from}) diff --git a/platformcode/contextmenu/__init__.py b/platformcode/contextmenu/__init__.py new file mode 100644 index 00000000..7c68785e --- /dev/null +++ b/platformcode/contextmenu/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- \ No newline at end of file diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 8c87fb38..b3d3d755 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -336,11 +336,8 @@ def render_items(itemlist, parent_item): if not item.title: item.title = '' # If there is no action or it is findvideos / play, folder = False because no listing will be returned - if item.folder == "": # not set - if item.action in ['play', '']: - item.folder = False - else: - item.folder = True + if item.action in ['play', '']: + item.folder = False if item.fanart == "": item.fanart = parent_item.fanart if item.action == 'play' and thumb_type == 1 and not item.forcethumb: @@ -361,7 +358,8 @@ def render_items(itemlist, parent_item): listitem.setArt({'icon': icon_image, 'thumb': item.thumbnail, 'poster': item.thumbnail, 'fanart': item.fanart if item.fanart else default_fanart}) - listitem.setProperty('IsPlayable', str(config.get_setting("player_mode") == 1 and item.action == "play" and not item.nfo).lower()) + if config.get_setting("player_mode") == 1 and item.action == "play" and not item.nfo: + listitem.setProperty('IsPlayable', 'true') set_infolabels(listitem, item) From 3286638d37f780768e16e513e1afae967573f498 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Fri, 11 Jun 2021 09:59:36 +0200 Subject: [PATCH 005/139] Rimosso extended info, non compatibile con Kodi 19 --- platformcode/platformtools.py | 10 ---------- resources/settings.xml | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index b3d3d755..58cca5cc 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -343,16 +343,6 @@ def render_items(itemlist, parent_item): if item.action == 'play' and thumb_type == 1 and not item.forcethumb: item.thumbnail = config.get_online_server_thumb(item.server) - # if cloudflare and cloudscraper is used, cookies are needed to display images taken from site - # before checking domain (time consuming), checking if tmdb failed (so, images scraped from website are used) - # if item.action in ['findvideos'] and not item.infoLabels['tmdb_id']: - # faster but ugly way of checking - # for d in httptools.FORCE_CLOUDSCRAPER_LIST: - # if d + '/' in item.url: - # item.thumbnail = httptools.get_url_headers(item.thumbnail) - # item.fanart = httptools.get_url_headers(item.fanart) - # break - icon_image = "DefaultFolder.png" if item.folder else "DefaultVideo.png" listitem = xbmcgui.ListItem(item.title) listitem.setArt({'icon': icon_image, 'thumb': item.thumbnail, 'poster': item.thumbnail, diff --git a/resources/settings.xml b/resources/settings.xml index 5399e071..1e28af6f 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -152,7 +152,7 @@ - + From a95aa5f8160d1f6bc5c44c70b94c65c8fd4852fa Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Fri, 11 Jun 2021 10:46:49 +0200 Subject: [PATCH 006/139] Fix Rinumerazione all'aggiunta in videoteca --- core/videolibrarytools.py | 2 ++ platformcode/autorenumber.py | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/core/videolibrarytools.py b/core/videolibrarytools.py index 1c16fad0..0d793db6 100644 --- a/core/videolibrarytools.py +++ b/core/videolibrarytools.py @@ -1010,6 +1010,7 @@ def add_tvshow(item, channel=None): @param channel: channel from which the series will be saved. By default, item.from_channel or item.channel will be imported. """ + logger.debug("show=#" + item.show + "#") from platformcode.launcher import set_search_temp; set_search_temp(item) @@ -1055,6 +1056,7 @@ def add_tvshow(item, channel=None): if not check(item): action = item.action item.renumber = True + item.disabletmdb = True start(item) item.renumber = False item.action = action diff --git a/platformcode/autorenumber.py b/platformcode/autorenumber.py index 9047ad7c..81dbade3 100644 --- a/platformcode/autorenumber.py +++ b/platformcode/autorenumber.py @@ -145,16 +145,18 @@ class autorenumber(): elif not self.item.infoLabels['tmdb_id']: self.item.contentSerieName = self.title.rstrip('123456789 ') - self.item.infoLabels['imdb_id'] = '' - self.item.infoLabels['tvdb_id'] = '' - self.item.infoLabels['tmdb_id'] = '' - self.item.infoLabels['year'] = '-' self.item.contentType = 'tvshow' - while not self.item.exit: - tmdb.find_and_set_infoLabels(self.item) - if self.item.infoLabels['tmdb_id']: self.item.exit = True - else:self.item = platformtools.dialog_info(self.item, 'tmdb') + if not self.item.disabletmdb: + self.item.infoLabels['imdb_id'] = '' + self.item.infoLabels['tvdb_id'] = '' + self.item.infoLabels['tmdb_id'] = '' + self.item.infoLabels['year'] = '-' + + while not self.item.exit: + tmdb.find_and_set_infoLabels(self.item) + if self.item.infoLabels['tmdb_id']: self.item.exit = True + else:self.item = platformtools.dialog_info(self.item, 'tmdb') # Rinumerazione Automatica if (not self.id and self.auto) or self.item.renumber: From 39a2a4f64b2c03b266a4646871c4e6ddabb87f88 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sat, 12 Jun 2021 10:50:03 +0200 Subject: [PATCH 007/139] service: migliore rilancio se aggiornato --- service.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/service.py b/service.py index 4ad50208..cb51d21f 100644 --- a/service.py +++ b/service.py @@ -28,6 +28,9 @@ from platformcode import logger, platformtools, updater, xbmc_videolibrary from specials import videolibrary from servers import torrent +# if this service need to be reloaded because an update changed it +needsReload = False + def update(path, p_dialog, i, t, serie, overwrite): logger.debug("Updating " + path) @@ -284,11 +287,9 @@ def check_for_update(overwrite=True): def updaterCheck(): + global needsReload # updater check updated, needsReload = updater.check(background=True) - if needsReload: - xbmc.executescript(__file__) - exit(0) def get_ua_list(): @@ -516,6 +517,12 @@ if __name__ == "__main__": except: logger.error(traceback.format_exc()) + if needsReload: + db.close() + logger.info('Relaunching service.py') + xbmc.executescript(__file__) + break + if monitor.waitForAbort(1): # every second # db need to be closed when not used, it will cause freezes db.close() From 3048b4914027b6ba0d3ada4c5b17b4727ee08e67 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sat, 12 Jun 2021 10:54:52 +0200 Subject: [PATCH 008/139] prova --- service.py | 1 - 1 file changed, 1 deletion(-) diff --git a/service.py b/service.py index cb51d21f..cfbd9056 100644 --- a/service.py +++ b/service.py @@ -6,7 +6,6 @@ import sys import threading import traceback import xbmc -import xbmcgui from platformcode import config try: From a62841c1b3a574f098792499624b70b23bac790b Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sun, 13 Jun 2021 10:34:55 +0200 Subject: [PATCH 009/139] possibile fix backup su kodi 19 --- platformcode/backup.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/platformcode/backup.py b/platformcode/backup.py index e9596559..bf86b9d6 100644 --- a/platformcode/backup.py +++ b/platformcode/backup.py @@ -3,7 +3,7 @@ # Backup and restore video library # ------------------------------------------------------------ -import datetime, xbmc, os, shutil +import datetime, xbmc, os, shutil, sys from zipfile import ZipFile from core import videolibrarytools, filetools @@ -11,12 +11,15 @@ from platformcode import logger, config, platformtools, xbmc_videolibrary from distutils.dir_util import copy_tree from specials import videolibrary -temp_path = u'' + xbmc.translatePath("special://userdata/addon_data/plugin.video.kod/temp/") -videolibrary_temp_path = u'' + xbmc.translatePath("special://userdata/addon_data/plugin.video.kod/temp/videolibrary") -movies_path = u'' + filetools.join(videolibrary_temp_path, "movies") -tvshows_path = u'' + filetools.join(videolibrary_temp_path, "tvshows") -videolibrary_movies_path = u'' + videolibrarytools.MOVIES_PATH -videolibrary_tvshows_path = u'' + videolibrarytools.TVSHOWS_PATH +PY3 = False +if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int + +temp_path = unicode(xbmc.translatePath("special://userdata/addon_data/plugin.video.kod/temp/")) +videolibrary_temp_path = unicode(xbmc.translatePath("special://userdata/addon_data/plugin.video.kod/temp/videolibrary")) +movies_path = unicode(filetools.join(videolibrary_temp_path, "movies")) +tvshows_path = unicode(filetools.join(videolibrary_temp_path, "tvshows")) +videolibrary_movies_path = unicode(videolibrarytools.MOVIES_PATH) +videolibrary_tvshows_path = unicode(videolibrarytools.TVSHOWS_PATH) def export_videolibrary(item): @@ -25,7 +28,7 @@ def export_videolibrary(item): zip_file_folder = platformtools.dialog_browse(3, config.get_localized_string(80002)) if zip_file_folder == "": return - zip_file = u'' + xbmc.translatePath(zip_file_folder + "KoD_video_library-" + str(datetime.date.today()) + ".zip") + zip_file = unicode(xbmc.translatePath(zip_file_folder + "KoD_video_library-" + str(datetime.date.today()) + ".zip")) p_dialog = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(80003)) # p_dialog.update(0) @@ -53,7 +56,7 @@ def export_videolibrary(item): def import_videolibrary(item): logger.info() - zip_file = u'' + platformtools.dialog_browse(1, config.get_localized_string(80005), mask=".zip") + zip_file = unicode(platformtools.dialog_browse(1, config.get_localized_string(80005), mask=".zip")) if zip_file == "": return if not platformtools.dialog_yesno(config.get_localized_string(20000), config.get_localized_string(80006)): @@ -112,6 +115,7 @@ def zip(dir, file): if smb: filetools.move(file, temp) + def unzip(dir, file): if file.lower().startswith('smb://'): temp = filetools.join(temp_path, os.path.split(file)[-1]) From 29a4769bcca74bb26ed44931e1e93c29152829af Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 15 Jun 2021 18:00:42 +0000 Subject: [PATCH 010/139] {Aggiornamento domini} --- channels.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/channels.json b/channels.json index af78f550..6efc8dd4 100644 --- a/channels.json +++ b/channels.json @@ -17,16 +17,16 @@ "discoveryplus": "https://www.discoveryplus.com", "dreamsub": "https://dreamsub.stream", "dsda": "https://www.dsda.press", - "eurostreaming": "https://eurostreaming.click", + "eurostreaming": "https://eurostreaming.rocks", "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", "guardaserieclick": "https://www.guardaserie.support", - "guardaserieicu": "https://guardaserie.agency", + "guardaserieicu": "https://guardaserie.cleaning", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", "ilgeniodellostreaming": "https://ilgeniodellostreaming.ist", "ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.shop", - "italiaserie": "https://italiaserie.cam", + "italiaserie": "https://italiaserie.buzz", "mediasetplay": "https://www.mediasetplay.mediaset.it", "mondoserietv": "https://mondoserietv.club", "paramount": "https://www.paramountnetwork.it", @@ -36,7 +36,7 @@ "serietvonline": "https://serietvonline.art", "serietvsubita": "http://serietvsubita.xyz", "serietvu": "https://www.serietvu.link", - "streamingcommunity": "https://streamingcommunity.xyz", + "streamingcommunity": "https://streamingcommunity.tv", "streamtime": "https://t.me/s/StreamTime", "tantifilm": "https://www.tantifilm.vision", "tapmovie": "https://it.tapmovie.net", From cf125d1e2b853ed8895d06c0e16eebd0bffd3482 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Wed, 16 Jun 2021 09:33:30 +0200 Subject: [PATCH 011/139] Fix Impostazioni server --- core/servertools.py | 5 +++-- core/support.py | 2 ++ platformcode/shortcuts.py | 5 ++--- servers/akvideo.json | 16 ---------------- servers/anavids.json | 16 ---------------- servers/animeid.json | 16 ---------------- servers/anonfile.json | 16 ---------------- servers/archiveorg.json | 16 ---------------- servers/backin.json | 16 ---------------- servers/badshare.json | 16 ---------------- servers/bdupload.json | 16 ---------------- servers/cinemaupload.json | 16 ---------------- servers/clicknupload.json | 16 ---------------- servers/clipwatching.json | 16 ---------------- servers/cloudvideo.json | 16 ---------------- servers/crunchyroll.json | 16 ---------------- servers/dailymotion.json | 16 ---------------- servers/deltabit.json | 16 ---------------- servers/directo.json | 16 ---------------- servers/doodstream.json | 16 ---------------- servers/dostream.json | 16 ---------------- servers/downace.json | 16 ---------------- servers/facebook.json | 16 ---------------- servers/fastplay.json | 16 ---------------- servers/fembed.json | 16 ---------------- servers/fex.json | 16 ---------------- servers/filefactory.json | 16 ---------------- servers/filepup.json | 16 ---------------- servers/filescdn.json | 16 ---------------- servers/filesmonster.json | 16 ---------------- servers/flashx.json | 16 ---------------- servers/fourshared.json | 16 ---------------- servers/gamovideo.json | 16 ---------------- servers/gigasize.json | 16 ---------------- servers/googlevideo.json | 16 ---------------- servers/gounlimited.json | 16 ---------------- servers/gvideo.json | 16 ---------------- servers/hdload.json | 16 ---------------- servers/hdmario.json | 16 ---------------- servers/hugefiles.json | 16 ---------------- servers/hxfile.json | 16 ---------------- servers/idtbox.json | 16 ---------------- servers/jawcloud.json | 16 ---------------- servers/jetload.json | 16 ---------------- servers/mailru.json | 16 ---------------- servers/mediafire.json | 16 ---------------- servers/mega.json | 16 ---------------- servers/mixdrop.json | 16 ---------------- servers/mp4upload.json | 16 ---------------- servers/mydaddy.json | 16 ---------------- servers/mystream.json | 16 ---------------- servers/myupload.json | 16 ---------------- servers/netutv.json | 16 ---------------- servers/ninjastream.json | 16 ---------------- servers/nowvideo.json | 16 ---------------- servers/okru.json | 16 ---------------- servers/okstream.json | 16 ---------------- servers/onefichier.json | 16 ---------------- servers/onlystream.json | 16 ---------------- servers/paramount_server.json | 16 ---------------- servers/playtube.json | 16 ---------------- servers/rapidgator.json | 16 ---------------- servers/rcdnme.json | 16 ---------------- servers/rutube.json | 16 ---------------- servers/samaup.json | 16 ---------------- servers/sendvid.json | 16 ---------------- servers/speedvideo.json | 16 ---------------- servers/streamtape.json | 16 ---------------- servers/streamz.json | 16 ---------------- servers/supervideo.json | 16 ---------------- servers/thevid.json | 16 ---------------- servers/thevideobee.json | 16 ---------------- servers/torrent.json | 16 ---------------- servers/turbobit.json | 16 ---------------- servers/turbovid.json | 16 ---------------- servers/tusfiles.json | 16 ---------------- servers/uploadedto.json | 16 ---------------- servers/uppom.json | 16 ---------------- servers/upstream.json | 16 ---------------- servers/uptobox.json | 16 ---------------- servers/upvid.json | 16 ---------------- servers/uqload.json | 16 ---------------- servers/userload.json | 16 ---------------- servers/userscloud.json | 16 ---------------- servers/vevio.json | 16 ---------------- servers/vidcloud.json | 16 ---------------- servers/videobin.json | 16 ---------------- servers/videomega.json | 16 ---------------- servers/vidfast.json | 16 ---------------- servers/vidlox.json | 16 ---------------- servers/vidmoly.json | 16 ---------------- servers/vidoza.json | 16 ---------------- servers/vidtodo.json | 16 ---------------- servers/vidtome.json | 16 ---------------- servers/vidup.json | 16 ---------------- servers/vimeo.json | 16 ---------------- servers/vimpleru.json | 16 ---------------- servers/vivo.json | 16 ---------------- servers/vk.json | 16 ---------------- servers/vshare.json | 16 ---------------- servers/vudeo.json | 16 ---------------- servers/vupplayer.json | 16 ---------------- servers/vvvvid.json | 16 ---------------- servers/watchanimestream.json | 16 ---------------- servers/watchvideo.json | 16 ---------------- servers/youdbox.json | 16 ---------------- servers/yourupload.json | 16 ---------------- servers/youtube.json | 16 ---------------- servers/youwatch.json | 16 ---------------- servers/zippyshare.json | 16 ---------------- 110 files changed, 7 insertions(+), 1717 deletions(-) diff --git a/core/servertools.py b/core/servertools.py index e461c358..de4a73b8 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -670,7 +670,8 @@ def get_servers_list(): if server.endswith(".json") and not server == "version.json": server_parameters = get_server_parameters(server) server_list[server.split(".")[0]] = server_parameters - if type(server_list) != dict: server_list = sort_servers(server_list) + + # if type(server_list) != dict: server_list = sort_servers(server_list) return server_list @@ -698,7 +699,7 @@ def sort_servers(servers_list): :param servers_list: List of servers to order. The items in the servers_list can be strings or Item objects. In which case it is necessary that they have an item.server attribute of type str. :return: List of the same type of objects as servers_list ordered according to the favorite servers. """ - if servers_list and config.get_setting('favorites_servers'): + if servers_list: if isinstance(servers_list[0], Item): servers_list = sorted(servers_list, key=lambda x: config.get_setting("favorites_servers_list", server=x.server)) else: diff --git a/core/support.py b/core/support.py index f15760a6..4700b413 100755 --- a/core/support.py +++ b/core/support.py @@ -1262,6 +1262,8 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru logger.error(traceback.format_exc()) pass + verifiedItemlist = servertools.sort_servers(verifiedItemlist) + if Videolibrary and item.contentChannel != 'videolibrary': videolibrary(verifiedItemlist, item) if Download: diff --git a/platformcode/shortcuts.py b/platformcode/shortcuts.py index 7e21b3f7..13e0f8db 100644 --- a/platformcode/shortcuts.py +++ b/platformcode/shortcuts.py @@ -24,7 +24,6 @@ def settings_menu(item): config.open_settings() def servers_menu(item): - # from core.support import dbg; dbg() from core import servertools from core.item import Item from platformcode import config, platformtools @@ -38,7 +37,7 @@ def servers_menu(item): server_list = list(servertools.get_debriders_list().keys()) for server in server_list: server_parameters = servertools.get_server_parameters(server) - if server_parameters['has_settings']: + if server_parameters['has_settings'] and server_parameters['active']: names.append(server_parameters['name']) ids.append(server) @@ -55,7 +54,7 @@ def servers_menu(item): server_list = list(servertools.get_servers_list().keys()) for server in sorted(server_list): server_parameters = servertools.get_server_parameters(server) - if server_parameters["has_settings"] and [x for x in server_parameters["settings"] if x["id"] not in ["black_list", "white_list"]]: + if server_parameters["has_settings"] and [x for x in server_parameters["settings"]] and server_parameters['active']: names.append(server_parameters['name']) ids.append(server) diff --git a/servers/akvideo.json b/servers/akvideo.json index b290f6ea..b31fcfda 100644 --- a/servers/akvideo.json +++ b/servers/akvideo.json @@ -25,22 +25,6 @@ "label": "$ADDON[plugin.video.kod 70708]", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "$ADDON[plugin.video.kod 60655]", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ], "cloudflare": true diff --git a/servers/anavids.json b/servers/anavids.json index 4b7fc58c..00ee9fb2 100644 --- a/servers/anavids.json +++ b/servers/anavids.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/animeid.json b/servers/animeid.json index dd665438..275459c0 100644 --- a/servers/animeid.json +++ b/servers/animeid.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/anonfile.json b/servers/anonfile.json index ec27fd8b..4c5ab9d5 100644 --- a/servers/anonfile.json +++ b/servers/anonfile.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/archiveorg.json b/servers/archiveorg.json index 7f38cbb4..05156456 100644 --- a/servers/archiveorg.json +++ b/servers/archiveorg.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/backin.json b/servers/backin.json index dc4b4256..233e592f 100644 --- a/servers/backin.json +++ b/servers/backin.json @@ -28,22 +28,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/badshare.json b/servers/badshare.json index 079cab25..75a35c44 100644 --- a/servers/badshare.json +++ b/servers/badshare.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/bdupload.json b/servers/bdupload.json index 50eea6ce..ad5d6722 100644 --- a/servers/bdupload.json +++ b/servers/bdupload.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ], diff --git a/servers/cinemaupload.json b/servers/cinemaupload.json index c7627a01..6203a380 100644 --- a/servers/cinemaupload.json +++ b/servers/cinemaupload.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/clicknupload.json b/servers/clicknupload.json index 2d2d8889..d4a4a5e1 100644 --- a/servers/clicknupload.json +++ b/servers/clicknupload.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/clipwatching.json b/servers/clipwatching.json index d84e2fe8..e8614f04 100644 --- a/servers/clipwatching.json +++ b/servers/clipwatching.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/cloudvideo.json b/servers/cloudvideo.json index ee4c442d..eea14731 100644 --- a/servers/cloudvideo.json +++ b/servers/cloudvideo.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/crunchyroll.json b/servers/crunchyroll.json index 1eee02ca..00520d3e 100644 --- a/servers/crunchyroll.json +++ b/servers/crunchyroll.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/dailymotion.json b/servers/dailymotion.json index d454aeaa..d5ddb284 100644 --- a/servers/dailymotion.json +++ b/servers/dailymotion.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/deltabit.json b/servers/deltabit.json index ed0e8e07..ee3796cd 100644 --- a/servers/deltabit.json +++ b/servers/deltabit.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/directo.json b/servers/directo.json index 0e74446c..185c7952 100644 --- a/servers/directo.json +++ b/servers/directo.json @@ -53,22 +53,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/doodstream.json b/servers/doodstream.json index 0bc82263..c9cf0239 100644 --- a/servers/doodstream.json +++ b/servers/doodstream.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/dostream.json b/servers/dostream.json index 9435b1c2..cf442451 100644 --- a/servers/dostream.json +++ b/servers/dostream.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/downace.json b/servers/downace.json index decdc6d8..f0009b4d 100644 --- a/servers/downace.json +++ b/servers/downace.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/facebook.json b/servers/facebook.json index a37b6f6b..84deee4b 100644 --- a/servers/facebook.json +++ b/servers/facebook.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/fastplay.json b/servers/fastplay.json index 291307bb..bc379972 100755 --- a/servers/fastplay.json +++ b/servers/fastplay.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/fembed.json b/servers/fembed.json index a3513e81..9f8279f0 100644 --- a/servers/fembed.json +++ b/servers/fembed.json @@ -17,22 +17,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ], "version": 1 diff --git a/servers/fex.json b/servers/fex.json index 2ccc5997..654a85b9 100644 --- a/servers/fex.json +++ b/servers/fex.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ], diff --git a/servers/filefactory.json b/servers/filefactory.json index ed63f53b..b36ea388 100644 --- a/servers/filefactory.json +++ b/servers/filefactory.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/filepup.json b/servers/filepup.json index d2c5c0f9..a4b4d652 100644 --- a/servers/filepup.json +++ b/servers/filepup.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/filescdn.json b/servers/filescdn.json index 7448aebc..ae6b870c 100644 --- a/servers/filescdn.json +++ b/servers/filescdn.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/filesmonster.json b/servers/filesmonster.json index d2e4f40b..66a3794d 100644 --- a/servers/filesmonster.json +++ b/servers/filesmonster.json @@ -24,22 +24,6 @@ "type": "bool", "visible": true }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - }, { "default": false, "enabled": true, diff --git a/servers/flashx.json b/servers/flashx.json index 231c65f7..80cbbe83 100644 --- a/servers/flashx.json +++ b/servers/flashx.json @@ -27,22 +27,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/fourshared.json b/servers/fourshared.json index 1efd7f51..03d8f8d2 100644 --- a/servers/fourshared.json +++ b/servers/fourshared.json @@ -34,22 +34,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/gamovideo.json b/servers/gamovideo.json index eee03921..24b2fb10 100755 --- a/servers/gamovideo.json +++ b/servers/gamovideo.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/gigasize.json b/servers/gigasize.json index 29a1c02a..7363b07f 100644 --- a/servers/gigasize.json +++ b/servers/gigasize.json @@ -28,22 +28,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/googlevideo.json b/servers/googlevideo.json index 1ca06c9b..e921bc37 100644 --- a/servers/googlevideo.json +++ b/servers/googlevideo.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/gounlimited.json b/servers/gounlimited.json index dfaad755..efb48919 100644 --- a/servers/gounlimited.json +++ b/servers/gounlimited.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/gvideo.json b/servers/gvideo.json index b2839bc7..67d97b3b 100644 --- a/servers/gvideo.json +++ b/servers/gvideo.json @@ -40,22 +40,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/hdload.json b/servers/hdload.json index 58635ef0..e49e7827 100644 --- a/servers/hdload.json +++ b/servers/hdload.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/hdmario.json b/servers/hdmario.json index 649515b7..45f3372b 100644 --- a/servers/hdmario.json +++ b/servers/hdmario.json @@ -21,22 +21,6 @@ "type": "bool", "visible": true }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - }, { "default": "", "enabled": true, diff --git a/servers/hugefiles.json b/servers/hugefiles.json index 6fde0486..952ccbcd 100644 --- a/servers/hugefiles.json +++ b/servers/hugefiles.json @@ -23,22 +23,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/hxfile.json b/servers/hxfile.json index e5707946..c5218c8a 100644 --- a/servers/hxfile.json +++ b/servers/hxfile.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ], "thumbnail": "hxfile.png" diff --git a/servers/idtbox.json b/servers/idtbox.json index 6f143dd9..9d1fde5f 100644 --- a/servers/idtbox.json +++ b/servers/idtbox.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/jawcloud.json b/servers/jawcloud.json index 8fcef964..67b4a6e8 100644 --- a/servers/jawcloud.json +++ b/servers/jawcloud.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/jetload.json b/servers/jetload.json index bc46f8c0..7e14ea5d 100644 --- a/servers/jetload.json +++ b/servers/jetload.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/mailru.json b/servers/mailru.json index b3925c44..0ab8a0a5 100644 --- a/servers/mailru.json +++ b/servers/mailru.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/mediafire.json b/servers/mediafire.json index 46ff6665..c66e9dc4 100644 --- a/servers/mediafire.json +++ b/servers/mediafire.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/mega.json b/servers/mega.json index c7f8c4c5..b3491a93 100644 --- a/servers/mega.json +++ b/servers/mega.json @@ -39,22 +39,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/mixdrop.json b/servers/mixdrop.json index 1141cc68..3bd631a1 100644 --- a/servers/mixdrop.json +++ b/servers/mixdrop.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/mp4upload.json b/servers/mp4upload.json index f2ced1e7..a8933f2c 100644 --- a/servers/mp4upload.json +++ b/servers/mp4upload.json @@ -22,22 +22,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/mydaddy.json b/servers/mydaddy.json index ca0becd0..7f84d09f 100644 --- a/servers/mydaddy.json +++ b/servers/mydaddy.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/mystream.json b/servers/mystream.json index aab74820..f000511a 100644 --- a/servers/mystream.json +++ b/servers/mystream.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/myupload.json b/servers/myupload.json index 3ddbf417..20f18e57 100644 --- a/servers/myupload.json +++ b/servers/myupload.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/netutv.json b/servers/netutv.json index 49cda818..75ca5bab 100755 --- a/servers/netutv.json +++ b/servers/netutv.json @@ -39,22 +39,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/ninjastream.json b/servers/ninjastream.json index f83d1b2e..dddfa1d1 100644 --- a/servers/ninjastream.json +++ b/servers/ninjastream.json @@ -19,22 +19,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/nowvideo.json b/servers/nowvideo.json index 3beb9b3e..8f8c5ed6 100644 --- a/servers/nowvideo.json +++ b/servers/nowvideo.json @@ -30,22 +30,6 @@ "type": "bool", "visible": true }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - }, { "default": false, "enabled": true, diff --git a/servers/okru.json b/servers/okru.json index 0ed2c3bd..4d014953 100644 --- a/servers/okru.json +++ b/servers/okru.json @@ -25,22 +25,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/okstream.json b/servers/okstream.json index 932b1bcc..838f8492 100644 --- a/servers/okstream.json +++ b/servers/okstream.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/onefichier.json b/servers/onefichier.json index f0dec829..07ab88cc 100644 --- a/servers/onefichier.json +++ b/servers/onefichier.json @@ -30,22 +30,6 @@ "type": "bool", "visible": true }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - }, { "default": false, "enabled": true, diff --git a/servers/onlystream.json b/servers/onlystream.json index 72fb3e77..1203a86a 100644 --- a/servers/onlystream.json +++ b/servers/onlystream.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/paramount_server.json b/servers/paramount_server.json index f6a3b33a..0e3ef590 100644 --- a/servers/paramount_server.json +++ b/servers/paramount_server.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/playtube.json b/servers/playtube.json index c15809d4..a8a26125 100644 --- a/servers/playtube.json +++ b/servers/playtube.json @@ -21,22 +21,6 @@ "label": "@60654", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ], "thumbnail": "playtube.png" diff --git a/servers/rapidgator.json b/servers/rapidgator.json index a208a349..f3288ce4 100644 --- a/servers/rapidgator.json +++ b/servers/rapidgator.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/rcdnme.json b/servers/rcdnme.json index 5dd14287..ef2366ba 100644 --- a/servers/rcdnme.json +++ b/servers/rcdnme.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/rutube.json b/servers/rutube.json index 496f6005..4b492c4c 100644 --- a/servers/rutube.json +++ b/servers/rutube.json @@ -23,22 +23,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/samaup.json b/servers/samaup.json index dfe9063d..32fb4706 100644 --- a/servers/samaup.json +++ b/servers/samaup.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/sendvid.json b/servers/sendvid.json index e1e1ac64..cf4e75bd 100755 --- a/servers/sendvid.json +++ b/servers/sendvid.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/speedvideo.json b/servers/speedvideo.json index 3ef4a00b..67fe1402 100644 --- a/servers/speedvideo.json +++ b/servers/speedvideo.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/streamtape.json b/servers/streamtape.json index 0ae9499a..b324a717 100644 --- a/servers/streamtape.json +++ b/servers/streamtape.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/streamz.json b/servers/streamz.json index 129f8d4d..87afb7a8 100644 --- a/servers/streamz.json +++ b/servers/streamz.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/supervideo.json b/servers/supervideo.json index eba2c8ff..35a1efd0 100644 --- a/servers/supervideo.json +++ b/servers/supervideo.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/thevid.json b/servers/thevid.json index e723747b..176318e3 100644 --- a/servers/thevid.json +++ b/servers/thevid.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/thevideobee.json b/servers/thevideobee.json index c6a24f4f..09feda5f 100644 --- a/servers/thevideobee.json +++ b/servers/thevideobee.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/torrent.json b/servers/torrent.json index 7b0bb703..2124724b 100644 --- a/servers/torrent.json +++ b/servers/torrent.json @@ -65,22 +65,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/turbobit.json b/servers/turbobit.json index 2e206895..5932536d 100644 --- a/servers/turbobit.json +++ b/servers/turbobit.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/turbovid.json b/servers/turbovid.json index 564868e0..62e82c02 100644 --- a/servers/turbovid.json +++ b/servers/turbovid.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/tusfiles.json b/servers/tusfiles.json index 92c13339..f60bf378 100644 --- a/servers/tusfiles.json +++ b/servers/tusfiles.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/uploadedto.json b/servers/uploadedto.json index 4934da71..7bf2e716 100644 --- a/servers/uploadedto.json +++ b/servers/uploadedto.json @@ -38,22 +38,6 @@ "type": "bool", "visible": true }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - }, { "default": false, "enabled": true, diff --git a/servers/uppom.json b/servers/uppom.json index f7509b04..ecb01065 100644 --- a/servers/uppom.json +++ b/servers/uppom.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/upstream.json b/servers/upstream.json index 8bd05840..e596cff1 100644 --- a/servers/upstream.json +++ b/servers/upstream.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/uptobox.json b/servers/uptobox.json index a54c62c2..790852f4 100644 --- a/servers/uptobox.json +++ b/servers/uptobox.json @@ -28,22 +28,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/upvid.json b/servers/upvid.json index 00aaf9c2..8532cfe4 100644 --- a/servers/upvid.json +++ b/servers/upvid.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/uqload.json b/servers/uqload.json index 9a361b42..b92e932c 100644 --- a/servers/uqload.json +++ b/servers/uqload.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/userload.json b/servers/userload.json index 1aca3d12..7c00595d 100644 --- a/servers/userload.json +++ b/servers/userload.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/userscloud.json b/servers/userscloud.json index 8a72bd45..24195723 100644 --- a/servers/userscloud.json +++ b/servers/userscloud.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/vevio.json b/servers/vevio.json index 9ad090be..ed30cb9c 100644 --- a/servers/vevio.json +++ b/servers/vevio.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/vidcloud.json b/servers/vidcloud.json index 21882336..4bc2e319 100644 --- a/servers/vidcloud.json +++ b/servers/vidcloud.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/videobin.json b/servers/videobin.json index f7ec3af0..12fa204f 100644 --- a/servers/videobin.json +++ b/servers/videobin.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/videomega.json b/servers/videomega.json index 2f97d68a..1907d1c0 100644 --- a/servers/videomega.json +++ b/servers/videomega.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/vidfast.json b/servers/vidfast.json index 693b50ce..97447af9 100644 --- a/servers/vidfast.json +++ b/servers/vidfast.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/vidlox.json b/servers/vidlox.json index f3b386eb..110fca12 100644 --- a/servers/vidlox.json +++ b/servers/vidlox.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/vidmoly.json b/servers/vidmoly.json index aba842f8..5e2d578c 100644 --- a/servers/vidmoly.json +++ b/servers/vidmoly.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/vidoza.json b/servers/vidoza.json index 997832ff..876f4e4e 100644 --- a/servers/vidoza.json +++ b/servers/vidoza.json @@ -23,22 +23,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/vidtodo.json b/servers/vidtodo.json index fa25c7cd..862b21e3 100755 --- a/servers/vidtodo.json +++ b/servers/vidtodo.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/vidtome.json b/servers/vidtome.json index 40ad1b70..c21efca5 100644 --- a/servers/vidtome.json +++ b/servers/vidtome.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/vidup.json b/servers/vidup.json index 3a44c83c..316badd6 100755 --- a/servers/vidup.json +++ b/servers/vidup.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/vimeo.json b/servers/vimeo.json index 04053b66..99d9097c 100644 --- a/servers/vimeo.json +++ b/servers/vimeo.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/vimpleru.json b/servers/vimpleru.json index 479ce5c7..0a917385 100644 --- a/servers/vimpleru.json +++ b/servers/vimpleru.json @@ -25,22 +25,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/vivo.json b/servers/vivo.json index 5f653935..a0ec30f5 100644 --- a/servers/vivo.json +++ b/servers/vivo.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/vk.json b/servers/vk.json index 885ffc0d..c8eb79be 100755 --- a/servers/vk.json +++ b/servers/vk.json @@ -42,22 +42,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/vshare.json b/servers/vshare.json index a4e2f676..d273abb1 100644 --- a/servers/vshare.json +++ b/servers/vshare.json @@ -29,22 +29,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/vudeo.json b/servers/vudeo.json index 6bf6630c..421cc0f0 100644 --- a/servers/vudeo.json +++ b/servers/vudeo.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/vupplayer.json b/servers/vupplayer.json index 477e3b7a..ba020d9f 100644 --- a/servers/vupplayer.json +++ b/servers/vupplayer.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/vvvvid.json b/servers/vvvvid.json index f20d6bd1..c8386db4 100644 --- a/servers/vvvvid.json +++ b/servers/vvvvid.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/watchanimestream.json b/servers/watchanimestream.json index badc9617..dab8aa4c 100644 --- a/servers/watchanimestream.json +++ b/servers/watchanimestream.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/watchvideo.json b/servers/watchvideo.json index c090e484..3cbb53bc 100644 --- a/servers/watchvideo.json +++ b/servers/watchvideo.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/youdbox.json b/servers/youdbox.json index 94ea49e3..0a0a442f 100644 --- a/servers/youdbox.json +++ b/servers/youdbox.json @@ -20,22 +20,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ], "thumbnail": "youdbox.png" diff --git a/servers/yourupload.json b/servers/yourupload.json index 0d978bb1..11c3aa3e 100755 --- a/servers/yourupload.json +++ b/servers/yourupload.json @@ -30,22 +30,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } diff --git a/servers/youtube.json b/servers/youtube.json index d8235284..a6ffb466 100755 --- a/servers/youtube.json +++ b/servers/youtube.json @@ -28,22 +28,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/youwatch.json b/servers/youwatch.json index ffea3ec2..13a589e2 100644 --- a/servers/youwatch.json +++ b/servers/youwatch.json @@ -23,22 +23,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file diff --git a/servers/zippyshare.json b/servers/zippyshare.json index 4d136ce6..910dd45d 100644 --- a/servers/zippyshare.json +++ b/servers/zippyshare.json @@ -24,22 +24,6 @@ "label": "@70708", "type": "bool", "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false } ] } \ No newline at end of file From 8e020bb605fffa09c676b56e08eb03dc527c6abd Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Wed, 16 Jun 2021 09:39:05 +0200 Subject: [PATCH 012/139] Fix Autoplay --- core/autoplay.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/core/autoplay.py b/core/autoplay.py index 53a291de..d7d9fdd1 100644 --- a/core/autoplay.py +++ b/core/autoplay.py @@ -49,16 +49,22 @@ def start(itemlist, item): if not blacklisted_servers: blacklisted_servers = [] from core import servertools + favorite_servers = config.get_setting('favorites_servers_list', server='servers') + servers_list = list(servertools.get_servers_list().items()) for server, server_parameters in servers_list: - if config.get_setting('favorites_servers_list', server=server): + if config.get_setting('favorites_servers_list', server=server) and server.lower() not in favorite_servers: favorite_servers.append(server.lower()) if not favorite_servers: config.set_setting('favorites_servers_list', [], server='servers') favorite_servers = [] else: - favorite_servers = list(set(favorite_servers) - set(blacklisted_servers)) + s_list = [] + for s in favorite_servers: + if s not in blacklisted_servers: + s_list.append(s) + favorite_servers = s_list # Save the current value of "Action and Player Mode" in preferences user_config_setting_action = config.get_setting("default_action") @@ -75,6 +81,7 @@ def start(itemlist, item): # 2: Servers only # 3: Only qualities # 4: Do not order + if config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action'): priority = 0 # 0: Servers and qualities or 1: Qualities and servers elif config.get_setting('favorites_servers') and favorite_servers: @@ -87,7 +94,6 @@ def start(itemlist, item): if config.get_setting('default_action') == 1: quality_list.reverse() favorite_quality = quality_list - for item in itemlist: autoplay_elem = dict() b_dict = dict() @@ -109,7 +115,7 @@ def start(itemlist, item): # if the server and the quality are not in the favorites lists or the url is repeated, we discard the item if item.server.lower() not in favorite_servers or item.quality.lower() not in favorite_quality or item.url in url_list_valid: item.type_b = True - item.play_from = base_item.play_from + item.window = base_item.window b_dict['videoitem']= item autoplay_b.append(b_dict) continue @@ -121,7 +127,7 @@ def start(itemlist, item): # if the server is not in the favorites list or the url is repeated, we discard the item if item.server.lower() not in favorite_servers or item.url in url_list_valid: item.type_b = True - item.play_from = base_item.play_from + item.window = base_item.window b_dict['videoitem'] = item autoplay_b.append(b_dict) continue @@ -132,7 +138,7 @@ def start(itemlist, item): # if the quality is not in the favorites list or the url is repeated, we discard the item if item.quality.lower() not in favorite_quality or item.url in url_list_valid: item.type_b = True - item.play_from = base_item.play_from + item.window = base_item.window b_dict['videoitem'] = item autoplay_b.append(b_dict) continue @@ -141,14 +147,14 @@ def start(itemlist, item): else: # Do not order # if the url is repeated, we discard the item - item.play_from = base_item.play_from + item.window = base_item.window if item.url in url_list_valid: continue # If the item reaches here we add it to the list of valid urls and to autoplay_list url_list_valid.append(item.url) item.plan_b=True - item.play_from = base_item.play_from + item.window = base_item.window autoplay_elem['videoitem'] = item autoplay_list.append(autoplay_elem) @@ -241,6 +247,7 @@ def start(itemlist, item): play_item = base_item.clone(**videoitem.__dict__) platformtools.play_video(play_item, autoplay=True) else: + videoitem.window = base_item.window # If it doesn't come from the video library, just play platformtools.play_video(videoitem, autoplay=True) except: From 964cc80cce743a4308b517a9fcbeb70d99ae8f27 Mon Sep 17 00:00:00 2001 From: fatshotty Date: Wed, 16 Jun 2021 17:59:53 +0200 Subject: [PATCH 013/139] Streamingcommunity (#309) * added folder for new server * WIP: streamingcommunity and animeunity * streaming community for animeunity * httpserver for streaming from streamingcommunity ws * fix for episode and tvshows * log and code cleanup * fixed multi stream for streamingcommunity. Use 'serve_forever' in order to avoid infinite loop * added log for debug and info. Little fixes --- channels/animeunity.py | 511 ++++++++++++++++------------- core/servertools.py | 4 +- lib/streamingcommunity/__init__.py | 3 + lib/streamingcommunity/client.py | 285 ++++++++++++++++ lib/streamingcommunity/handler.py | 73 +++++ lib/streamingcommunity/server.py | 39 +++ servers/streamingcommunityws.json | 15 + servers/streamingcommunityws.py | 30 ++ specials/setting.py | 7 +- 9 files changed, 740 insertions(+), 227 deletions(-) create mode 100644 lib/streamingcommunity/__init__.py create mode 100644 lib/streamingcommunity/client.py create mode 100644 lib/streamingcommunity/handler.py create mode 100644 lib/streamingcommunity/server.py create mode 100644 servers/streamingcommunityws.json create mode 100755 servers/streamingcommunityws.py diff --git a/channels/animeunity.py b/channels/animeunity.py index bde40045..27ec52a0 100644 --- a/channels/animeunity.py +++ b/channels/animeunity.py @@ -1,222 +1,289 @@ -# -*- coding: utf-8 -*- -# ------------------------------------------------------------ -# Canale per AnimeUnity -# ------------------------------------------------------------ - -from lib.requests.sessions import session -import requests, json, copy, inspect -from core import support -from platformcode import autorenumber - -host = support.config.get_channel_url() -response = support.httptools.downloadpage(host + '/archivio') -csrf_token = support.match(response.data, patron='name="csrf-token" content="([^"]+)"').match -headers = {'content-type': 'application/json;charset=UTF-8', - 'x-csrf-token': csrf_token, - 'Cookie' : '; '.join([x.name + '=' + x.value for x in response.cookies])} - - -@support.menu -def mainlist(item): - top = [('Ultimi Episodi', ['', 'news'])] - - menu = [('Anime {bullet bold}',['', 'menu', {}, 'tvshow']), - ('Film {submenu}',['', 'menu', {'type': 'Movie'}]), - ('TV {submenu}',['', 'menu', {'type': 'TV'}, 'tvshow']), - ('OVA {submenu} {tv}',['', 'menu', {'type': 'OVA'}, 'tvshow']), - ('ONA {submenu} {tv}',['', 'menu', {'type': 'ONA'}, 'tvshow']), - ('Special {submenu} {tv}',['', 'menu', {'type': 'Special'}, 'tvshow'])] - search ='' - return locals() - -def menu(item): - item.action = 'peliculas' - ITA = copy.copy(item.args) - ITA['title'] = '(ita)' - InCorso = copy.copy(item.args) - InCorso['status'] = 'In Corso' - Terminato = copy.copy(item.args) - Terminato['status'] = 'Terminato' - itemlist = [item.clone(title=support.typo('Tutti','bold')), - item.clone(title=support.typo('ITA','bold'), args=ITA), - item.clone(title=support.typo('Genere','bold'), action='genres'), - item.clone(title=support.typo('Anno','bold'), action='years')] - if item.contentType == 'tvshow': - itemlist += [item.clone(title=support.typo('In Corso','bold'), args=InCorso), - item.clone(title=support.typo('Terminato','bold'), args=Terminato)] - itemlist +=[item.clone(title=support.typo('Cerca...','bold'), action='search', thumbnail=support.thumb('search'))] - return itemlist - - -def genres(item): - support.info() - # support.dbg() - itemlist = [] - - genres = json.loads(support.match(response.text, patron='genres="([^"]+)').match.replace('"','"')) - - for genre in genres: - item.args['genres'] = [genre] - itemlist.append(item.clone(title=support.typo(genre['name'],'bold'), action='peliculas')) - return support.thumb(itemlist) - -def years(item): - support.info() - itemlist = [] - - from datetime import datetime - current_year = datetime.today().year - oldest_year = int(support.match(response.text, patron='anime_oldest_date="([^"]+)').match) - - for year in list(reversed(range(oldest_year, current_year + 1))): - item.args['year']=year - itemlist.append(item.clone(title=support.typo(year,'bold'), action='peliculas')) - return itemlist - - -def search(item, text): - support.info('search', item) - if not item.args: - item.args = {'title':text} - else: - item.args['title'] = text - item.search = text - - try: - return peliculas(item) - # Continua la ricerca in caso di errore - except: - import sys - for line in sys.exc_info(): - support.info('search log:', line) - return [] - - -def newest(categoria): - support.info(categoria) - itemlist = [] - item = support.Item() - item.url = host - - try: - itemlist = news(item) - - if itemlist[-1].action == 'news': - itemlist.pop() - # Continua la ricerca in caso di errore - except: - import sys - for line in sys.exc_info(): - support.info(line) - return [] - - return itemlist - -def news(item): - support.info() - item.contentType = 'episode' - itemlist = [] - import cloudscraper - session = cloudscraper.create_scraper() - - fullJs = json.loads(support.match(session.get(item.url).text, headers=headers, patron=r'items-json="([^"]+)"', debug=True).match.replace('"','"')) - js = fullJs['data'] - - for it in js: - itemlist.append( - item.clone(title= support.typo(it['anime']['title'] + ' - EP. ' + it['number'], 'bold'), - fulltitle=it['anime']['title'], - thumbnail=it['anime']['imageurl'], - forcethumb = True, - video_url=it['link'], - plot=it['anime']['plot'], - action='findvideos') - ) - if 'next_page_url' in fullJs: - itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'),thumbnail=support.thumb(), url=fullJs['next_page_url'])) - return itemlist - - -def peliculas(item): - support.info() - itemlist = [] - - page = item.page if item.page else 0 - item.args['offset'] = page * 30 - - order = support.config.get_setting('order', item.channel) - if order: - order_list = [ "Standard", "Lista A-Z", "Lista Z-A", "Popolarità", "Valutazione" ] - item.args['order'] = order_list[order] - - payload = json.dumps(item.args) - records = requests.post(host + '/archivio/get-animes', headers=headers, data=payload).json()['records'] - - for it in records: - lang = support.match(it['title'], patron=r'\(([It][Tt][Aa])\)').match - title = support.re.sub(r'\s*\([^\)]+\)', '', it['title']) - - if 'ita' in lang.lower(): language = 'ITA' - else: language = 'Sub-ITA' - - itm = item.clone(title=support.typo(title,'bold') + support.typo(language,'_ [] color kod') + (support.typo(it['title_eng'],'_ ()') if it['title_eng'] else '')) - itm.contentLanguage = language - itm.type = it['type'] - itm.thumbnail = it['imageurl'] - itm.plot = it['plot'] - itm.url = item.url - - if it['episodes_count'] == 1: - itm.contentType = 'movie' - itm.fulltitle = itm.show = itm.contentTitle = title - itm.contentSerieName = '' - itm.action = 'findvideos' - itm.video_url = it['episodes'][0]['link'] - - else: - itm.contentType = 'tvshow' - itm.contentTitle = '' - itm.fulltitle = itm.show = itm.contentSerieName = title - itm.action = 'episodios' - itm.episodes = it['episodes'] if 'episodes' in it else it['link'] - itm.video_url = item.url - - itemlist.append(itm) - - autorenumber.start(itemlist) - if len(itemlist) >= 30: - itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), page=page + 1)) - - return itemlist - -def episodios(item): - support.info() - itemlist = [] - title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio ' - for it in item.episodes: - itemlist.append( - item.clone(title=support.typo(title + it['number'], 'bold'), - episode = it['number'], - fulltitle=item.title, - show=item.title, - contentTitle='', - contentSerieName=item.contentSerieName, - thumbnail=item.thumbnail, - plot=item.plot, - action='findvideos', - contentType='episode', - video_url=it['link'])) - - if inspect.stack()[1][3] not in ['find_episodes']: - autorenumber.start(itemlist, item) - support.videolibrary(itemlist, item) - support.download(itemlist, item) - return itemlist - - -def findvideos(item): - support.info() - if not 'vvvvid' in item.video_url: - return support.server(item,itemlist=[item.clone(title=support.config.get_localized_string(30137), url=item.video_url, server='directo', action='play')]) - else: - return support.server(item, item.video_url) \ No newline at end of file +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Canale per AnimeUnity +# ------------------------------------------------------------ + +import cloudscraper, json, copy, inspect +from core import jsontools, support, httptools, filetools +from platformcode import autorenumber, logger +import re +import xbmc + + +session = cloudscraper.create_scraper() + +host = support.config.get_channel_url() +response = session.get(host + '/archivio') +csrf_token = support.match(response.text, patron='name="csrf-token" content="([^"]+)"').match +headers = {'content-type': 'application/json;charset=UTF-8', + 'x-csrf-token': csrf_token, + 'Cookie' : '; '.join([x.name + '=' + x.value for x in response.cookies])} + + +@support.menu +def mainlist(item): + top = [('Ultimi Episodi', ['', 'news'])] + + menu = [('Anime {bullet bold}',['', 'menu', {}, 'tvshow']), + ('Film {submenu}',['', 'menu', {'type': 'Movie'}]), + ('TV {submenu}',['', 'menu', {'type': 'TV'}, 'tvshow']), + ('OVA {submenu} {tv}',['', 'menu', {'type': 'OVA'}, 'tvshow']), + ('ONA {submenu} {tv}',['', 'menu', {'type': 'ONA'}, 'tvshow']), + ('Special {submenu} {tv}',['', 'menu', {'type': 'Special'}, 'tvshow'])] + search ='' + return locals() + +def menu(item): + item.action = 'peliculas' + ITA = copy.copy(item.args) + ITA['title'] = '(ita)' + InCorso = copy.copy(item.args) + InCorso['status'] = 'In Corso' + Terminato = copy.copy(item.args) + Terminato['status'] = 'Terminato' + itemlist = [item.clone(title=support.typo('Tutti','bold')), + item.clone(title=support.typo('ITA','bold'), args=ITA), + item.clone(title=support.typo('Genere','bold'), action='genres'), + item.clone(title=support.typo('Anno','bold'), action='years')] + if item.contentType == 'tvshow': + itemlist += [item.clone(title=support.typo('In Corso','bold'), args=InCorso), + item.clone(title=support.typo('Terminato','bold'), args=Terminato)] + itemlist +=[item.clone(title=support.typo('Cerca...','bold'), action='search', thumbnail=support.thumb('search'))] + return itemlist + + +def genres(item): + support.info() + # support.dbg() + itemlist = [] + + genres = json.loads(support.match(response.text, patron='genres="([^"]+)').match.replace('"','"')) + + for genre in genres: + item.args['genres'] = [genre] + itemlist.append(item.clone(title=support.typo(genre['name'],'bold'), action='peliculas')) + return support.thumb(itemlist) + +def years(item): + support.info() + itemlist = [] + + from datetime import datetime + current_year = datetime.today().year + oldest_year = int(support.match(response.text, patron='anime_oldest_date="([^"]+)').match) + + for year in list(reversed(range(oldest_year, current_year + 1))): + item.args['year']=year + itemlist.append(item.clone(title=support.typo(year,'bold'), action='peliculas')) + return itemlist + + +def search(item, text): + support.info('search', item) + if not item.args: + item.args = {'title':text} + else: + item.args['title'] = text + item.search = text + + try: + return peliculas(item) + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.info('search log:', line) + return [] + + +def newest(categoria): + support.info(categoria) + itemlist = [] + item = support.Item() + item.url = host + + try: + itemlist = news(item) + + if itemlist[-1].action == 'news': + itemlist.pop() + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.info(line) + return [] + + return itemlist + +def news(item): + support.info() + item.contentType = 'episode' + itemlist = [] + import cloudscraper + session = cloudscraper.create_scraper() + + fullJs = json.loads(support.match(session.get(item.url).text, headers=headers, patron=r'items-json="([^"]+)"').match.replace('"','"')) + js = fullJs['data'] + + for it in js: + itemlist.append( + item.clone(title= support.typo(it['anime']['title'] + ' - EP. ' + it['number'], 'bold'), + fulltitle=it['anime']['title'], + thumbnail=it['anime']['imageurl'], + forcethumb = True, + video_url=it['scws_id'], + plot=it['anime']['plot'], + action='findvideos') + ) + if 'next_page_url' in fullJs: + itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'),thumbnail=support.thumb(), url=fullJs['next_page_url'])) + return itemlist + + +def peliculas(item): + support.info() + itemlist = [] + + page = item.page if item.page else 0 + item.args['offset'] = page * 30 + + order = support.config.get_setting('order', item.channel) + if order: + order_list = [ "Standard", "Lista A-Z", "Lista Z-A", "Popolarità", "Valutazione" ] + item.args['order'] = order_list[order] + + payload = json.dumps(item.args) + records = session.post(host + '/archivio/get-animes', headers=headers, data=payload).json()['records'] + + for it in records: + logger.debug(jsontools.dump(it)) + lang = support.match(it['title'], patron=r'\(([It][Tt][Aa])\)').match + title = support.re.sub(r'\s*\([^\)]+\)', '', it['title']) + + if 'ita' in lang.lower(): language = 'ITA' + else: language = 'Sub-ITA' + + itm = item.clone(title=support.typo(title,'bold') + support.typo(language,'_ [] color kod') + (support.typo(it['title_eng'],'_ ()') if it['title_eng'] else '')) + itm.contentLanguage = language + itm.type = it['type'] + itm.thumbnail = it['imageurl'] + itm.plot = it['plot'] + itm.url = item.url + + if it['episodes_count'] == 1: + itm.contentType = 'movie' + itm.fulltitle = itm.show = itm.contentTitle = title + itm.contentSerieName = '' + itm.action = 'findvideos' + itm.video_url = it['episodes'][0]['scws_id'] + + else: + itm.contentType = 'tvshow' + itm.contentTitle = '' + itm.fulltitle = itm.show = itm.contentSerieName = title + itm.action = 'episodios' + itm.episodes = it['episodes'] if 'episodes' in it else it['scws_id'] + itm.video_url = item.url + + itemlist.append(itm) + + autorenumber.start(itemlist) + if len(itemlist) >= 30: + itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), page=page + 1)) + + return itemlist + +def episodios(item): + support.info() + itemlist = [] + title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio ' + for it in item.episodes: + itemlist.append( + item.clone(title=support.typo(title + it['number'], 'bold'), + episode = it['number'], + fulltitle=item.title, + show=item.title, + contentTitle='', + contentSerieName=item.contentSerieName, + thumbnail=item.thumbnail, + plot=item.plot, + action='findvideos', + contentType='episode', + video_url=it['scws_id'])) + + if inspect.stack()[1][3] not in ['find_episodes']: + autorenumber.start(itemlist, item) + support.videolibrary(itemlist, item) + support.download(itemlist, item) + return itemlist + + +def findvideos(item): + # def calculateToken(): + # from time import time + # from base64 import b64encode as b64 + # import hashlib + # o = 48 + # n = support.match('https://au-1.scws-content.net/get-ip').data + # i = 'Yc8U6r8KjAKAepEA' + # t = int(time() + (3600 * o)) + # l = '{}{} {}'.format(t, n, i) + # md5 = hashlib.md5(l.encode()) + # s = '?token={}&expires={}'.format(b64(md5.digest()).decode().replace('=', '').replace('+', "-").replace('\\', "_"), t) + # return s + # token = calculateToken() + + # url = 'https://streamingcommunityws.com/master/{}{}'.format(item.video_url, token) + + # # support.dbg() + + # m3u8_original = httptools.downloadpage(url, CF=False).data + + # m_video = re.search(r'\.\/video\/(\d+p)\/playlist.m3u8', m3u8_original) + # video_res = m_video.group(1) + # m_audio = re.search(r'\.\/audio\/(\d+k)\/playlist.m3u8', m3u8_original) + # audio_res = m_audio.group(1) + + # # https://streamingcommunityws.com/master/5957?type=video&rendition=480p&token=wQLowWskEnbLfOfXXWWPGA&expires=1623437317 + # video_url = 'https://streamingcommunityws.com/master/{}{}&type=video&rendition={}'.format(item.video_url, token, video_res) + # audio_url = 'https://streamingcommunityws.com/master/{}{}&type=audio&rendition={}'.format(item.video_url, token, audio_res) + + # m3u8_original = m3u8_original.replace( m_video.group(0), video_url ) + # m3u8_original = m3u8_original.replace( m_audio.group(0), audio_url ) + + # file_path = 'special://temp/animeunity.m3u8' + + # filetools.write(xbmc.translatePath(file_path), m3u8_original, 'w') + + # return support.server(item, itemlist=[item.clone(title=support.config.get_localized_string(30137), url=file_path, manifest = 'hls', server='directo', action='play')]) + # item.url=item.video_url + + directLink = False + if item.video_url == None: + if item.extra == "tvshow": + epnum = item.episode + logger.info('it is a episode', epnum) + episode = None + for ep in item.episodes: + if ep["number"] == epnum: + episode = ep + break + if episode == None: + logger.warn('cannot found episode') + else: + item.url = episode["link"] + directLink = True + + + + + if directLink: + logger.info('try direct link') + return support.server(item, itemlist=[item.clone(title=support.config.get_localized_string(30137), url=item.url, server='directo', action='play')]) + else: + return support.server(item, itemlist=[item.clone(title=support.config.get_localized_string(30137), url=str(item.video_url), manifest = 'hls', server='streamingcommunityws', action='play')]) + + + + diff --git a/core/servertools.py b/core/servertools.py index de4a73b8..dbd0ede8 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -23,7 +23,7 @@ import re from core import filetools from core import httptools -from core import jsontools +from core import jsontools, support from core.item import Item from platformcode import config, logger from platformcode import platformtools @@ -784,4 +784,4 @@ def translate_server_name(name): if '@' in name: return config.get_localized_string(int(name.replace('@',''))) else: - return name \ No newline at end of file + return name diff --git a/lib/streamingcommunity/__init__.py b/lib/streamingcommunity/__init__.py new file mode 100644 index 00000000..dd2f4b92 --- /dev/null +++ b/lib/streamingcommunity/__init__.py @@ -0,0 +1,3 @@ +from lib.streamingcommunity.client import Client +from lib.streamingcommunity.server import Server +__all__ = ['Client', 'Server'] diff --git a/lib/streamingcommunity/client.py b/lib/streamingcommunity/client.py new file mode 100644 index 00000000..c35418d0 --- /dev/null +++ b/lib/streamingcommunity/client.py @@ -0,0 +1,285 @@ +import base64, json, random, struct, time, sys, traceback +if sys.version_info[0] >= 3: + PY3 = True + import urllib.request as urllib + xrange = range +else: + PY3 = False + import urllib + +from core import httptools, jsontools, support +from threading import Thread + +import re + +from lib.streamingcommunity.handler import Handler +from platformcode import logger +from lib.streamingcommunity.server import Server + + +class Client(object): + + def __init__(self, url, port=None, ip=None, auto_shutdown=True, wait_time=20, timeout=5, is_playing_fnc=None, video_id=None): + + self.port = port if port else random.randint(8000,8099) + self.ip = ip if ip else "127.0.0.1" + self.connected = False + self.start_time = None + self.last_connect = None + self.is_playing_fnc = is_playing_fnc + self.auto_shutdown = auto_shutdown + self.wait_time = wait_time + self.timeout = timeout + self.running = False + self.file = None + self.files = [] + + + # video_id is the ID in the webpage path + self._video_id = video_id + + # Get json_data for entire details from video page + jsonDataStr = httptools.downloadpage('https://streamingcommunityws.com/videos/1/{}'.format(self._video_id), CF=False ).data + logger.debug( jsonDataStr ) + self._jsonData = jsontools.load( jsonDataStr ) + + # going to calculate token and expiration time + # These values will be used for manifests request + self._token, self._expires = self.calculateToken( self._jsonData['client_ip'] ) + + # Starting web server + self._server = Server((self.ip, self.port), Handler, client=self) + self.start() + + + + def start(self): + """ + " Starting client and server in a separated thread + """ + self.start_time = time.time() + self.running = True + self._server.run() + t= Thread(target=self._auto_shutdown) + t.setDaemon(True) + t.start() + logger.info("SC Server Started", (self.ip, self.port)) + + def _auto_shutdown(self): + while self.running: + time.sleep(1) + if self.file and self.file.cursor: + self.last_connect = time.time() + + if self.is_playing_fnc and self.is_playing_fnc(): + self.last_connect = time.time() + + if self.auto_shutdown: + #shudown por haber cerrado el reproductor + if self.connected and self.last_connect and self.is_playing_fnc and not self.is_playing_fnc(): + if time.time() - self.last_connect - 1 > self.timeout: + self.stop() + + #shutdown por no realizar ninguna conexion + if (not self.file or not self.file.cursor) and self.start_time and self.wait_time and not self.connected: + if time.time() - self.start_time - 1 > self.wait_time: + self.stop() + + #shutdown tras la ultima conexion + if (not self.file or not self.file.cursor) and self.timeout and self.connected and self.last_connect and not self.is_playing_fnc: + if time.time() - self.last_connect - 1 > self.timeout: + self.stop() + + def stop(self): + self.running = False + self._server.stop() + logger.info("SC Server Stopped") + + + def get_manifest_url(self): + # remap request path for main manifest + # it must point to local server ip:port + return "http://" + self.ip + ":" + str(self.port) + "/manifest.m3u8" + + + def get_main_manifest_content(self): + # get the manifest file for entire video/audio chunks + # it must remap each urls in order to catch all chunks + + url = 'https://streamingcommunityws.com/master/{}?token={}&expires={}'.format(self._video_id, self._token, self._expires) + + m3u8_original = httptools.downloadpage(url, CF=False).data + + logger.debug('CLIENT: m3u8:', m3u8_original); + + # remap video/audio manifests url + # they must point to local server: + # /video/RES.m3u8 + # /audio/RES.m3u8 + + r_video = re.compile(r'(\.\/video\/(\d+p)\/playlist.m3u8)', re.MULTILINE) + r_audio = re.compile(r'(\.\/audio\/(\d+k)\/playlist.m3u8)', re.MULTILINE) + + + for match in r_video.finditer(m3u8_original): + line = match.groups()[0] + res = match.groups()[1] + video_url = "/video/" + res + ".m3u8" + + # logger.info('replace', match.groups(), line, res, video_url) + + m3u8_original = m3u8_original.replace( line, video_url ) + + + for match in r_audio.finditer(m3u8_original): + line = match.groups()[0] + res = match.groups()[1] + audio_url = "/audio/" + res + ".m3u8" + + # logger.info('replace', match.groups(), line, res, audio_url) + + m3u8_original = m3u8_original.replace( line, audio_url ) + + + # m_video = re.search(, m3u8_original) + # self._video_res = m_video.group(1) + # m_audio = re.search(r'\.\/audio\/(\d+k)\/playlist.m3u8', m3u8_original) + # self._audio_res = m_audio.group(1) + + # video_url = "/video/" + self._video_res + ".m3u8" + # audio_url = "/audio/" + self._audio_res + ".m3u8" + + # m3u8_original = m3u8_original.replace( m_video.group(0), video_url ) + # m3u8_original = m3u8_original.replace( m_audio.group(0), audio_url ) + + return m3u8_original + + + def get_video_manifest_content(self, url): + """ + " Based on `default_start`, `default_count` and `default_domain` + " this method remap each video chunks url in order to make them point to + " the remote domain switching from `default_start` to `default_count` values + """ + + m_video = re.search( r'\/video\/(\d+p)\.m3u8', url) + video_res = m_video.groups()[0] + + logger.info('Video res: ', video_res) + + # get the original manifest file for video chunks + url = 'https://streamingcommunityws.com/master/{}?token={}&expires={}&type=video&rendition={}'.format(self._video_id, self._token, self._expires, video_res) + original_manifest = httptools.downloadpage(url, CF=False).data + + manifest_to_parse = original_manifest + + # remap each chunks + r = re.compile(r'^(\w+\.ts)$', re.MULTILINE) + + default_start = self._jsonData[ "proxies" ]["default_start"] + default_count = self._jsonData[ "proxies" ]["default_count"] + default_domain = self._jsonData[ "proxies" ]["default_domain"] + storage_id = self._jsonData[ "storage_id" ] + folder_id = self._jsonData[ "folder_id" ] + + for match in r.finditer(manifest_to_parse): + # getting all single chunks and replace in the original manifest file content + ts = match.groups()[0] + + # compute final url pointing to given domain + url = 'https://au-{default_start}.{default_domain}/hls/{storage_id}/{folder_id}/video/{video_res}/{ts}'.format( + default_start = default_start, + default_domain = default_domain, + storage_id = storage_id, + folder_id = folder_id, + video_res = video_res, + ts = ts + ) + + original_manifest = original_manifest.replace( ts, url ) + + default_start = default_start + 1 + if default_start > default_count: + default_start = 1 + + # replace the encryption file url pointing to remote streamingcommunity server + original_manifest = re.sub(r'"(\/.*[enc]?\.key)"', '"https://streamingcommunityws.com\\1"', original_manifest) + + return original_manifest + + + + def get_audio_manifest_content(self, url): + """ + " Based on `default_start`, `default_count` and `default_domain` + " this method remap each video chunks url in order to make them point to + " the remote domain switching from `default_start` to `default_count` values + """ + m_audio = re.search( r'\/audio\/(\d+k)\.m3u8', url) + audio_res = m_audio.groups()[0] + + logger.info('Audio res: ', audio_res) + + # get the original manifest file for video chunks + url = 'https://streamingcommunityws.com/master/{}?token={}&expires={}&type=audio&rendition={}'.format(self._video_id, self._token, self._expires, audio_res) + original_manifest = httptools.downloadpage(url, CF=False).data + + manifest_to_parse = original_manifest + + # remap each chunks + r = re.compile(r'^(\w+\.ts)$', re.MULTILINE) + + default_start = self._jsonData[ "proxies" ]["default_start"] + default_count = self._jsonData[ "proxies" ]["default_count"] + default_domain = self._jsonData[ "proxies" ]["default_domain"] + storage_id = self._jsonData[ "storage_id" ] + folder_id = self._jsonData[ "folder_id" ] + + for match in r.finditer(manifest_to_parse): + # getting all single chunks and replace in the original manifest file content + ts = match.groups()[0] + + # compute final url pointing to given domain + url = 'https://au-{default_start}.{default_domain}/hls/{storage_id}/{folder_id}/audio/{audio_res}/{ts}'.format( + default_start = default_start, + default_domain = default_domain, + storage_id = storage_id, + folder_id = folder_id, + audio_res = audio_res, + ts = ts + ) + + original_manifest = original_manifest.replace( ts, url ) + + default_start = default_start + 1 + if default_start > default_count: + default_start = 1 + + + # replace the encryption file url pointing to remote streamingcommunity server + original_manifest = re.sub(r'"(\/.*[enc]?\.key)"', '"https://streamingcommunityws.com\\1"', original_manifest) + + return original_manifest + + + def calculateToken(self, ip): + """ + " Compute the `token` and the `expires` values in order to perform each next requests + """ + + from time import time + from base64 import b64encode as b64 + import hashlib + o = 48 + + # NOT USED: it has been computed by `jsondata` in the constructor method + # n = support.match('https://au-1.scws-content.net/get-ip').data + + i = 'Yc8U6r8KjAKAepEA' + t = int(time() + (3600 * o)) + l = '{}{} {}'.format(t, ip, i) + md5 = hashlib.md5(l.encode()) + #s = '?token={}&expires={}'.format(, t) + token = b64( md5.digest() ).decode().replace( '=', '' ).replace( '+', "-" ).replace( '\\', "_" ) + expires = t + return token, expires diff --git a/lib/streamingcommunity/handler.py b/lib/streamingcommunity/handler.py new file mode 100644 index 00000000..1dc8e738 --- /dev/null +++ b/lib/streamingcommunity/handler.py @@ -0,0 +1,73 @@ +import time, os, re, sys + +if sys.version_info[0] >= 3: + PY3 = True + from http.server import BaseHTTPRequestHandler + import urllib.request as urllib + import urllib.parse as urlparse +else: + PY3 = False + from BaseHTTPServer import BaseHTTPRequestHandler + import urlparse + import urllib + +from platformcode import logger + + +class Handler(BaseHTTPRequestHandler): + protocol_version = 'HTTP/1.1' + + def log_message(self, format, *args): + pass + + + def do_GET(self): + """ + " Got request + " We are going to handle the request path in order to proxy each manifest + """ + url = urlparse.urlparse(self.path).path + + logger.debug('HANDLER:', url) + + response = None + + # Default content-type for each manifest + cType = "application/vnd.apple.mpegurl" + + if url == "/manifest.m3u8": + response = self.server._client.get_main_manifest_content() + + elif url.startswith('/video/'): + response = self.server._client.get_video_manifest_content(url) + + elif url.startswith('/audio/'): + response = self.server._client.get_audio_manifest_content(url) + + elif url.endswith('enc.key'): + # This path should NOT be used, see get_video_manifest_content function + response = self.server._client.get_enc_key( url ) + cType = "application/octet-stream" + + + if response == None: + # Default 404 response + self.send_error(404, 'Not Found') + logger.warn('Responding 404 for url', url) + + else: + # catch OK response and send it to client + self.send_response(200) + self.send_header("Content-Type", cType ) + self.send_header("Content-Length", str( len(response.encode('utf-8')) ) ) + self.end_headers() + + self.wfile.write( response.encode() ) + + # force flush just to be sure + self.wfile.flush() + + logger.info('HANDLER flushed:', cType , str( len(response.encode('utf-8')) ) ) + logger.debug( response.encode('utf-8') ) + + diff --git a/lib/streamingcommunity/server.py b/lib/streamingcommunity/server.py new file mode 100644 index 00000000..8dc2bd0d --- /dev/null +++ b/lib/streamingcommunity/server.py @@ -0,0 +1,39 @@ +import sys, traceback +if sys.version_info[0] >= 3: + from http.server import HTTPServer + from socketserver import ThreadingMixIn +else: + from BaseHTTPServer import HTTPServer + from SocketServer import ThreadingMixIn + +from threading import Thread +from platformcode import logger + + +class Server(ThreadingMixIn, HTTPServer): + daemon_threads = True + timeout = 1 + def __init__(self, address, handler, client): + HTTPServer.__init__(self,address,handler) + self._client = client + self.running=True + self.request = None + + def stop(self): + self.running=False + + # def serve(self): + # while self.running: + # try: + # self.handle_request() + # except: + # logger.error(traceback.format_exc()) + + def run(self): + t=Thread(target=self.serve_forever, name='HTTP Server') + t.daemon=self.daemon_threads + t.start() + + def handle_error(self, request, client_address): + if not "socket.py" in traceback.format_exc(): + logger.error(traceback.format_exc()) diff --git a/servers/streamingcommunityws.json b/servers/streamingcommunityws.json new file mode 100644 index 00000000..d97c8d10 --- /dev/null +++ b/servers/streamingcommunityws.json @@ -0,0 +1,15 @@ +{ + "active": true, + "find_videos": { + "ignore_urls": [], + "patterns": [ + ] + }, + "free": true, + "id": "streamingcommunityws", + "name": "StreamingCommunityWS", + "premium": [ + ], + "settings": [ + ] +} diff --git a/servers/streamingcommunityws.py b/servers/streamingcommunityws.py new file mode 100755 index 00000000..3ac8a58e --- /dev/null +++ b/servers/streamingcommunityws.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +import sys +PY3 = False +if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int + +import json +import random +from core import httptools, support, scrapertools +from platformcode import platformtools, logger +from lib.streamingcommunity import Client as SCClient + +files = None + +def test_video_exists(page_url): + + # page_url is the {VIDEO_ID}. Es: 5957 + return True, "" + +def get_video_url(page_url, premium=False, user="", password="", video_password=""): + + video_urls = [] + + global c + c = SCClient("",video_id=page_url, is_playing_fnc=platformtools.is_playing) + + media_url = c.get_manifest_url() + + video_urls.append([scrapertools.get_filename_from_url(media_url)[-4:] + " [Streaming Community]", media_url]) + + return video_urls diff --git a/specials/setting.py b/specials/setting.py index c66f9a2e..e1bebeb5 100644 --- a/specials/setting.py +++ b/specials/setting.py @@ -311,8 +311,9 @@ def servers_favorites(item): orden = config.get_setting("favorites_servers_list", server=server) - if orden > 0: - dict_values[orden] = len(server_names) - 1 + if not orden == None: + if orden > 0: + dict_values[orden] = len(server_names) - 1 for x in range(1, 12): control = {'id': x, @@ -1214,4 +1215,4 @@ def call_browser(item): short = urllib.urlopen( 'https://u.nu/api.php?action=shorturl&format=simple&url=' + item.url).read() platformtools.dialog_ok(config.get_localized_string(20000), - config.get_localized_string(70740) % short) \ No newline at end of file + config.get_localized_string(70740) % short) From 81d9ecb41f8b84deceb2a12cd99b8dd3b73bd863 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Wed, 16 Jun 2021 18:21:44 +0200 Subject: [PATCH 014/139] StreamingCommunityWS --- channels/animeunity.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/channels/animeunity.py b/channels/animeunity.py index 27ec52a0..eb9b39a1 100644 --- a/channels/animeunity.py +++ b/channels/animeunity.py @@ -275,14 +275,11 @@ def findvideos(item): item.url = episode["link"] directLink = True - - - if directLink: logger.info('try direct link') return support.server(item, itemlist=[item.clone(title=support.config.get_localized_string(30137), url=item.url, server='directo', action='play')]) else: - return support.server(item, itemlist=[item.clone(title=support.config.get_localized_string(30137), url=str(item.video_url), manifest = 'hls', server='streamingcommunityws', action='play')]) + return support.server(item, itemlist=[item.clone(title="StreamingCommunityWS", url=str(item.video_url), manifest = 'hls', server='streamingcommunityws', action='play')]) From 4439278232a95cbf13e1aa0806c585fe764f7620 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Wed, 16 Jun 2021 19:15:00 +0200 Subject: [PATCH 015/139] Fix Mancata apertura Canali in Kodi 18 --- core/servertools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/servertools.py b/core/servertools.py index dbd0ede8..a6d14090 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -23,7 +23,7 @@ import re from core import filetools from core import httptools -from core import jsontools, support +from core import jsontools from core.item import Item from platformcode import config, logger from platformcode import platformtools From 4e0174a36a0c7017402c463a28e995e51c2ccc35 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 16 Jun 2021 17:58:38 +0000 Subject: [PATCH 016/139] {Aggiornamento domini} --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index 6efc8dd4..b5640e15 100644 --- a/channels.json +++ b/channels.json @@ -12,7 +12,7 @@ "casacinema": "https://www.casacinema.page", "cb01anime": "https://www.cineblog01.red", "cineblog01": "https://cb01.uno", - "cinemalibero": "https://cinemalibero.blog", + "cinemalibero": "https://cinemalibero.biz", "cinetecadibologna": "http://cinestore.cinetecadibologna.it", "discoveryplus": "https://www.discoveryplus.com", "dreamsub": "https://dreamsub.stream", From 9f41be6da0c1bb75d68608ed4342035b83be74e6 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Thu, 17 Jun 2021 12:17:17 +0200 Subject: [PATCH 017/139] - Fix Ordinamento Server - Fix Menu Rapido --- core/support.py | 4 +++- platformcode/keymaptools.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/support.py b/core/support.py index 4700b413..e1807df3 100755 --- a/core/support.py +++ b/core/support.py @@ -1206,7 +1206,9 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru videoitem.title = findS[0] videoitem.url = findS[1] srv_param = servertools.get_server_parameters(videoitem.server.lower()) - logger.debug(videoitem) + else: + videoitem.server = videoitem.server.lower() + if videoitem.video_urls or srv_param.get('active', False): item.title = typo(item.contentTitle.strip(), 'bold') if item.contentType == 'movie' or (config.get_localized_string(30161) in item.title) else item.title diff --git a/platformcode/keymaptools.py b/platformcode/keymaptools.py index 34b8e014..88f2cd15 100644 --- a/platformcode/keymaptools.py +++ b/platformcode/keymaptools.py @@ -175,6 +175,7 @@ class Main(xbmcgui.WindowXMLDialog): def submenu(self): + itmlist = [] channel_name = self.MENU.getSelectedItem().getProperty('channel') focus = int(self.MENU.getSelectedItem().getProperty('focus')) if channel_name == 'channelselector': From 45680c8ce4bcbea597150763d496e73c837a0fcb Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Thu, 17 Jun 2021 16:15:51 +0200 Subject: [PATCH 018/139] Fix Autoplay --- core/autoplay.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/autoplay.py b/core/autoplay.py index d7d9fdd1..7ce25ebb 100644 --- a/core/autoplay.py +++ b/core/autoplay.py @@ -45,11 +45,10 @@ def start(itemlist, item): autoplay_b = [] favorite_quality = [] favorite_servers = [] - blacklisted_servers = config.get_setting("black_list", server='servers') - if not blacklisted_servers: blacklisted_servers = [] + blacklisted_servers = config.get_setting("black_list", server='servers', default = []) + favorite_servers = config.get_setting('favorites_servers_list', server='servers', default = []) from core import servertools - favorite_servers = config.get_setting('favorites_servers_list', server='servers') servers_list = list(servertools.get_servers_list().items()) for server, server_parameters in servers_list: From 45f26036a154c7faebb27f5ec4e6b97d8e6482a0 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Thu, 17 Jun 2021 17:46:46 +0200 Subject: [PATCH 019/139] Server Preferiti fix in caso di valori errati --- specials/setting.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/specials/setting.py b/specials/setting.py index e1bebeb5..774236a3 100644 --- a/specials/setting.py +++ b/specials/setting.py @@ -309,11 +309,10 @@ def servers_favorites(item): server_names.append(server_list[server]['name']) - orden = config.get_setting("favorites_servers_list", server=server) - - if not orden == None: - if orden > 0: - dict_values[orden] = len(server_names) - 1 + orden = config.get_setting("favorites_servers_list", server=server, default=999) + if type(orden) != int: orden = 999 + if orden > 0: + dict_values[orden] = len(server_names) - 1 for x in range(1, 12): control = {'id': x, From 41b2731f5b3588fdac7090e3213aeebd328d7951 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Thu, 17 Jun 2021 19:51:20 +0200 Subject: [PATCH 020/139] fix sort_servers --- core/servertools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/servertools.py b/core/servertools.py index a6d14090..9ee6d423 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -701,9 +701,9 @@ def sort_servers(servers_list): """ if servers_list: if isinstance(servers_list[0], Item): - servers_list = sorted(servers_list, key=lambda x: config.get_setting("favorites_servers_list", server=x.server)) + servers_list = sorted(servers_list, key=lambda x: config.get_setting("favorites_servers_list", server=x.server, default=999)) else: - servers_list = sorted(servers_list, key=lambda x: config.get_setting("favorites_servers_list", server=x)) + servers_list = sorted(servers_list, key=lambda x: config.get_setting("favorites_servers_list", server=x, default=999)) return servers_list From 2ccb90d480c2ac5ff631388286c043586df564ae Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 17 Jun 2021 17:58:29 +0000 Subject: [PATCH 021/139] {Aggiornamento domini} --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index b5640e15..dee780ea 100644 --- a/channels.json +++ b/channels.json @@ -38,7 +38,7 @@ "serietvu": "https://www.serietvu.link", "streamingcommunity": "https://streamingcommunity.tv", "streamtime": "https://t.me/s/StreamTime", - "tantifilm": "https://www.tantifilm.vision", + "tantifilm": "https://www.tantifilm.in", "tapmovie": "https://it.tapmovie.net", "toonitalia": "https://toonitalia.co", "vvvvid": "https://www.vvvvid.it" From be75cd2e1a373a194080135be9ce569adb90a0b5 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Fri, 18 Jun 2021 10:32:54 +0200 Subject: [PATCH 022/139] Ordinamento Server --- core/autoplay.py | 202 ++++++----------------------------------- core/servertools.py | 167 +++++++++++++++++++++++++--------- resources/settings.xml | 4 +- specials/setting.py | 54 ++++------- 4 files changed, 170 insertions(+), 257 deletions(-) diff --git a/core/autoplay.py b/core/autoplay.py index 7ce25ebb..d5eace64 100644 --- a/core/autoplay.py +++ b/core/autoplay.py @@ -39,166 +39,20 @@ def start(itemlist, item): if not config.is_xbmc(): return itemlist + # Save the current value of "Action and Player Mode" in preferences + user_config_setting_action = config.get_setting("default_action") + # user_config_setting_player = config.get_setting("player_mode") + + # Enable the "View in high quality" action (if the server returns more than one quality, eg gdrive) + if not user_config_setting_action: config.set_setting("default_action", 2) + if config.get_setting('autoplay'): - url_list_valid = [] - autoplay_list = [] - autoplay_b = [] - favorite_quality = [] - favorite_servers = [] - blacklisted_servers = config.get_setting("black_list", server='servers', default = []) - favorite_servers = config.get_setting('favorites_servers_list', server='servers', default = []) + from core.servertools import sort_servers + autoplay_list = sort_servers(itemlist) - from core import servertools - - servers_list = list(servertools.get_servers_list().items()) - for server, server_parameters in servers_list: - if config.get_setting('favorites_servers_list', server=server) and server.lower() not in favorite_servers: - favorite_servers.append(server.lower()) - - if not favorite_servers: - config.set_setting('favorites_servers_list', [], server='servers') - favorite_servers = [] - else: - s_list = [] - for s in favorite_servers: - if s not in blacklisted_servers: - s_list.append(s) - favorite_servers = s_list - - # Save the current value of "Action and Player Mode" in preferences - user_config_setting_action = config.get_setting("default_action") - # user_config_setting_player = config.get_setting("player_mode") - - # Enable the "View in high quality" action (if the server returns more than one quality, eg gdrive) - if not user_config_setting_action: config.set_setting("default_action", 2) - - # if user_config_setting_player != 0: config.set_setting("player_mode", 0) - - # Priorities when ordering itemlist: - # 0: Servers and qualities - # 1: Qualities and servers - # 2: Servers only - # 3: Only qualities - # 4: Do not order - - if config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action'): - priority = 0 # 0: Servers and qualities or 1: Qualities and servers - elif config.get_setting('favorites_servers') and favorite_servers: - priority = 2 # Servers only - elif config.get_setting('default_action'): - priority = 3 # Only qualities - else: - priority = 4 # Do not order - - if config.get_setting('default_action') == 1: - quality_list.reverse() - favorite_quality = quality_list - for item in itemlist: - autoplay_elem = dict() - b_dict = dict() - - # We check that it is a video item - if 'server' not in item: - continue - - if item.server.lower() in blacklisted_servers: - continue - - # If it does not have a defined quality, it assigns a 'default' quality. - if item.quality.lower() not in quality_list: - item.quality = 'default' - # The list for custom settings is created - - if priority < 2: # 0: Servers and qualities or 1: Qualities and servers - - # if the server and the quality are not in the favorites lists or the url is repeated, we discard the item - if item.server.lower() not in favorite_servers or item.quality.lower() not in favorite_quality or item.url in url_list_valid: - item.type_b = True - item.window = base_item.window - b_dict['videoitem']= item - autoplay_b.append(b_dict) - continue - autoplay_elem["indice_server"] = favorite_servers.index(item.server.lower()) - autoplay_elem["indice_quality"] = favorite_quality.index(item.quality.lower()) - - elif priority == 2: # Servers only - - # if the server is not in the favorites list or the url is repeated, we discard the item - if item.server.lower() not in favorite_servers or item.url in url_list_valid: - item.type_b = True - item.window = base_item.window - b_dict['videoitem'] = item - autoplay_b.append(b_dict) - continue - autoplay_elem["indice_server"] = favorite_servers.index(item.server.lower()) - - elif priority == 3: # Only qualities - - # if the quality is not in the favorites list or the url is repeated, we discard the item - if item.quality.lower() not in favorite_quality or item.url in url_list_valid: - item.type_b = True - item.window = base_item.window - b_dict['videoitem'] = item - autoplay_b.append(b_dict) - continue - autoplay_elem["indice_quality"] = favorite_quality.index(item.quality.lower()) - - else: # Do not order - - # if the url is repeated, we discard the item - item.window = base_item.window - if item.url in url_list_valid: - continue - - # If the item reaches here we add it to the list of valid urls and to autoplay_list - url_list_valid.append(item.url) - item.plan_b=True - item.window = base_item.window - autoplay_elem['videoitem'] = item - autoplay_list.append(autoplay_elem) - - # We order according to priority - if priority == 0: autoplay_list.sort(key=lambda orden: ((orden['indice_server'], orden['indice_quality']))) # Servers and qualities - elif priority == 1: autoplay_list.sort(key=lambda orden: (orden['indice_quality'], orden['indice_server'])) # Qualities and servers - elif priority == 2: autoplay_list.sort(key=lambda orden: (orden['indice_server'])) # Servers only - elif priority == 3: autoplay_list.sort(key=lambda orden: (orden['indice_quality'])) # Only qualities - - logger.debug('PRIORITY',priority, autoplay_list) - - # if quality priority is active - if priority == 0 and config.get_setting('quality_priority'): - max_quality = autoplay_list[0]["indice_quality"] if autoplay_list and "indice_quality" in autoplay_list[0] else 0 - for n, item in enumerate(itemlist): - if 'server' not in item: - continue - - if item.server.lower() in blacklisted_servers: - continue - - # If it does not have a defined quality, it assigns a 'default' quality. - if item.quality == '': - item.quality = 'default' - - if favorite_quality.index(item.quality.lower()) < max_quality: - item.type_b = False - autoplay_elem["indice_server"] = n - autoplay_elem["indice_quality"] = favorite_quality.index(item.quality.lower()) - autoplay_elem['videoitem'] = item - autoplay_list.append(autoplay_elem) - autoplay_list.sort(key=lambda orden: (orden['indice_quality'], orden['indice_server'])) - - # Plan b is prepared, in case it is active the non-favorite elements are added at the end - # try: plan_b = settings_node['plan_b'] - # except: - plan_b = True - text_b = '' - if plan_b: autoplay_list.extend(autoplay_b) - # If there are elements in the autoplay list, an attempt is made to reproduce each element, until one is found or all fail. - - if autoplay_list or (plan_b and autoplay_b): - - max_intentos = 5 - max_intentos_servers = {} + if autoplay_list: + max_intents = 5 + max_intents_servers = {} # If something is playing it stops playing if platformtools.is_playing(): @@ -206,27 +60,23 @@ def start(itemlist, item): for autoplay_elem in autoplay_list: play_item = Item - channel_id = autoplay_elem['videoitem'].channel - if autoplay_elem['videoitem'].channel == 'videolibrary': - channel_id = autoplay_elem['videoitem'].contentChannel + channel_id = autoplay_elem.channel + if autoplay_elem.channel == 'videolibrary': + channel_id = autoplay_elem.contentChannel - # If it is not a favorite element if you add the text plan b - if autoplay_elem['videoitem'].type_b: - text_b = '(Plan B)' if not platformtools.is_playing() and not PLAYED: - videoitem = autoplay_elem['videoitem'] - if videoitem.server.lower() not in max_intentos_servers: - max_intentos_servers[videoitem.server.lower()] = max_intentos + videoitem = autoplay_elem + if videoitem.server.lower() not in max_intents_servers: + max_intents_servers[videoitem.server.lower()] = max_intents # If the maximum number of attempts of this server have been reached, we jump to the next - if max_intentos_servers[videoitem.server.lower()] == 0: + if max_intents_servers[videoitem.server.lower()] == 0: continue - lang = " " - if hasattr(videoitem, 'language') and videoitem.language != "": - lang = " '%s' " % videoitem.language + lang = " [{}]".format(videoitem.language) if videoitem.language else '' + quality = ' [{}]'.format(videoitem.quality) if videoitem.quality and videoitem.quality != 'default' else '' name = servername(videoitem.server) - platformtools.dialog_notification("AutoPlay %s" %text_b, "%s%s%s" % (name, lang, videoitem.quality.upper()), sound=False) + platformtools.dialog_notification('AutoPlay', '{}{}{}'.format(name, lang, quality), sound=False) # Try to play the links If the channel has its own play method, use it try: channel = __import__('channels.%s' % channel_id, None, None, ["channels.%s" % channel_id]) @@ -251,7 +101,7 @@ def start(itemlist, item): platformtools.play_video(videoitem, autoplay=True) except: pass - sleep(3) + # sleep(3) try: if platformtools.is_playing(): PLAYED = True @@ -260,13 +110,13 @@ def start(itemlist, item): logger.debug(str(len(autoplay_list))) # If we have come this far, it is because it could not be reproduced - max_intentos_servers[videoitem.server.lower()] -= 1 + max_intents_servers[videoitem.server.lower()] -= 1 # If the maximum number of attempts of this server has been reached, ask if we want to continue testing or ignore it. - if max_intentos_servers[videoitem.server.lower()] == 0: + if max_intents_servers[videoitem.server.lower()] == 0: text = config.get_localized_string(60072) % name if not platformtools.dialog_yesno("AutoPlay", text, config.get_localized_string(60073)): - max_intentos_servers[videoitem.server.lower()] = max_intentos + max_intents_servers[videoitem.server.lower()] = max_intents # If there are no items in the list, it is reported if autoplay_elem == autoplay_list[-1]: diff --git a/core/servertools.py b/core/servertools.py index 9ee6d423..a51ed28a 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -9,24 +9,17 @@ import sys PY3 = False if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int -if PY3: - #from future import standard_library - #standard_library.install_aliases() - import urllib.parse as urlparse #It is very slow in PY2. In PY3 it is native -else: - import urlparse # We use the native of PY2 which is faster +if PY3: import urllib.parse as urlparse +else: import urlparse from future.builtins import range from past.utils import old_div import re -from core import filetools -from core import httptools -from core import jsontools +from core import filetools, httptools, jsontools from core.item import Item -from platformcode import config, logger -from platformcode import platformtools +from platformcode import config, logger, platformtools from lib import unshortenit dict_servers_parameters = {} @@ -522,26 +515,6 @@ def get_server_parameters(server): return dict_servers_parameters[server] -# def get_server_json(server_name): -# # logger.info("server_name=" + server_name) -# try: -# server_path = filetools.join(config.get_runtime_path(), "servers", server_name + ".json") -# if not filetools.exists(server_path): -# server_path = filetools.join(config.get_runtime_path(), "servers", "debriders", server_name + ".json") -# -# # logger.info("server_path=" + server_path) -# server_json = jsontools.load(filetools.read(server_path)) -# # logger.info("server_json= %s" % server_json) -# -# except Exception as ex: -# template = "An exception of type %s occured. Arguments:\n%r" -# message = template % (type(ex).__name__, ex.args) -# logger.error(" %s" % message) -# server_json = None -# -# return server_json - - def get_server_host(server_name): from core import scrapertools return [scrapertools.get_domain_from_url(pattern['url']) for pattern in get_server_parameters(server_name)['find_videos']['patterns']] @@ -669,9 +642,10 @@ def get_servers_list(): for server in filetools.listdir(filetools.join(config.get_runtime_path(), "servers")): if server.endswith(".json") and not server == "version.json": server_parameters = get_server_parameters(server) - server_list[server.split(".")[0]] = server_parameters + if server_parameters['active']: + server_list[server.split(".")[0]] = server_parameters - # if type(server_list) != dict: server_list = sort_servers(server_list) + if type(server_list) != dict: server_list = sort_servers(server_list) return server_list @@ -699,13 +673,96 @@ def sort_servers(servers_list): :param servers_list: List of servers to order. The items in the servers_list can be strings or Item objects. In which case it is necessary that they have an item.server attribute of type str. :return: List of the same type of objects as servers_list ordered according to the favorite servers. """ - if servers_list: - if isinstance(servers_list[0], Item): - servers_list = sorted(servers_list, key=lambda x: config.get_setting("favorites_servers_list", server=x.server, default=999)) - else: - servers_list = sorted(servers_list, key=lambda x: config.get_setting("favorites_servers_list", server=x, default=999)) + if not servers_list: + return [] - return servers_list + blacklisted_servers = config.get_setting("black_list", server='servers', default=[]) + favorite_servers = config.get_setting('favorites_servers_list', server='servers', default=[]) + favorite_servers = [s for s in favorite_servers if s not in blacklisted_servers] + if isinstance(servers_list[0], str): + servers_list = sorted(servers_list, key=lambda x: favorite_servers.index(x) if x in favorite_servers else 999) + return servers_list + + quality_list = ['4k', '2160p', '2160', '4k2160p', '4k2160', '4k 2160p', '4k 2160', '2k', + 'fullhd', 'fullhd 1080', 'fullhd 1080p', 'full hd', 'full hd 1080', 'full hd 1080p', 'hd1080', 'hd1080p', 'hd 1080', 'hd 1080p', '1080', '1080p', + 'hd', 'hd720', 'hd720p', 'hd 720', 'hd 720p', '720', '720p', 'hdtv', + 'sd', '480p', '480', '360p', '360', '240p', '240', + ''] + + sorted_list = [] + url_list_valid = [] + favorite_quality = [] + + # Priorities when ordering itemlist: + # 0: Servers and qualities + # 1: Servers only + # 2: Only qualities + # 3: Do not order + + if config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action'): + priority = 0 # 0: Servers and qualities + elif config.get_setting('favorites_servers') and favorite_servers: + priority = 1 # Servers only + elif config.get_setting('default_action'): + priority = 2 # Only qualities + else: + priority = 3 # Do not order + + if config.get_setting('default_action') == 1: + quality_list.reverse() + favorite_quality = quality_list + for item in servers_list: + element = dict() + + # We check that it is a video item + if 'server' not in item: + continue + + if item.server.lower() in blacklisted_servers: + continue + + + if priority < 2: # 0: Servers and qualities or 1: Qualities and servers + element["indice_server"] = favorite_servers.index(item.server.lower()) if item.server.lower() in favorite_servers else 999 + element["indice_quality"] = favorite_quality.index(item.quality.lower()) + + elif priority == 2: # Servers only + element["indice_server"] = favorite_servers.index(item.server.lower()) + + elif priority == 3: # Only qualities + element["indice_quality"] = favorite_quality.index(item.quality.lower()) + + else: # Do not order + if item.url in url_list_valid: + continue + + element['videoitem'] = item + sorted_list.append(element) + + + # We order according to priority + if priority == 0: sorted_list.sort(key=lambda orden: ((orden['indice_server'], orden['indice_quality']))) # Servers and qualities + elif priority == 1: sorted_list.sort(key=lambda orden: (orden['indice_server'])) # Servers only + elif priority == 3: sorted_list.sort(key=lambda orden: (orden['indice_quality'])) # Only qualities + + + # if quality priority is active + if priority == 0 and config.get_setting('quality_priority'): + max_quality = sorted_list[0]["indice_quality"] if sorted_list and "indice_quality" in sorted_list[0] else 0 + for n, item in enumerate(servers_list): + + if not item.server or item.server.lower() in blacklisted_servers: + continue + + if favorite_quality.index(item.quality.lower()) < max_quality: + element["indice_server"] = n + element["indice_quality"] = favorite_quality.index(item.quality.lower()) + element['videoitem'] = item + sorted_list.append(element) + + sorted_list.sort(key=lambda orden: (orden['indice_quality'], orden['indice_server'])) + + return [v['videoitem'] for v in sorted_list if v] # Checking links @@ -733,10 +790,11 @@ def check_list_links(itemlist, numero='', timeout=3): it = res[0] verificacion = res[1] it.title = verificacion + ' ' + it.title.strip() - logger.info('VERIFICATION= ' + verificacion) + logger.debug('VERIFICATION= ' + verificacion) it.alive = verificacion return itemlist + def check_video_link(item, timeout=3): """ Check if the link to a video is valid and return a 2-position string with verification. @@ -777,11 +835,30 @@ def check_video_link(item, timeout=3): httptools.HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT = ant_timeout # Restore download time return item, resultado - logger.debug("[check_video_link] There is no test_video_exists for server: %s" % server) + logger.debug("[check_video_link] There is no test_video_exists for server:", server) return item, NK + def translate_server_name(name): - if '@' in name: - return config.get_localized_string(int(name.replace('@',''))) - else: - return name + if '@' in name: return config.get_localized_string(int(name.replace('@',''))) + else: return name + + +# def get_server_json(server_name): +# # logger.info("server_name=" + server_name) +# try: +# server_path = filetools.join(config.get_runtime_path(), "servers", server_name + ".json") +# if not filetools.exists(server_path): +# server_path = filetools.join(config.get_runtime_path(), "servers", "debriders", server_name + ".json") +# +# # logger.info("server_path=" + server_path) +# server_json = jsontools.load(filetools.read(server_path)) +# # logger.info("server_json= %s" % server_json) +# +# except Exception as ex: +# template = "An exception of type %s occured. Arguments:\n%r" +# message = template % (type(ex).__name__, ex.args) +# logger.error(" %s" % message) +# server_json = None +# +# return server_json diff --git a/resources/settings.xml b/resources/settings.xml index 1e28af6f..2821386f 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -21,8 +21,8 @@ - - + + diff --git a/specials/setting.py b/specials/setting.py index 774236a3..26a049f0 100644 --- a/specials/setting.py +++ b/specials/setting.py @@ -265,19 +265,19 @@ def servers_blacklist(item): def cb_servers_blacklist(dict_values): - blaklisted = [] - progreso = platformtools.dialog_progress(config.get_localized_string(60557), config.get_localized_string(60558)) - n = len(dict_values) - i = 1 - for k, v in list(dict_values.items()): - if v: # If the server is blacklisted it cannot be in the favorites list - config.set_setting("favorites_servers_list", 0, server=k) - blaklisted.append(k) - progreso.update(old_div((i * 100), n), config.get_localized_string(60559) % k) - i += 1 - config.set_setting("black_list", blaklisted, server='servers') + blaklisted = [k for k in dict_values.keys()] + # progreso = platformtools.dialog_progress(config.get_localized_string(60557), config.get_localized_string(60558)) + # n = len(dict_values) + # i = 1 + # for k, v in list(dict_values.items()): + # if v: # If the server is blacklisted it cannot be in the favorites list + # config.set_setting("favorites_servers_list", 0, server=k) + # blaklisted.append(k) + # progreso.update(old_div((i * 100), n), config.get_localized_string(60559) % k) + # i += 1 + # config.set_setting("black_list", blaklisted, server='servers') - progreso.close() + # progreso.close() def servers_favorites(item): @@ -302,16 +302,16 @@ def servers_favorites(item): dict_values['favorites_servers'] = False server_names = [config.get_localized_string(59992)] + favorites = config.get_setting("favorites_servers_list", server='servers', default=[]) + blacklisted = config.get_setting("black_list", server='servers', default=[]) for server in sorted(server_list.keys()): - if config.get_setting("black_list", server=server): + if server in blacklisted or config.get_setting("black_list", server=server): continue server_names.append(server_list[server]['name']) - - orden = config.get_setting("favorites_servers_list", server=server, default=999) - if type(orden) != int: orden = 999 - if orden > 0: + if server in favorites: + orden = favorites.index(server) + 1 dict_values[orden] = len(server_names) - 1 for x in range(1, 12): @@ -331,7 +331,6 @@ def servers_favorites(item): def cb_servers_favorites(server_names, dict_values): dict_name = {} dict_favorites = {} - progreso = platformtools.dialog_progress(config.get_localized_string(60557), config.get_localized_string(60558)) for i, v in list(dict_values.items()): if i == "favorites_servers": @@ -342,30 +341,17 @@ def cb_servers_favorites(server_names, dict_values): dict_name[server_names[v]] = int(i) servers_list = list(servertools.get_servers_list().items()) - n = len(servers_list) - i = 1 for server, server_parameters in servers_list: if server_parameters['name'] in list(dict_name.keys()): dict_favorites[dict_name[server_parameters['name']]] = server - config.set_setting("favorites_servers_list", dict_name[server_parameters['name']], server=server) - else: - config.set_setting("favorites_servers_list", 999, server=server) - progreso.update(old_div((i * 100), n), config.get_localized_string(60559) % server_parameters['name']) - i += 1 - c = 1 - logger.debug(dict_favorites) - favorites_servers_list = [] - while c in dict_favorites: - favorites_servers_list.append(dict_favorites[c]) - c += 1 + favorites_servers_list = [dict_favorites[k] for k in sorted(dict_favorites.keys())] + config.set_setting("favorites_servers_list", favorites_servers_list, server='servers') - if not dict_name: # If there is no server in the list, deactivate it + if not favorites_servers_list: # If there is no server in the list, deactivate it config.set_setting("favorites_servers", False) - progreso.close() - def settings(item): config.open_settings() From cfeba7b2a6a50631fdaedccd70af329d6b4525de Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Fri, 18 Jun 2021 12:21:31 +0200 Subject: [PATCH 023/139] Fix Ordinamento Server --- core/servertools.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/servertools.py b/core/servertools.py index a51ed28a..87c103d5 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -736,15 +736,16 @@ def sort_servers(servers_list): if item.url in url_list_valid: continue + element['indice_language'] = 0 if item.contentLanguage == 'ITA' else 1 + element['videoitem'] = item sorted_list.append(element) - # We order according to priority - if priority == 0: sorted_list.sort(key=lambda orden: ((orden['indice_server'], orden['indice_quality']))) # Servers and qualities - elif priority == 1: sorted_list.sort(key=lambda orden: (orden['indice_server'])) # Servers only - elif priority == 3: sorted_list.sort(key=lambda orden: (orden['indice_quality'])) # Only qualities - + if priority == 0: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_server'], orden['indice_quality'])) # Servers and qualities + elif priority == 1: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_server'])) # Servers only + elif priority == 2: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_quality'])) # Only qualities + else: sorted_list.sort(key=lambda orden: orden['indice_language']) # if quality priority is active if priority == 0 and config.get_setting('quality_priority'): @@ -760,7 +761,7 @@ def sort_servers(servers_list): element['videoitem'] = item sorted_list.append(element) - sorted_list.sort(key=lambda orden: (orden['indice_quality'], orden['indice_server'])) + sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_quality'], orden['indice_server'])) return [v['videoitem'] for v in sorted_list if v] From c9a455d4de900f8a84fa0b347827b96aab6b1a5b Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sat, 19 Jun 2021 11:15:30 +0200 Subject: [PATCH 024/139] Test: nuovo metodo rilancio service in caso di aggionamenti --- service.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service.py b/service.py index cfbd9056..163ffaf3 100644 --- a/service.py +++ b/service.py @@ -519,7 +519,10 @@ if __name__ == "__main__": if needsReload: db.close() logger.info('Relaunching service.py') - xbmc.executescript(__file__) + xbmc.executeJSONRPC( + '{"jsonrpc": "2.0", "id":1, "method": "Addons.SetAddonEnabled", "params": { "addonid": "plugin.video.kod", "enabled": false }}') + xbmc.executeJSONRPC( + '{"jsonrpc": "2.0", "id":1, "method": "Addons.SetAddonEnabled", "params": { "addonid": "plugin.video.kod", "enabled": true }}') break if monitor.waitForAbort(1): # every second From 7a6097400578758c1867ed47a780dcc6fcb30eeb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 19 Jun 2021 17:52:51 +0000 Subject: [PATCH 025/139] {Aggiornamento domini} --- channels.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channels.json b/channels.json index dee780ea..162684db 100644 --- a/channels.json +++ b/channels.json @@ -1,6 +1,6 @@ { "direct": { - "altadefinizione01": "https://www.altadefinizione01.games", + "altadefinizione01": "https://www.altadefinizione01.plus", "altadefinizione01_link": "https://altadefinizione01.travel", "animealtadefinizione": "https://www.animealtadefinizione.it", "animeforce": "https://www.animeforce.it", @@ -25,7 +25,7 @@ "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", "ilgeniodellostreaming": "https://ilgeniodellostreaming.ist", - "ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.shop", + "ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.city", "italiaserie": "https://italiaserie.buzz", "mediasetplay": "https://www.mediasetplay.mediaset.it", "mondoserietv": "https://mondoserietv.club", From 80149175d5149713d4f9ef566ea8ade4c016160e Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sun, 20 Jun 2021 10:28:40 +0200 Subject: [PATCH 026/139] test aggiornamento -> reload service --- service.py | 1 - 1 file changed, 1 deletion(-) diff --git a/service.py b/service.py index 163ffaf3..d5f5ccdc 100644 --- a/service.py +++ b/service.py @@ -49,7 +49,6 @@ def update(path, p_dialog, i, t, serie, overwrite): url = module.host + urlsplit(url).path serie.url = url - ###### Redirection to the NewPct1.py channel if it is a clone, or to another channel and url if there has been judicial intervention try: head_nfo, it = videolibrarytools.read_nfo(nfo_file) # Refresh the .nfo to collect updates if it.emergency_urls: From 65500b10d47662309963a23017bd4c9341c7a419 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sun, 20 Jun 2021 10:47:37 +0200 Subject: [PATCH 027/139] Non controllare aggiornamenti videoteca se service deve riavviarsi --- service.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/service.py b/service.py index d5f5ccdc..95b617c6 100644 --- a/service.py +++ b/service.py @@ -29,6 +29,8 @@ from servers import torrent # if this service need to be reloaded because an update changed it needsReload = False +# list of threads +threads = [] def update(path, p_dialog, i, t, serie, overwrite): @@ -314,6 +316,12 @@ def get_ua_list(): def run_threaded(job_func, args): job_thread = threading.Thread(target=job_func, args=args) job_thread.start() + threads.append(job_thread) + + +def join_threads(): + for th in threads: + th.join() class AddonMonitor(xbmc.Monitor): @@ -327,14 +335,15 @@ class AddonMonitor(xbmc.Monitor): self.scheduleUpdater() self.scheduleUA() - # videolibrary wait - update_wait = [0, 10000, 20000, 30000, 60000] - wait = update_wait[int(config.get_setting("update_wait", "videolibrary"))] - if wait > 0: - xbmc.sleep(wait) - if not config.get_setting("update", "videolibrary") == 2: - run_threaded(check_for_update, (False,)) - self.scheduleVideolibrary() + if not needsReload: # do not run videolibrary update if service needs to be reloaded + # videolibrary wait + update_wait = [0, 10000, 20000, 30000, 60000] + wait = update_wait[int(config.get_setting("update_wait", "videolibrary"))] + if wait > 0: + xbmc.sleep(wait) + if not config.get_setting("update", "videolibrary") == 2: + run_threaded(check_for_update, (False,)) + self.scheduleVideolibrary() super(AddonMonitor, self).__init__() def onSettingsChanged(self): @@ -516,15 +525,18 @@ if __name__ == "__main__": logger.error(traceback.format_exc()) if needsReload: + join_threads() db.close() logger.info('Relaunching service.py') xbmc.executeJSONRPC( '{"jsonrpc": "2.0", "id":1, "method": "Addons.SetAddonEnabled", "params": { "addonid": "plugin.video.kod", "enabled": false }}') xbmc.executeJSONRPC( '{"jsonrpc": "2.0", "id":1, "method": "Addons.SetAddonEnabled", "params": { "addonid": "plugin.video.kod", "enabled": true }}') + logger.debug(threading.enumerate()) break if monitor.waitForAbort(1): # every second + join_threads() # db need to be closed when not used, it will cause freezes db.close() break From eafb27d99c9de0fae5bae59d40576b28f5be416b Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sun, 20 Jun 2021 14:12:40 +0200 Subject: [PATCH 028/139] fix sort_servers (index not found) --- core/servertools.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/core/servertools.py b/core/servertools.py index 87c103d5..f4a9892e 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -673,6 +673,12 @@ def sort_servers(servers_list): :param servers_list: List of servers to order. The items in the servers_list can be strings or Item objects. In which case it is necessary that they have an item.server attribute of type str. :return: List of the same type of objects as servers_list ordered according to the favorite servers. """ + def index(lst, value): + if value in lst: + return lst.index(value) + else: + logger.debug('Index not found: ' + value) + return 999 if not servers_list: return [] @@ -686,8 +692,7 @@ def sort_servers(servers_list): quality_list = ['4k', '2160p', '2160', '4k2160p', '4k2160', '4k 2160p', '4k 2160', '2k', 'fullhd', 'fullhd 1080', 'fullhd 1080p', 'full hd', 'full hd 1080', 'full hd 1080p', 'hd1080', 'hd1080p', 'hd 1080', 'hd 1080p', '1080', '1080p', 'hd', 'hd720', 'hd720p', 'hd 720', 'hd 720p', '720', '720p', 'hdtv', - 'sd', '480p', '480', '360p', '360', '240p', '240', - ''] + 'sd', '480p', '480', '360p', '360', '240p', '240'] sorted_list = [] url_list_valid = [] @@ -723,14 +728,14 @@ def sort_servers(servers_list): if priority < 2: # 0: Servers and qualities or 1: Qualities and servers - element["indice_server"] = favorite_servers.index(item.server.lower()) if item.server.lower() in favorite_servers else 999 - element["indice_quality"] = favorite_quality.index(item.quality.lower()) + element["indice_server"] = index(favorite_servers, item.server.lower()) + element["indice_quality"] = index(favorite_quality, item.quality.lower()) elif priority == 2: # Servers only - element["indice_server"] = favorite_servers.index(item.server.lower()) + element["indice_server"] = index(favorite_servers, item.server.lower()) elif priority == 3: # Only qualities - element["indice_quality"] = favorite_quality.index(item.quality.lower()) + element["indice_quality"] = index(favorite_quality, item.quality.lower()) else: # Do not order if item.url in url_list_valid: @@ -755,9 +760,9 @@ def sort_servers(servers_list): if not item.server or item.server.lower() in blacklisted_servers: continue - if favorite_quality.index(item.quality.lower()) < max_quality: + if index(favorite_quality, item.quality.lower()) < max_quality: element["indice_server"] = n - element["indice_quality"] = favorite_quality.index(item.quality.lower()) + element["indice_quality"] = index(favorite_quality, item.quality.lower()) element['videoitem'] = item sorted_list.append(element) From 6524a3af02f121ccab19c0fa584df1be6b327ed8 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sun, 20 Jun 2021 18:20:40 +0200 Subject: [PATCH 029/139] Aggiunto server MaxStream --- channels/cineblog01.py | 2 +- lib/unshortenit.py | 2 +- servers/maxstream.json | 29 +++++++++++++++++++++++++++++ servers/maxstream.py | 22 ++++++++++++++++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 servers/maxstream.json create mode 100644 servers/maxstream.py diff --git a/channels/cineblog01.py b/channels/cineblog01.py index 639a26dd..1248660b 100644 --- a/channels/cineblog01.py +++ b/channels/cineblog01.py @@ -94,7 +94,7 @@ def peliculas(item): # esclusione degli articoli 'di servizio' curYear = datetime.date.today().year blacklist = ['BENVENUTI', 'Richieste Serie TV', 'CB01.UNO ▶ TROVA L’INDIRIZZO UFFICIALE ', - 'Aggiornamento Quotidiano Serie TV', + 'Aggiornamento Quotidiano Serie TV', 'AVVISO!!!', 'Openload: la situazione. Benvenuto Verystream', 'Openload: lo volete ancora?', 'OSCAR ' + str(curYear) + ' ▶ VOTA IL TUO FILM PREFERITO! 🎬', 'Auguri di Buon Natale e Felice Anno Nuovo! – ' + str(curYear) + '!'] diff --git a/lib/unshortenit.py b/lib/unshortenit.py index a21783df..ba8f3479 100644 --- a/lib/unshortenit.py +++ b/lib/unshortenit.py @@ -45,7 +45,7 @@ class UnshortenIt(object): # for services that only include real link inside iframe _simple_iframe_regex = r'cryptmango|xshield\.net|vcrypt\.club' # for services that only do redirects - _simple_redirect = r'streamcrypt\.net/[^/]+' + _simple_redirect = r'streamcrypt\.net/[^/]+|uprot\.net' listRegex = [_adfly_regex, _linkbucks_regex, _adfocus_regex, _lnxlu_regex, _shst_regex, _hrefli_regex, _anonymz_regex, _shrink_service_regex, _rapidcrypt_regex, _simple_iframe_regex, _linkup_regex, _linkhub_regex, diff --git a/servers/maxstream.json b/servers/maxstream.json new file mode 100644 index 00000000..8cb8257d --- /dev/null +++ b/servers/maxstream.json @@ -0,0 +1,29 @@ +{ + "active": true, + "find_videos": { + "ignore_urls": [], + "patterns": [ + { + "pattern": "https?://maxstream.video/(?:e/)?([a-z0-9]+)", + "url": "https://maxstream.video/\\1" + }, + { + "pattern": "https?://maxstream.video/embed-([a-z0-9]+).html", + "url": "https://maxstream.video/\\1" + } + ] + }, + "free": true, + "id": "maxstream", + "name": "MaxStream", + "settings": [ + { + "default": false, + "enabled": true, + "id": "black_list", + "label": "@70708", + "type": "bool", + "visible": true + } + ] +} diff --git a/servers/maxstream.py b/servers/maxstream.py new file mode 100644 index 00000000..d77e3e6c --- /dev/null +++ b/servers/maxstream.py @@ -0,0 +1,22 @@ +from core import httptools +from core import scrapertools, support +from lib import jsunpack +from platformcode import logger, config + + +def test_video_exists(page_url): + logger.debug("(page_url='%s')" % page_url) + global data + data = httptools.downloadpage(page_url).data + + if "File Not Found" in data or "File was deleted" in data: + return False, config.get_localized_string(70449) % "MaxStream" + return True, "" + + +def get_video_url(page_url, premium=False, user="", password="", video_password=""): + logger.debug("url=" + page_url) + global data + packed = scrapertools.find_single_match(data, r'(eval.*?)') + unpacked = jsunpack.unpack(packed) + return support.get_jwplayer_mediaurl(unpacked, 'MaxStream') From ffa77491163fabd4d6c6946c04437f7668338c62 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 20 Jun 2021 17:52:17 +0000 Subject: [PATCH 030/139] {Aggiornamento domini} --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index 162684db..e7673a61 100644 --- a/channels.json +++ b/channels.json @@ -35,7 +35,7 @@ "raiplay": "https://www.raiplay.it", "serietvonline": "https://serietvonline.art", "serietvsubita": "http://serietvsubita.xyz", - "serietvu": "https://www.serietvu.link", + "serietvu": "https://www.serietvu.live", "streamingcommunity": "https://streamingcommunity.tv", "streamtime": "https://t.me/s/StreamTime", "tantifilm": "https://www.tantifilm.in", From d87d7a17e0fba2045882436e593d599ea9a2504a Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Mon, 21 Jun 2021 10:54:50 +0200 Subject: [PATCH 031/139] Fix Ordinamento Server --- core/servertools.py | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/core/servertools.py b/core/servertools.py index f4a9892e..dfb32f43 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -704,14 +704,16 @@ def sort_servers(servers_list): # 2: Only qualities # 3: Do not order - if config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action'): + if config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and not config.get_setting('quality_priority'): priority = 0 # 0: Servers and qualities + elif config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and config.get_setting('quality_priority'): + priority = 1 # 0: Servers and qualities elif config.get_setting('favorites_servers') and favorite_servers: - priority = 1 # Servers only + priority = 2 # Servers only elif config.get_setting('default_action'): - priority = 2 # Only qualities + priority = 3 # Only qualities else: - priority = 3 # Do not order + priority = 4 # Do not order if config.get_setting('default_action') == 1: quality_list.reverse() @@ -748,26 +750,11 @@ def sort_servers(servers_list): # We order according to priority if priority == 0: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_server'], orden['indice_quality'])) # Servers and qualities - elif priority == 1: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_server'])) # Servers only - elif priority == 2: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_quality'])) # Only qualities + elif priority == 1: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_quality'], orden['indice_server'])) # Servers and qualities + elif priority == 2: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_server'])) # Servers only + elif priority == 3: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_quality'])) # Only qualities else: sorted_list.sort(key=lambda orden: orden['indice_language']) - # if quality priority is active - if priority == 0 and config.get_setting('quality_priority'): - max_quality = sorted_list[0]["indice_quality"] if sorted_list and "indice_quality" in sorted_list[0] else 0 - for n, item in enumerate(servers_list): - - if not item.server or item.server.lower() in blacklisted_servers: - continue - - if index(favorite_quality, item.quality.lower()) < max_quality: - element["indice_server"] = n - element["indice_quality"] = index(favorite_quality, item.quality.lower()) - element['videoitem'] = item - sorted_list.append(element) - - sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_quality'], orden['indice_server'])) - return [v['videoitem'] for v in sorted_list if v] From d4cf099e957cc6fff4ab4491658b4f011098dd5b Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Mon, 21 Jun 2021 18:10:47 +0200 Subject: [PATCH 032/139] Fix HDmario --- core/support.py | 2 +- platformcode/platformtools.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/support.py b/core/support.py index e1807df3..09597c50 100755 --- a/core/support.py +++ b/core/support.py @@ -52,7 +52,7 @@ def hdpass_get_servers(item): data = httptools.downloadpage(url, CF=False).data patron_res = '
(.*?)
(.*?)
(.*?)(?:
]+>([^<]+?) Date: Tue, 22 Jun 2021 18:36:11 +0200 Subject: [PATCH 033/139] Service: rimossi import inutili traceback --- service.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/service.py b/service.py index 95b617c6..377be50b 100644 --- a/service.py +++ b/service.py @@ -93,12 +93,10 @@ def update(path, p_dialog, i, t, serie, overwrite): insertados_total += insertados except: - import traceback logger.error("Error when saving the chapters of the series") logger.error(traceback.format_exc()) except: - import traceback logger.error("Error in obtaining the episodes of: %s" % serie.show) logger.error(traceback.format_exc()) From f32088bf50f4311c9ca297644c258efb4c9ca7ee Mon Sep 17 00:00:00 2001 From: fatshotty Date: Mon, 21 Jun 2021 15:48:11 +0200 Subject: [PATCH 034/139] fix eurostreaming - aggiornamenti --- channels/eurostreaming.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/channels/eurostreaming.py b/channels/eurostreaming.py index f4ec0f92..b67a33e9 100644 --- a/channels/eurostreaming.py +++ b/channels/eurostreaming.py @@ -31,9 +31,10 @@ def mainlist(item): def peliculas(item): # debug = True action = 'episodios' + if item.args == 'newest': item.contentType = 'episode' - patron = r'(?P[^<]+) –\s*<a href="(?P<url>[^"]+)"[^>]*>\s?(?P<episode>\d+[×x]\d+-\d+|\d+[×x]\d+) (?P<title2>[^<\(]+)\s?\(?(?P<lang>SUB ITA)?\)?</a>' + patron = r'<span class="serieTitle" style="font-size:20px">(?P<title>[^<]+) –\s*<a href="(?P<url>[^"]+)"[^>]*>\s+?(?P<episode>\d+[×x]\d+-\d+|\d+[×x]\d+) (?P<title2>[^<\(]+)\s?\(?(?P<lang>SUB ITA)?\)?</a>' pagination = '' else: patron = r'<div class="post-thumb">.*?<img src="(?P<thumb>[^"]+)".*?><a href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)\s?(?: Serie Tv)?\s?\(?(?P<year>\d{4})?\)?<\/a><\/h2>' From e9c561318e3c9836ad5ff70c08aed64becd69f77 Mon Sep 17 00:00:00 2001 From: fatshotty <fat@fatshotty.net> Date: Mon, 21 Jun 2021 17:49:22 +0200 Subject: [PATCH 035/139] change url for ilgeniodellostreaming --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index e7673a61..d3c36052 100644 --- a/channels.json +++ b/channels.json @@ -24,7 +24,7 @@ "guardaserieicu": "https://guardaserie.cleaning", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", - "ilgeniodellostreaming": "https://ilgeniodellostreaming.ist", + "ilgeniodellostreaming": "https://ilgeniodellostreaming.mba", "ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.city", "italiaserie": "https://italiaserie.buzz", "mediasetplay": "https://www.mediasetplay.mediaset.it", From 5be564b3e9f228680c4ae81180c93295c9a75766 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Wed, 23 Jun 2021 19:22:46 +0200 Subject: [PATCH 036/139] Fix guardaserieclick e ricerca ilgenio --- channels/guardaserieclick.py | 77 +++++++++++++++---------------- channels/ilgeniodellostreaming.py | 4 +- 2 files changed, 40 insertions(+), 41 deletions(-) diff --git a/channels/guardaserieclick.py b/channels/guardaserieclick.py index 1ed39ed4..ac1cdace 100644 --- a/channels/guardaserieclick.py +++ b/channels/guardaserieclick.py @@ -25,18 +25,16 @@ headers = [['Referer', host]] @support.menu def mainlist(item): - - tvshow = ['/lista-serie-tv', - ('Aggiornamenti', ['/lista-serie-tv', 'peliculas', 'update']), - ('Generi', ['/categorie', 'genres', 'genres']), - ('News Sub-ITA', ['/lista-serie-tv', 'peliculas', 'ined']), - ('Da non perdere', ['/lista-serie-tv', 'peliculas', 'nolost']), - ('Classiche', ["/lista-serie-tv", 'peliculas', 'classic']), - ('Anime/Cartoni', ["/category/animazione/", 'peliculas', 'genres']) - ] + tvshow = ['', + ('Aggiornamenti', ['', 'peliculas', 'update']), + ('Generi', ['', 'genres', 'genres']), + ('News Sub-ITA', ['', 'peliculas', 'ined']), + ('Anime/Cartoni', ["/category/animazione/", 'peliculas', 'genres']) + ] return locals() + ##@support.scrape ##def peliculas(item): #### import web_pdb; web_pdb.set_trace() @@ -76,7 +74,7 @@ def mainlist(item): @support.scrape def peliculas(item): -## import web_pdb; web_pdb.set_trace() + ## import web_pdb; web_pdb.set_trace() info('peliculas ->\n', item) action = 'episodios' @@ -87,36 +85,36 @@ def peliculas(item): patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)</p>' patronNext = r'rel="next" href="([^"]+)">' item.contentType = 'tvshow' -## elif item.args == 'search': -## patronBlock = r'<h2 style="color:\s?white !important.?" class="title-typology">(?P<block>.*?)<div class="container-fluid whitebg" style="">' -## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)</p>' + ## elif item.args == 'search': + ## patronBlock = r'<h2 style="color:\s?white !important.?" class="title-typology">(?P<block>.*?)<div class="container-fluid whitebg" style="">' + ## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)</p>' else: end_block = r'(?P<block>.*?)<div\s+class="btn btn-lg btn-default btn-load-other-series">' patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<' pagination = 25 if item.args == 'ined': deflang = 'SUB-ITA' - patronBlock = r'<span\s+class="label label-default label-title-typology">'+end_block -## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<' -## pagination = 25 + patronBlock = r'<span\s+class="label label-default label-title-typology">' + end_block + ## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<' + ## pagination = 25 elif item.args == 'update': - patronBlock = r'<div\s+class="container-fluid greybg title-serie-lastep title-last-ep fixed-title-wrapper containerBottomBarTitle">'+end_block - patron = r'<a(?: rel="[^"]+")? href="(?P<url>[^"]+)"(?: class="[^"]+")?>[ ]<img class="[^"]+"[ ]title="[^"]+"[ ]alt="[^"]+"[ ](?:|meta-)?src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?:\d+.\d+)[ ]\((?P<lang>[a-zA-Z\-]+)[^<]+<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)<' - elif item.args == 'nolost': - patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-danonperd">'+end_block -## pagination = 25 - elif item.args == 'classic': - patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-classiche">'+end_block -## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<' -## pagination = 25 -## elif item.args == 'anime': -## + patronBlock = r'<div\s+class="container-fluid greybg title-serie-lastep title-last-ep fixed-title-wrapper containerBottomBarTitle">' + end_block + patron = r'href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>.+?class="strongText">(?P<title>.+?)<' + # elif item.args == 'nolost': + # patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-danonperd">' + end_block + # pagination = 25 + # elif item.args == 'classic': + # patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-classiche">' + end_block + ## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<' + ## pagination = 25 + ## elif item.args == 'anime': + ## else: - patronBlock = r'<div\s+class="container container-title-serie-new container-scheda" meta-slug="new">'+end_block -## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<' -## pagination = 25 - #support.regexDbg(item, patronBlock, headers) - #debug = True + patronBlock = r'<div\s+class="container container-title-serie-new container-scheda" meta-slug="new">' + end_block + ## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<' + ## pagination = 25 + # support.regexDbg(item, patronBlock, headers) + # debug = True return locals() @@ -129,21 +127,21 @@ def episodios(item): patronBlock = r'<h2 class="title-typology">Episodi (?P<stagione>\d+).{1,3}Stagione</h2>(?P<block>.*?)<div class="container">' def itemHook(item): - item.title = item.title.replace(item.fulltitle, '').replace('-','',1) + item.title = item.title.replace(item.fulltitle, '').replace('-', '', 1) return item - #debug = True + # debug = True return locals() + @support.scrape def genres(item): info() action = 'peliculas' - patron = r'<li>\s<a\shref="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)</a></li>' + patronMenu = r'<li>\s<a\shref="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)</a></li>' patron_block = r'<ul\sclass="dropdown-menu category">(?P<block>.*?)</ul>' - item.contentType = '' - + # debug = True return locals() @@ -161,15 +159,16 @@ def search(item, text): info("%s" % line) return [] + def newest(categoria): info() itemlist = [] item = Item() - item.contentType= 'tvshow' + item.contentType = 'tvshow' item.args = 'update' try: if categoria == "series": - item.url = "%s/lista-serie-tv" % host + item.url = host item.action = "peliculas" itemlist = peliculas(item) diff --git a/channels/ilgeniodellostreaming.py b/channels/ilgeniodellostreaming.py index b53e3a62..cfcad0de 100644 --- a/channels/ilgeniodellostreaming.py +++ b/channels/ilgeniodellostreaming.py @@ -124,9 +124,9 @@ def genres(item): def search(item, text): info(text) - itemlist = [] + import uuid text = text.replace(' ', '+') - item.url = host + '/?a=b&s=' + text + item.url = host + '/?' + uuid.uuid4().hex + '=' + uuid.uuid4().hex + '&s=' + text try: item.args = 'search' return peliculas(item) From 17eea720bca34912e49dc48ffc5b19354124ef02 Mon Sep 17 00:00:00 2001 From: fatshotty <fat@fatshotty.net> Date: Thu, 24 Jun 2021 17:39:15 +0200 Subject: [PATCH 037/139] fix: maxstream --- servers/maxstream.py | 49 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/servers/maxstream.py b/servers/maxstream.py index d77e3e6c..aa6bbda8 100644 --- a/servers/maxstream.py +++ b/servers/maxstream.py @@ -2,21 +2,52 @@ from core import httptools from core import scrapertools, support from lib import jsunpack from platformcode import logger, config - +import re, ast, requests def test_video_exists(page_url): logger.debug("(page_url='%s')" % page_url) - global data + + page_url = re.sub(r'(.*\/)([^\/]+)$', '\\1cast/\\2', page_url) + data = httptools.downloadpage(page_url).data - if "File Not Found" in data or "File was deleted" in data: - return False, config.get_localized_string(70449) % "MaxStream" - return True, "" + lastIndexStart = data.rfind('<script>') + lastIndexEnd = data.rfind('</script>') + + script = data[ (lastIndexStart + len('<script>')):lastIndexEnd ] + + char_codes = ast.literal_eval(re.search('\[[^]+]+]',script).group(0)) + hidden_js = "".join([chr(c - int(re.search('parseInt\(value\)\s?-\s?([0-9]+)', script).group(1))) for c in char_codes]) + + newurl = re.search('\$.get\(\'([^\']+)', hidden_js).group(1) + global url_video + url_video = None + + castpage = httptools.downloadpage(newurl, headers={'x-requested-with': 'XMLHttpRequest', 'Referer': page_url }).data + + url_video = re.search( r"cc\.cast\('(http[s]?.*?)'", castpage) + if url_video: + url_video = url_video.group(1) + return True, "" + + return False, config.get_localized_string(70449) % "MaxStream" def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.debug("url=" + page_url) - global data - packed = scrapertools.find_single_match(data, r'(eval.*?)</script>') - unpacked = jsunpack.unpack(packed) - return support.get_jwplayer_mediaurl(unpacked, 'MaxStream') + + # page_url = re.sub(r'(.*\/)([^\/]+)$', '\\1/cast/\\2', page_url) + + # data = httptools.downloadpage(page_url).data + + # packed = scrapertools.find_single_match(data, r'(eval.*?)</script>') + # unpacked = jsunpack.unpack(packed) + # return support.get_jwplayer_mediaurl(unpacked, 'MaxStream') + + if url_video: + video_urls = [] + video_urls.append(["[MaxStream]", url_video]) + return video_urls + else: + raise "Something wrong: no url found before :(" + From 18720adc375c00b14b45e3d7a0ae9aeb906b7a7f Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 25 Jun 2021 10:37:09 +0200 Subject: [PATCH 038/139] Fix VVVVID --- channels/vvvvid.py | 56 +++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/channels/vvvvid.py b/channels/vvvvid.py index 6e736f83..c7e17122 100644 --- a/channels/vvvvid.py +++ b/channels/vvvvid.py @@ -24,43 +24,43 @@ except: main_host = host + '/vvvvid/ondemand/' -host = main_host +# host = main_host @support.menu def mainlist(item): if conn_id: - anime = ['anime/', - ('Popolari',['anime/', 'peliculas', 'channel/10002/last/']), - ('Nuove Uscite',['anime/', 'peliculas', 'channel/10007/last/']), - ('Generi',['anime/', 'peliculas', 'channel/10004/last/?category=']), - ('A-Z',['anime/', 'peliculas', 'channel/10003/last/?filter=']) + anime = ['/vvvvid/ondemand/anime/', + ('Popolari',['/vvvvid/ondemand/anime/', 'peliculas', 'channel/10002/last/']), + ('Nuove Uscite',['/vvvvid/ondemand/anime/', 'peliculas', 'channel/10007/last/']), + ('Generi',['/vvvvid/ondemand/anime/', 'peliculas', 'channel/10004/last/?category=']), + ('A-Z',['/vvvvid/ondemand/anime/', 'peliculas', 'channel/10003/last/?filter=']) ] - film = ['film/', - ('Popolari',['film/', 'peliculas', 'channel/10002/last/']), - ('Nuove Uscite',['film/', 'peliculas', 'channel/10007/last/']), - ('Generi',['film/', 'peliculas', 'channel/10004/last/?category=']), - ('A-Z',['film/', 'peliculas', 'channel/10003/last/?filter=']), + film = ['/vvvvid/ondemand/film/', + ('Popolari',['/vvvvid/ondemand/film/', 'peliculas', 'channel/10002/last/']), + ('Nuove Uscite',['/vvvvid/ondemand/film/', 'peliculas', 'channel/10007/last/']), + ('Generi',['/vvvvid/ondemand/film/', 'peliculas', 'channel/10004/last/?category=']), + ('A-Z',['/vvvvid/ondemand/film/', 'peliculas', 'channel/10003/last/?filter=']), ] - tvshow = ['series/', - ('Popolari',['series/', 'peliculas', 'channel/10002/last/']), - ('Nuove Uscite',['series/', 'peliculas', 'channel/10007/last/']), - ('Generi',['series/', 'peliculas', 'channel/10004/last/?category=']), - ('A-Z',['series/', 'peliculas', 'channel/10003/last/?filter=']) + tvshow = ['/vvvvid/ondemand/series/', + ('Popolari',['/vvvvid/ondemand/series/', 'peliculas', 'channel/10002/last/']), + ('Nuove Uscite',['/vvvvid/ondemand/series/', 'peliculas', 'channel/10007/last/']), + ('Generi',['/vvvvid/ondemand/series/', 'peliculas', 'channel/10004/last/?category=']), + ('A-Z',['/vvvvid/ondemand/series/', 'peliculas', 'channel/10003/last/?filter=']) ] - show = [('Show {bold} {tv}',['show/', 'peliculas', '', 'tvshow']), - ('Popolari {submenu} {tv}',['show/', 'peliculas', 'channel/10002/last/', 'tvshow']), - ('Nuove Uscite {submenu} {tv}',['show/', 'peliculas', 'channel/10007/last/', 'tvshow']), - ('Generi {submenu} {tv}',['show/', 'peliculas', 'channel/10004/last/?category=', 'tvshow']), - ('A-Z {submenu} {tv}',['show/', 'peliculas', 'channel/10003/last/?filter=', 'tvshow']), - ('Cerca Show... {bold submenu} {tv}', ['show/', 'search', '', 'tvshow']) + show = [('Show {bold} {tv}',['/vvvvid/ondemand/show/', 'peliculas', '', 'tvshow']), + ('Popolari {submenu} {tv}',['/vvvvid/ondemand/show/', 'peliculas', 'channel/10002/last/', 'tvshow']), + ('Nuove Uscite {submenu} {tv}',['/vvvvid/ondemand/show/', 'peliculas', 'channel/10007/last/', 'tvshow']), + ('Generi {submenu} {tv}',['/vvvvid/ondemand/show/', 'peliculas', 'channel/10004/last/?category=', 'tvshow']), + ('A-Z {submenu} {tv}',['/vvvvid/ondemand/show/', 'peliculas', 'channel/10003/last/?filter=', 'tvshow']), + ('Cerca Show... {bold submenu} {tv}', ['/vvvvid/ondemand/show/', 'search', '', 'tvshow']) ] - kids = [('Kids {bold}',['kids/', 'peliculas', '', 'tvshow']), - ('Popolari {submenu} {kids}',['kids/', 'peliculas', 'channel/10002/last/', 'tvshow']), - ('Nuove Uscite {submenu} {kids}',['kids/', 'peliculas', 'channel/10007/last/', 'tvshow']), - ('Generi {submenu} {kids}',['kids/', 'peliculas', 'channel/10004/last/?category=', 'tvshow']), - ('A-Z {submenu} {kids}',['kids/', 'peliculas', 'channel/10003/last/?filter=', 'tvshow']), - ('Cerca Kids... {bold submenu} {kids}', ['kids/', 'search', '', 'tvshow']) + kids = [('Kids {bold}',['/vvvvid/ondemand/kids/', 'peliculas', '', 'tvshow']), + ('Popolari {submenu} {kids}',['/vvvvid/ondemand/kids/', 'peliculas', 'channel/10002/last/', 'tvshow']), + ('Nuove Uscite {submenu} {kids}',['/vvvvid/ondemand/kids/', 'peliculas', 'channel/10007/last/', 'tvshow']), + ('Generi {submenu} {kids}',['/vvvvid/ondemand/kids/', 'peliculas', 'channel/10004/last/?category=', 'tvshow']), + ('A-Z {submenu} {kids}',['/vvvvid/ondemand/kids/', 'peliculas', 'channel/10003/last/?filter=', 'tvshow']), + ('Cerca Kids... {bold submenu} {kids}', ['/vvvvid/ondemand/kids/', 'search', '', 'tvshow']) ] else: Top = [("Visibile solo dall'Italia {bold}",[])] From 9f595ef4094cded6d5f1db4422d91ff7e5de0512 Mon Sep 17 00:00:00 2001 From: fatshotty <fat@fatshotty.net> Date: Fri, 25 Jun 2021 10:38:08 +0200 Subject: [PATCH 039/139] fix refactor code --- servers/maxstream.json | 2 +- servers/maxstream.py | 41 +++++++++++++++++------------------------ 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/servers/maxstream.json b/servers/maxstream.json index 8cb8257d..893c21e3 100644 --- a/servers/maxstream.json +++ b/servers/maxstream.json @@ -5,7 +5,7 @@ "patterns": [ { "pattern": "https?://maxstream.video/(?:e/)?([a-z0-9]+)", - "url": "https://maxstream.video/\\1" + "url": "https://maxstream.video/cast/\\1" }, { "pattern": "https?://maxstream.video/embed-([a-z0-9]+).html", diff --git a/servers/maxstream.py b/servers/maxstream.py index aa6bbda8..2607737b 100644 --- a/servers/maxstream.py +++ b/servers/maxstream.py @@ -7,10 +7,19 @@ import re, ast, requests def test_video_exists(page_url): logger.debug("(page_url='%s')" % page_url) - page_url = re.sub(r'(.*\/)([^\/]+)$', '\\1cast/\\2', page_url) - + global data data = httptools.downloadpage(page_url).data + if "file was deleted" in data: + return False, config.get_localized_string(70449) % "MaxStream" + + return True, "" + + + +def get_video_url(page_url, premium=False, user="", password="", video_password=""): + logger.debug("url=" + page_url) + lastIndexStart = data.rfind('<script>') lastIndexEnd = data.rfind('</script>') @@ -19,35 +28,19 @@ def test_video_exists(page_url): char_codes = ast.literal_eval(re.search('\[[^]+]+]',script).group(0)) hidden_js = "".join([chr(c - int(re.search('parseInt\(value\)\s?-\s?([0-9]+)', script).group(1))) for c in char_codes]) - newurl = re.search('\$.get\(\'([^\']+)', hidden_js).group(1) - global url_video + # newurl = re.search('\$.get\(\'([^\']+)', hidden_js).group(1) + newurl = scrapertools.find_single_match(hidden_js, r'\$.get\(\'([^\']+)') + url_video = None castpage = httptools.downloadpage(newurl, headers={'x-requested-with': 'XMLHttpRequest', 'Referer': page_url }).data - url_video = re.search( r"cc\.cast\('(http[s]?.*?)'", castpage) - if url_video: - url_video = url_video.group(1) - return True, "" - - return False, config.get_localized_string(70449) % "MaxStream" - - -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.debug("url=" + page_url) - - # page_url = re.sub(r'(.*\/)([^\/]+)$', '\\1/cast/\\2', page_url) - - # data = httptools.downloadpage(page_url).data - - # packed = scrapertools.find_single_match(data, r'(eval.*?)</script>') - # unpacked = jsunpack.unpack(packed) - # return support.get_jwplayer_mediaurl(unpacked, 'MaxStream') + url_video = scrapertools.find_single_match(castpage, r"cc\.cast\('(http[s]?.*?)'") if url_video: video_urls = [] - video_urls.append(["[MaxStream]", url_video]) + video_urls.append(["mp4 [MaxStream]", url_video]) return video_urls else: - raise "Something wrong: no url found before :(" + raise "Something wrong: no url found before that :(" From 415fcea5171a88cddfffb43e17c5bc2401bc5918 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 25 Jun 2021 10:49:23 +0200 Subject: [PATCH 040/139] Rimossa Sezione Live --- channels/discoveryplus.json | 2 +- channels/la7.json | 2 +- channels/mediasetplay.json | 2 +- channels/paramount.json | 2 +- channels/raiplay.json | 2 +- channelselector.py | 2 +- specials/filmontv.py | 8 ++++---- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/channels/discoveryplus.json b/channels/discoveryplus.json index ef5baa65..defb29aa 100644 --- a/channels/discoveryplus.json +++ b/channels/discoveryplus.json @@ -1,7 +1,7 @@ { "id": "discoveryplus", "name": "Discovery + [free]", - "active": true, + "active": false, "language": ["ita"], "thumbnail": "discoveryplus.png", "banner": "discoveryplus.png", diff --git a/channels/la7.json b/channels/la7.json index 3b129009..4312cdbf 100644 --- a/channels/la7.json +++ b/channels/la7.json @@ -1,7 +1,7 @@ { "id": "la7", "name": "La7", - "active": true, + "active": false, "language": ["ita"], "thumbnail": "la7.png", "banner": "la7.png", diff --git a/channels/mediasetplay.json b/channels/mediasetplay.json index 660a0a7b..cec5e42b 100644 --- a/channels/mediasetplay.json +++ b/channels/mediasetplay.json @@ -1,7 +1,7 @@ { "id": "mediasetplay", "name": "Mediaset Play", - "active": true, + "active": false, "language": ["ita"], "thumbnail": "mediasetplay.png", "banner": "mediasetplay.png", diff --git a/channels/paramount.json b/channels/paramount.json index 5440e69b..e0c8bd57 100644 --- a/channels/paramount.json +++ b/channels/paramount.json @@ -1,7 +1,7 @@ { "id": "paramount", "name": "Paramount Network", - "active": true, + "active": false, "language": ["ita"], "thumbnail": "paramount.png", "banner": "paramount.png", diff --git a/channels/raiplay.json b/channels/raiplay.json index ea50d4d5..145951e8 100644 --- a/channels/raiplay.json +++ b/channels/raiplay.json @@ -1,7 +1,7 @@ { "id": "raiplay", "name": "Rai Play", - "active": true, + "active": false, "language": ["ita"], "thumbnail": "raiplay.png", "banner": "raiplay.png", diff --git a/channelselector.py b/channelselector.py index cb72988c..ed36d2f2 100644 --- a/channelselector.py +++ b/channelselector.py @@ -62,7 +62,7 @@ def getchanneltypes(view="thumb_"): logger.debug() # Category List - channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "live", "torrent", "music"] #, "direct" + channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "torrent", "music"] # , "live", "direct" # Channel Language channel_language = auto_filter() diff --git a/specials/filmontv.py b/specials/filmontv.py index 9b059edc..537bd289 100644 --- a/specials/filmontv.py +++ b/specials/filmontv.py @@ -24,10 +24,10 @@ def mainlist(item): # thumbnail=get_thumb("now_playing.png")), #Item(channel="search", action='discover_list', title=config.get_localized_string(70312), # search_type='list', list_type='tv/on_the_air', thumbnail=get_thumb("on_the_air.png")), - Item(title=support.typo('Canali live', 'bold'), - channel=item.channel, - action='live', - thumbnail=support.thumb('tvshow_on_the_air')), + # Item(title=support.typo('Canali live', 'bold'), + # channel=item.channel, + # action='live', + # thumbnail=support.thumb('tvshow_on_the_air')), Item(channel=item.channel, title=config.get_setting("film1", channel="filmontv"), action="now_on_tv", From 7c197f89f1c394dd6a1c998441fe2ed3949e4e66 Mon Sep 17 00:00:00 2001 From: fatshotty <fat@fatshotty.net> Date: Fri, 25 Jun 2021 11:09:58 +0200 Subject: [PATCH 041/139] fix maxstream for tvshows and movies --- servers/maxstream.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/servers/maxstream.json b/servers/maxstream.json index 893c21e3..353937a5 100644 --- a/servers/maxstream.json +++ b/servers/maxstream.json @@ -4,12 +4,8 @@ "ignore_urls": [], "patterns": [ { - "pattern": "https?://maxstream.video/(?:e/)?([a-z0-9]+)", + "pattern": "https?://maxstream.video/.*?([^\/]+)$", "url": "https://maxstream.video/cast/\\1" - }, - { - "pattern": "https?://maxstream.video/embed-([a-z0-9]+).html", - "url": "https://maxstream.video/\\1" } ] }, From cbe69ac2e32021cb3135409a6e45616f7e7814cc Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 25 Jun 2021 15:57:20 +0200 Subject: [PATCH 042/139] Migliorie MaxStream --- servers/maxstream.json | 2 +- servers/maxstream.py | 47 ++++++++++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/servers/maxstream.json b/servers/maxstream.json index 353937a5..902c5f0a 100644 --- a/servers/maxstream.json +++ b/servers/maxstream.json @@ -4,7 +4,7 @@ "ignore_urls": [], "patterns": [ { - "pattern": "https?://maxstream.video/.*?([^\/]+)$", + "pattern": "https?://maxstream.video/(?:e/|embed-|cast/)?([a-z0-9]+)", "url": "https://maxstream.video/cast/\\1" } ] diff --git a/servers/maxstream.py b/servers/maxstream.py index 2607737b..ded4024c 100644 --- a/servers/maxstream.py +++ b/servers/maxstream.py @@ -2,7 +2,12 @@ from core import httptools from core import scrapertools, support from lib import jsunpack from platformcode import logger, config -import re, ast, requests +import re, ast, requests, sys + +if sys.version_info[0] >= 3: + import urllib.parse as urlparse +else: + import urlparse def test_video_exists(page_url): logger.debug("(page_url='%s')" % page_url) @@ -12,35 +17,41 @@ def test_video_exists(page_url): if "file was deleted" in data: return False, config.get_localized_string(70449) % "MaxStream" - + return True, "" - + def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.debug("url=" + page_url) + video_urls = [] + url_video = '' lastIndexStart = data.rfind('<script>') lastIndexEnd = data.rfind('</script>') script = data[ (lastIndexStart + len('<script>')):lastIndexEnd ] - char_codes = ast.literal_eval(re.search('\[[^]+]+]',script).group(0)) - hidden_js = "".join([chr(c - int(re.search('parseInt\(value\)\s?-\s?([0-9]+)', script).group(1))) for c in char_codes]) - - # newurl = re.search('\$.get\(\'([^\']+)', hidden_js).group(1) - newurl = scrapertools.find_single_match(hidden_js, r'\$.get\(\'([^\']+)') + match = scrapertools.find_single_match(script, r'(\[[^\]]+\])[^\{]*\{[^\(]+\(parseInt\(value\)\s?-\s?([0-9]+)') + if match: + char_codes = ast.literal_eval(match[0]) + hidden_js = "".join([chr(c - int(match[1])) for c in char_codes]) - url_video = None - - castpage = httptools.downloadpage(newurl, headers={'x-requested-with': 'XMLHttpRequest', 'Referer': page_url }).data - - url_video = scrapertools.find_single_match(castpage, r"cc\.cast\('(http[s]?.*?)'") + newurl = scrapertools.find_single_match(hidden_js, r'\$.get\(\'([^\']+)') + castpage = httptools.downloadpage(newurl, headers={'x-requested-with': 'XMLHttpRequest', 'Referer': page_url }).data + url_video = scrapertools.find_single_match(castpage, r"cc\.cast\('(http[s]?.[^']+)'") + else: + logger.debug('Something wrong: no url found before that :(') if url_video: - video_urls = [] - video_urls.append(["mp4 [MaxStream]", url_video]) - return video_urls - else: - raise "Something wrong: no url found before that :(" + parse = urlparse.urlparse(url_video) + video_urls.append(['mp4 [MaxStream]', url_video]) + try: + video_urls.append(['m3u8 [MaxStream]', '{}://{}/hls/{}/master.m3u8'.format(parse.scheme, parse.netloc, parse.path.split('/')[1]) ]) + except: + logger.debug('Something wrong: Impossible get HLS stream') + return video_urls + + + From 74e4652d5bb447438d8f322f1724a190928fce8e Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 25 Jun 2021 15:59:22 +0200 Subject: [PATCH 043/139] MaxStream rimossi import inutili --- servers/maxstream.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/servers/maxstream.py b/servers/maxstream.py index ded4024c..d7c50cf4 100644 --- a/servers/maxstream.py +++ b/servers/maxstream.py @@ -1,8 +1,11 @@ -from core import httptools -from core import scrapertools, support -from lib import jsunpack +# -*- coding: utf-8 -*- +# -------------------------------------------------------- +# Conector MaxStream +# -------------------------------------------------------- + +from core import httptools, scrapertools from platformcode import logger, config -import re, ast, requests, sys +import ast, sys if sys.version_info[0] >= 3: import urllib.parse as urlparse From 1017c661d26e3e2639a369ef04922b827fb96027 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 25 Jun 2021 18:30:46 +0200 Subject: [PATCH 044/139] MaxStream HLS con risoluzioni multiple --- servers/maxstream.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/servers/maxstream.py b/servers/maxstream.py index d7c50cf4..ece93bce 100644 --- a/servers/maxstream.py +++ b/servers/maxstream.py @@ -3,7 +3,7 @@ # Conector MaxStream # -------------------------------------------------------- -from core import httptools, scrapertools +from core import httptools, scrapertools, support from platformcode import logger, config import ast, sys @@ -47,10 +47,15 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= logger.debug('Something wrong: no url found before that :(') if url_video: + import random, string parse = urlparse.urlparse(url_video) video_urls.append(['mp4 [MaxStream]', url_video]) try: - video_urls.append(['m3u8 [MaxStream]', '{}://{}/hls/{}/master.m3u8'.format(parse.scheme, parse.netloc, parse.path.split('/')[1]) ]) + r1 = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(19)) + r2 = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(19)) + r3 = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(19)) + video_urls.append(['m3u8 [MaxStream]', '{}://{}/hls/{},{},{},{},.urlset/master.m3u8'.format(parse.scheme, parse.netloc, parse.path.split('/')[1], r1, r2, r3)]) + # video_urls.append(['m3u8 [MaxStream]', '{}://{}/hls/{},wpsc2hllm5g5fkjvslq,4jcc2hllm5gzykkkgha,fmca2hllm5jtpb7cj5q,.urlset/master.m3u8'.format(parse.scheme, parse.netloc, parse.path.split('/')[1])]) except: logger.debug('Something wrong: Impossible get HLS stream') return video_urls From 5e4a6d9e280198e37b513c26432c3e2d9b47f443 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sat, 26 Jun 2021 12:51:17 +0200 Subject: [PATCH 045/139] Revert "Rimossa Sezione Live" This reverts commit 415fcea5 --- channels/discoveryplus.json | 2 +- channels/la7.json | 2 +- channels/mediasetplay.json | 2 +- channels/paramount.json | 2 +- channels/raiplay.json | 2 +- channelselector.py | 2 +- specials/filmontv.py | 8 ++++---- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/channels/discoveryplus.json b/channels/discoveryplus.json index defb29aa..ef5baa65 100644 --- a/channels/discoveryplus.json +++ b/channels/discoveryplus.json @@ -1,7 +1,7 @@ { "id": "discoveryplus", "name": "Discovery + [free]", - "active": false, + "active": true, "language": ["ita"], "thumbnail": "discoveryplus.png", "banner": "discoveryplus.png", diff --git a/channels/la7.json b/channels/la7.json index 4312cdbf..3b129009 100644 --- a/channels/la7.json +++ b/channels/la7.json @@ -1,7 +1,7 @@ { "id": "la7", "name": "La7", - "active": false, + "active": true, "language": ["ita"], "thumbnail": "la7.png", "banner": "la7.png", diff --git a/channels/mediasetplay.json b/channels/mediasetplay.json index cec5e42b..660a0a7b 100644 --- a/channels/mediasetplay.json +++ b/channels/mediasetplay.json @@ -1,7 +1,7 @@ { "id": "mediasetplay", "name": "Mediaset Play", - "active": false, + "active": true, "language": ["ita"], "thumbnail": "mediasetplay.png", "banner": "mediasetplay.png", diff --git a/channels/paramount.json b/channels/paramount.json index e0c8bd57..5440e69b 100644 --- a/channels/paramount.json +++ b/channels/paramount.json @@ -1,7 +1,7 @@ { "id": "paramount", "name": "Paramount Network", - "active": false, + "active": true, "language": ["ita"], "thumbnail": "paramount.png", "banner": "paramount.png", diff --git a/channels/raiplay.json b/channels/raiplay.json index 145951e8..ea50d4d5 100644 --- a/channels/raiplay.json +++ b/channels/raiplay.json @@ -1,7 +1,7 @@ { "id": "raiplay", "name": "Rai Play", - "active": false, + "active": true, "language": ["ita"], "thumbnail": "raiplay.png", "banner": "raiplay.png", diff --git a/channelselector.py b/channelselector.py index ed36d2f2..cb72988c 100644 --- a/channelselector.py +++ b/channelselector.py @@ -62,7 +62,7 @@ def getchanneltypes(view="thumb_"): logger.debug() # Category List - channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "torrent", "music"] # , "live", "direct" + channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "live", "torrent", "music"] #, "direct" # Channel Language channel_language = auto_filter() diff --git a/specials/filmontv.py b/specials/filmontv.py index 537bd289..9b059edc 100644 --- a/specials/filmontv.py +++ b/specials/filmontv.py @@ -24,10 +24,10 @@ def mainlist(item): # thumbnail=get_thumb("now_playing.png")), #Item(channel="search", action='discover_list', title=config.get_localized_string(70312), # search_type='list', list_type='tv/on_the_air', thumbnail=get_thumb("on_the_air.png")), - # Item(title=support.typo('Canali live', 'bold'), - # channel=item.channel, - # action='live', - # thumbnail=support.thumb('tvshow_on_the_air')), + Item(title=support.typo('Canali live', 'bold'), + channel=item.channel, + action='live', + thumbnail=support.thumb('tvshow_on_the_air')), Item(channel=item.channel, title=config.get_setting("film1", channel="filmontv"), action="now_on_tv", From 0634538f8d7c269db4d7db4d855da6ed03868f9e Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sat, 26 Jun 2021 15:20:05 +0200 Subject: [PATCH 046/139] Cb01: esclusione definitiva articoli di servizio, toonitalia fix sezione aggiornamenti, piccole migliorie --- channels/cineblog01.py | 17 +++++++++-------- channels/ilgeniodellostreaming.py | 3 +++ channels/toonitalia.py | 2 +- servers/ninjastream.py | 2 +- servers/playtube.py | 6 ++---- servers/youdbox.py | 2 +- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/channels/cineblog01.py b/channels/cineblog01.py index 1248660b..4d79f4d9 100644 --- a/channels/cineblog01.py +++ b/channels/cineblog01.py @@ -91,13 +91,14 @@ def search(item, text): @support.scrape def peliculas(item): + # debug = True # esclusione degli articoli 'di servizio' - curYear = datetime.date.today().year - blacklist = ['BENVENUTI', 'Richieste Serie TV', 'CB01.UNO ▶ TROVA L’INDIRIZZO UFFICIALE ', - 'Aggiornamento Quotidiano Serie TV', 'AVVISO!!!', - 'Openload: la situazione. Benvenuto Verystream', 'Openload: lo volete ancora?', - 'OSCAR ' + str(curYear) + ' ▶ VOTA IL TUO FILM PREFERITO! 🎬', - 'Auguri di Buon Natale e Felice Anno Nuovo! – ' + str(curYear) + '!'] + # curYear = datetime.date.today().year + # blacklist = ['BENVENUTI', 'Richieste Serie TV', 'CB01.UNO ▶ TROVA L’INDIRIZZO UFFICIALE ', + # 'Aggiornamento Quotidiano Serie TV', 'AVVISO!!!', + # 'Openload: la situazione. Benvenuto Verystream', 'Openload: lo volete ancora?', + # 'OSCAR ' + str(curYear) + ' ▶ VOTA IL TUO FILM PREFERITO! 🎬', + # 'Auguri di Buon Natale e Felice Anno Nuovo! – ' + str(curYear) + '!'] if 'newest' in item.args: pagination = '' @@ -110,11 +111,11 @@ def peliculas(item): action = 'episodios' elif '/serietv/' not in item.url: - patron = r'<div class="card-image">\s*<a[^>]+>\s*<img src="(?P<thumb>[^" ]+)" alt[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><a href="?(?P<url>[^" >]+)(?:\/|"|\s+)>(?P<title>[^<[(]+)(?:\[(?P<quality>[a-zA-Z/]+)\]\s*)?(?:\[(?P<lang>Sub-ITA|ITA)\]\s*)?(?:\[(?P<quality2>[a-zA-Z/]+)\]\s*)? (?:\((?P<year>[0-9]{4})\))?[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<genre>[^<>&‖“]+)(?:[^ ]+\s*DURATA\s*(?P<duration>[0-9]+)[^>]+>[^>]+>[^>]+>(?P<plot>[^<>]+))?' + patron = r'(?<!sticky )hentry.*?<div class="card-image">\s*<a[^>]+>\s*<img src="(?P<thumb>[^" ]+)" alt[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><a href="?(?P<url>[^" >]+)(?:\/|"|\s+)>(?P<title>[^<[(]+)(?:\[(?P<quality>[a-zA-Z/]+)\]\s*)?(?:\[(?P<lang>Sub-ITA|ITA)\]\s*)?(?:\[(?P<quality2>[a-zA-Z/]+)\]\s*)? (?:\((?P<year>[0-9]{4})\))?[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<genre>[^<>&‖“]+)(?:[^ ]+\s*DURATA\s*(?P<duration>[0-9]+)[^>]+>[^>]+>[^>]+>(?P<plot>[^<>]+))?' action = 'findvideos' else: - patron = r'card-image[^>]*>\s*<a href=(?:")?(?P<url>[^" >]+)(?:")?\s*>\s*<img src=(?:")?(?P<thumb>[^" ]+)(?:")? alt="(?P<title>.*?)(?: – \d+×\d+)?(?:"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>(?P<genre>[^\(]+)\((?P<year>\d{4})[^>]*>[^>]+>[^>]+>[^>]+>(?:<p>)?(?P<plot>[^<]+)' + patron = r'(?<!sticky )hentry.*?card-image[^>]*>\s*<a href=(?:")?(?P<url>[^" >]+)(?:")?\s*>\s*<img src=(?:")?(?P<thumb>[^" ]+)(?:")? alt="(?P<title>.*?)(?: – \d+×\d+)?(?:"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>(?P<genre>[^\(]+)\((?P<year>\d{4})[^>]*>[^>]+>[^>]+>[^>]+>(?:<p>)?(?P<plot>[^<]+)' action = 'episodios' item.contentType = 'tvshow' diff --git a/channels/ilgeniodellostreaming.py b/channels/ilgeniodellostreaming.py index cfcad0de..c17e962d 100644 --- a/channels/ilgeniodellostreaming.py +++ b/channels/ilgeniodellostreaming.py @@ -105,6 +105,7 @@ def episodios(item): # debugBlock = True return locals() + @support.scrape def genres(item): info(item) @@ -119,9 +120,11 @@ def genres(item): patronBlock = r'<div class="movies-letter">(?P<block>.*?)<div class="clearfix">' patronMenu = r'<a(?:.+?)?href="(?P<url>.*?)"[ ]?>(?P<title>.*?)<\/a>' + # debugBlock = True return locals() + def search(item, text): info(text) import uuid diff --git a/channels/toonitalia.py b/channels/toonitalia.py index f3958941..69ebb1e6 100644 --- a/channels/toonitalia.py +++ b/channels/toonitalia.py @@ -71,7 +71,7 @@ def peliculas(item): #patron = r'href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"' patron = r'<a href="(?P<url>[^"]+)"[^>]*>(?P<title>[^<]+)<[^>]+>[^>]+>\s*<div' elif item.args == 'last': - patronBlock = 'Aggiornamenti</h2>(?P<block>.*)</ul>' + patronBlock = '(?:Aggiornamenti|Update)</h2>(?P<block>.*?)</ul>' patron = r'<a href="(?P<url>[^"]+)">\s*<img[^>]+src[set]{0,3}="(?P<thumbnail>[^ ]+)[^>]+>\s*<span[^>]+>(?P<title>[^<]+)' else: patronBlock = '<main[^>]+>(?P<block>.*)</main>' diff --git a/servers/ninjastream.py b/servers/ninjastream.py index 53ff6700..426002d7 100644 --- a/servers/ninjastream.py +++ b/servers/ninjastream.py @@ -34,7 +34,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= # support.dbg() url = data.get('result',{}).get('playlist') - video_urls.append([url.split('.')[-1], url + '|Referer:' + page_url]) + video_urls.append([url.split('.')[-1], url + '|Referer=' + page_url]) return video_urls diff --git a/servers/playtube.py b/servers/playtube.py index c9df8e0f..a42f2156 100644 --- a/servers/playtube.py +++ b/servers/playtube.py @@ -2,12 +2,10 @@ # -------------------------------------------------------- # Conector playtube By Alfa development Group # -------------------------------------------------------- -import re -import codecs from core import httptools from core import scrapertools from lib import jsunpack -from platformcode import logger +from platformcode import logger, config def test_video_exists(page_url): @@ -24,6 +22,6 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= video_urls = [] pack = scrapertools.find_single_match(data.data, 'p,a,c,k,e,d.*?</script>') unpacked = jsunpack.unpack(pack) - url = scrapertools.find_single_match(unpacked, 'file:"([^"]+)') + "|referer=%s" %(page_url) + url = scrapertools.find_single_match(unpacked, 'file:"([^"]+)') + "|Referer=%s" % page_url video_urls.append(['m3u8 [PlayTube]', url] ) return video_urls \ No newline at end of file diff --git a/servers/youdbox.py b/servers/youdbox.py index 55e9c17b..c60e6794 100644 --- a/servers/youdbox.py +++ b/servers/youdbox.py @@ -11,7 +11,7 @@ def test_video_exists(page_url): data = httptools.downloadpage(page_url).data if 'File was deleted' in data: return False, config.get_localized_string(70449) % 'YouDbox' - return True + return True, "" def get_video_url(page_url, video_password): From befa59f1606c8c397ab8d3887a4bdceb98f72c1f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Sat, 26 Jun 2021 17:43:47 +0000 Subject: [PATCH 047/139] {Aggiornamento domini} --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index d3c36052..95f6309b 100644 --- a/channels.json +++ b/channels.json @@ -21,7 +21,7 @@ "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", "guardaserieclick": "https://www.guardaserie.support", - "guardaserieicu": "https://guardaserie.cleaning", + "guardaserieicu": "https://guardaserie.catering", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", "ilgeniodellostreaming": "https://ilgeniodellostreaming.mba", From da312433f6dad4c956e44534c47ee43594da4370 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Mon, 28 Jun 2021 10:24:51 +0200 Subject: [PATCH 048/139] Fix streamZ --- servers/streamz.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/servers/streamz.py b/servers/streamz.py index 099f174b..0d6ed8e0 100644 --- a/servers/streamz.py +++ b/servers/streamz.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # -------------------------------------------------------- -# Conector Streamz By Alfa development Group +# Conector Streamz # -------------------------------------------------------- import re -from core import httptools +from core import httptools, scrapertools from platformcode import logger, config +from lib import jsunpack def test_video_exists(page_url): @@ -14,16 +15,19 @@ def test_video_exists(page_url): data = httptools.downloadpage(page_url) if "<b>File not found, sorry!</b" in data.data: - return False, config.get_localized_string(70449) % "streamz" + return False, config.get_localized_string(70449) % "streamZ" return True, "" def get_video_url(page_url, video_password=""): logger.info("(page_url='%s')" % page_url) video_urls = [] - - url = re.sub(r'(\.\w{2,3})/\w', '\\1/getlink-', data.url) + '.dll' + packed_data = scrapertools.find_single_match(data.data, r'(function\(p,a,c,k,e,d\)[^<]+)') + if packed_data: + url = scrapertools.find_single_match(jsunpack.unpack(packed_data), r"src:\\'([^'\\]+)") + else: + url = re.sub(r'(\.\w{2,3})/\w', '\\1/getl1nk-', data.url) + '.dll' url += "|User-Agent=%s" % httptools.get_user_agent() - video_urls.append([".mp4 [Streamz]", url]) + video_urls.append([".mp4 [streamZ]", url]) return video_urls \ No newline at end of file From abaff93e9fdc8efaa5b1b7670f81907a277b0534 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Mon, 28 Jun 2021 16:33:02 +0200 Subject: [PATCH 049/139] Fix Episodio Successivo --- platformcode/xbmc_videolibrary.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platformcode/xbmc_videolibrary.py b/platformcode/xbmc_videolibrary.py index 9fcae0bf..1e77e02b 100644 --- a/platformcode/xbmc_videolibrary.py +++ b/platformcode/xbmc_videolibrary.py @@ -14,7 +14,7 @@ if PY3: else: import urllib2 # Usamos el nativo de PY2 que es más rápido -from core import filetools, jsontools +from core import filetools, jsontools, support from platformcode import config, logger, platformtools from core import scrapertools from xml.dom import minidom @@ -74,6 +74,7 @@ def mark_auto_as_watched(item): # check for next Episode if next_episode and sync and time_from_end >= difference: + support.dbg() nextdialog = NextDialog(ND, config.get_runtime_path()) while platformtools.is_playing() and not nextdialog.is_exit(): xbmc.sleep(100) @@ -1389,7 +1390,7 @@ class NextDialog(xbmcgui.WindowXMLDialog): else: img = filetools.join(config.get_runtime_path(), "resources", "noimage.png") self.setProperty("next_img", img) self.setProperty("title", info["tvshowtitle"]) - self.setProperty("ep_title", "%dx%02d - %s" % (info["season"], info["episode"], info["title"])) + self.setProperty("ep_title", "%dx%02d - %s" % (info["season"], info["episode"], info.get("title",''))) self.show() def set_exit(self, EXIT): From 68557aed96dd8126ac2534cf095434b54a3d4ba6 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Tue, 29 Jun 2021 11:18:02 +0200 Subject: [PATCH 050/139] Fix streamZ --- servers/streamz.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/servers/streamz.py b/servers/streamz.py index 0d6ed8e0..2615a1a0 100644 --- a/servers/streamz.py +++ b/servers/streamz.py @@ -4,9 +4,8 @@ # -------------------------------------------------------- import re -from core import httptools, scrapertools +from core import httptools from platformcode import logger, config -from lib import jsunpack def test_video_exists(page_url): @@ -22,11 +21,14 @@ def test_video_exists(page_url): def get_video_url(page_url, video_password=""): logger.info("(page_url='%s')" % page_url) video_urls = [] - packed_data = scrapertools.find_single_match(data.data, r'(function\(p,a,c,k,e,d\)[^<]+)') - if packed_data: - url = scrapertools.find_single_match(jsunpack.unpack(packed_data), r"src:\\'([^'\\]+)") - else: - url = re.sub(r'(\.\w{2,3})/\w', '\\1/getl1nk-', data.url) + '.dll' + # real_video = scrapertools.find_single_match(data.data, r"var player = [^\(]+\('(video_\d)") + # packed_data = scrapertools.find_single_match(data.data, r'(eval\(function\(p,a,c,k,e,d\).*?{}[^<]+)'.format(real_video)) + # if packed_data: + # url = scrapertools.find_single_match(jsunpack.unpack(packed_data), r"src:\\'([^'\\]+)") + # url += "|User-Agent=%s" % httptools.get_user_agent() + # video_urls.append([".mp4 [streamZ]", url]) + # else: + url = re.sub(r'(\.\w{2,3})/\w', '\\1/getl1nk-', data.url) + '.dll' url += "|User-Agent=%s" % httptools.get_user_agent() video_urls.append([".mp4 [streamZ]", url]) From a9746da11e771e8960b1a6649bd23c4f7c451f24 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Tue, 29 Jun 2021 16:06:33 +0200 Subject: [PATCH 051/139] =?UTF-8?q?Fix=20Novit=C3=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- specials/news.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/specials/news.py b/specials/news.py index 208b3801..ba874c5e 100644 --- a/specials/news.py +++ b/specials/news.py @@ -400,13 +400,14 @@ def get_title(item): # title = re.compile("\[.*?\]", re.DOTALL).sub("", item.contentSerieName) if not scrapertools.get_season_and_episode(title) and item.contentEpisodeNumber: # contentSeason non c'è in support - if not item.contentSeason: - item.contentSeason = '1' - title = "%sx%s - %s" % (item.contentSeason, str(item.contentEpisodeNumber).zfill(2), title) + if item.contentSeason: + title = '{}x{:02d}. {}'.format(item.contentSeason, item.contentEpisodeNumber, title) + else: + title = '{:02d}. {}'.format(item.contentEpisodeNumber, title) else: seas = scrapertools.get_season_and_episode(item.title) if seas: - title = "%s - %s" % (seas, title) + title = "{}. {}".format(seas, title) elif item.contentTitle: # If it is a movie with the adapted channel title = item.contentTitle From 5b144ac71beb9f2dd5a70821b5055fb5a94bdaaa Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Tue, 29 Jun 2021 17:47:47 +0200 Subject: [PATCH 052/139] Fix Menu Contesuale Rinumerazione --- platformcode/autorenumber.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/platformcode/autorenumber.py b/platformcode/autorenumber.py index 81dbade3..8d2fd55a 100644 --- a/platformcode/autorenumber.py +++ b/platformcode/autorenumber.py @@ -132,11 +132,12 @@ class autorenumber(): else: self.renumberdict = {} for item in self.itemlist: - item.context = [{"title": typo(config.get_localized_string(70585), 'bold'), - "action": "start", - "channel": "autorenumber", - "from_channel": item.channel, - "from_action": item.action}] + if item.contentType != 'movie': + item.context = [{"title": typo(config.get_localized_string(70585), 'bold'), + "action": "start", + "channel": "autorenumber", + "from_channel": item.channel, + "from_action": item.action}] def config(self): # Pulizia del Titolo From 0e42a8ecb62e683aaa88b4f2ad090666b81cf354 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Wed, 30 Jun 2021 14:52:13 +0200 Subject: [PATCH 053/139] Fix cb01 puntate in cartella esterna e riconoscimento TMDB con anno --- channels/cineblog01.py | 8 ++++---- core/tmdb.py | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/channels/cineblog01.py b/channels/cineblog01.py index 4d79f4d9..fb348a88 100644 --- a/channels/cineblog01.py +++ b/channels/cineblog01.py @@ -135,17 +135,17 @@ def episodios(item): @support.scrape def folder(item, data): """ - Quando c'è un link ad una cartelle di vcrypt contenente più stagioni + Quando c'è un link ad una cartella contenente più stagioni """ actLike = 'episodios' addVideolibrary = False downloadEnabled = False - folderUrl = scrapertools.find_single_match(data, r'TUTTA L[EA] \w+\s+(?:–|-)\s+<a href="?([^" ]+)').replace( - '.net/', '.pw/') # vcrypt.pw non ha CF + folderUrl = scrapertools.find_single_match(data, r'TUTTA L[EA] \w+\s+(?:–|-)\s+<a href="?([^" ]+)') data = httptools.downloadpage(folderUrl, disable_directIP=True).data - patron = r'><a href="(?P<url>[^"]+)[^>]+>(?P<title>[^<]+)' + patron = r'<td>(?P<title>[^<]+)<td><a [^>]+href="(?P<url>[^"]+)[^>]+>' sceneTitle = True + # debug = True def itemHook(item): item.serieFolder = True diff --git a/core/tmdb.py b/core/tmdb.py index 452b4ccf..f709b555 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -128,7 +128,7 @@ def cache_response(fn): result = fn(*args) else: - url = args[0].replace('&year=-', '') + url = args[0].replace('&year=-', '').replace('&primary_release_year=-', '').replace('&first_air_date_year=-', '') # if PY3: url = str.encode(url) row = db['tmdb_cache'].get(url) @@ -1010,7 +1010,11 @@ class Tmdb(object): url = ('{}/search/{}?api_key={}&query={}&language={}&include_adult={}&page={}'.format(host, self.search_type, api, text_quote, self.search_language, True, page)) if self.search_year: - url += '&year=%s' % self.search_year + if self.search_type == 'movie': + url += '&primary_release_year=%s' % self.search_year + else: + url += '&first_air_date_year=%s' % self.search_year + searching = self.search_text.capitalize() logger.debug("[Tmdb.py] Searching %s on page %s:\n%s" % (searching, page, url)) From 86a04bc81c582969686874282012d5121f5da081 Mon Sep 17 00:00:00 2001 From: fatshotty <fat@fatshotty.net> Date: Mon, 28 Jun 2021 15:22:34 +0200 Subject: [PATCH 054/139] wip aniplay --- channels.json | 1 + channels/0example.py.txt | 2 +- channels/aniplay.json | 89 ++++++++++ channels/aniplay.py | 358 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 449 insertions(+), 1 deletion(-) create mode 100644 channels/aniplay.json create mode 100644 channels/aniplay.py diff --git a/channels.json b/channels.json index 95f6309b..85048b23 100644 --- a/channels.json +++ b/channels.json @@ -9,6 +9,7 @@ "animeunity": "https://www.animeunity.it", "animeuniverse": "https://www.animeuniverse.it", "animeworld": "https://www.animeworld.tv", + "aniplay": "https://aniplay.it", "casacinema": "https://www.casacinema.page", "cb01anime": "https://www.cineblog01.red", "cineblog01": "https://cb01.uno", diff --git a/channels/0example.py.txt b/channels/0example.py.txt index e09fca3c..5c520f7d 100644 --- a/channels/0example.py.txt +++ b/channels/0example.py.txt @@ -118,7 +118,7 @@ def mainlist(item): # VOCE CHE APPARIRA' come prima voce nel menu di KOD! # [Voce Menu,['url','action','args',contentType] - top = [ '' ['', '', '', '']) + top = ([ '' ['', '', '', '']) # Se vuoi creare un menu personalizzato o perchè gli altri non # ti soddisfano diff --git a/channels/aniplay.json b/channels/aniplay.json new file mode 100644 index 00000000..81ab99ef --- /dev/null +++ b/channels/aniplay.json @@ -0,0 +1,89 @@ +{ + "id": "aniplay", + "name": "AniPlay", + "language": ["ita"], + "active": true, + "thumbnail": "", + "banner": "", + "categories": ["anime"], + "not_active": ["include_in_newest"], + "settings": [ + { + "id": "include_in_global_search", + "type": "bool", + "label": "@70728", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "include_in_newest_peliculas", + "type": "bool", + "label": "@70727", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "include_in_newest_series", + "type": "bool", + "label": "@70727", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "include_in_newest_anime", + "type": "bool", + "label": "@70727", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "checklinks", + "type": "bool", + "label": "Verifica se i link esistono", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "checklinks_number", + "type": "list", + "label": "Numero di link da verificare", + "default": 2, + "enabled": false, + "visible": "eq(-1,false)", + "lvalues": [ "3", "5", "10", "15", "20" ] + }, + { + "id": "filter_languages", + "type": "list", + "label": "@30019", + "default": 0, + "enabled": false, + "visible": false, + "lvalues": ["Non Filtrare"] + } + ], + + "renumber": [ + { + "id": "autorenumber", + "type": "bool", + "label": "@70712", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "autorenumber_mode", + "type": "bool", + "label": "@70688", + "default": false, + "enabled": false, + "visible": "eq(-1,false)" + } + ] +} \ No newline at end of file diff --git a/channels/aniplay.py b/channels/aniplay.py new file mode 100644 index 00000000..e32352f7 --- /dev/null +++ b/channels/aniplay.py @@ -0,0 +1,358 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Canale per 'aniplay' +# By: fatshotty! +# ringrazio mia mamma +# ------------------------------------------------------------ +# Rev: 0.1 + +# Qui gli import + +# per l'uso dei decoratori, per i log, e funzioni per siti particolari +from core import support, config, tmdb +from datetime import datetime +# in caso di necessità +from core import scrapertools, httptools, jsontools +from core.item import Item + +host = config.get_channel_url() +headers = [['Referer', host]] + + +@support.menu +def mainlist(item): + support.info(item) + + # Voce ANIME, puoi solo impostare l'url + top = [ # url per la voce Anime, se possibile la pagina con titoli di anime + #Voce Menu,['url','action','args',contentType] + ('Lista Anime', ['/ricerca-avanzata', 'alphabetical_strip', '']) + # ('Calendario',['/calendario', 'calendar', '', '']), + # ('News',['/news', 'newest', '', '']), + # ('Anime stagionali',['/anime-stagionali', 'seasonal', '', '']) + ] + + ontop = [ + ('Top di oggi',['/api/home/daily-top', 'toplist', '']), + ('Top della settimana',['/api/home/weekly-top', 'toplist', '']), + ('Top del mese',['/api/home/monthly-top', 'toplist', '']) + ] + + stagionali = ['' , get_seasonal_menu()] + + search = '' + + return locals() + + + +def get_seasonal_menu(): + today = datetime.today() + years = [ + str(today.year), + str(today.year - 1), + str(today.year - 2), + str(today.year - 3) + ] + url = '{}/api/seasonal-view?page=0&size=36&years={}'.format( host, ','.join(years) ) + + jsonDataStr = httptools.downloadpage(url, CF=False ).data + json = jsontools.load( jsonDataStr ) + + seasonal = () + + for year in json: + y = year['year'] + seasons = year['seasonalAnime'] + for season in seasons: + seasonStr = season['season'] + stagione = 'Autunno' + if 'winter' in seasonStr: + stagione = 'Inverno' + elif 'spring' in seasonStr: + stagione = 'Primavera' + elif 'summer' in seasonStr: + stagione = 'Estate' + seasonal = seasonal + ( '{} {} ({})'.format(stagione, str(y) , str(season['animeCount']) ) , ['', 'seasonal', '']) + + return seasonal + +def toplist(item): + pass + + +def seasonal(item): + pass + +# Legenda known_keys per i groups nei patron +# known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality', +# 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang'] +# url = link relativo o assoluto alla pagina titolo film/serie +# title = titolo Film/Serie/Anime/Altro +# title2 = titolo dell'episodio Serie/Anime/Altro +# season = stagione in formato numerico +# episode = numero episodio, in formato numerico. +# thumb = linkrealtivo o assoluto alla locandina Film/Serie/Anime/Altro +# quality = qualità indicata del video +# year = anno in formato numerico (4 cifre) +# duration = durata del Film/Serie/Anime/Altro +# genere = genere del Film/Serie/Anime/Altro. Es: avventura, commedia +# rating = punteggio/voto in formato numerico +# type = tipo del video. Es. movie per film o tvshow per le serie. Di solito sono discrimanti usati dal sito +# lang = lingua del video. Es: ITA, Sub-ITA, Sub, SUB ITA. +# AVVERTENZE: Se il titolo è trovato nella ricerca TMDB/TVDB/Altro allora le locandine e altre info non saranno quelle recuperate nel sito.!!!! +@support.scrape +def peliculas(item): + pass + + + +def alphabetical_strip(item): + # support.dbg() + itemlist = [] + alphabet = ("0-9, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z").split(', ') + for letter in alphabet: + itemlist.append( + item.clone( + title = support.typo(letter, 'bold'), + fulltitle= letter, + show= letter, + letter = letter.upper(), + action= 'alphabetical_letter', + videolibrary= False) + ) + return itemlist + + +def alphabetical_letter(item): + # support.dbg() + page = item.page if item.page else 0 + url = '{}/api/anime/find-by-char?page={}&size=36&character={}&sort=title,asc&sort=id'.format( host, page, item.letter ) + + jsonDataStr = httptools.downloadpage(url, CF=False ).data + json = jsontools.load( jsonDataStr ) + + itemlist = [] + + for it in json: + title = it['title'].split('(')[0].strip() + scrapedlang = scrapertools.find_single_match(it['title'], r'\(([^\)]+)') + lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA' + long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') + + thumb = get_thumbnail(it, 'medium') + + itemlist.append(item.clone(title = long_title, + id= it['id'], + fulltitle = title, + show = title, + contentLanguage = lang, + contentType = 'tvshow' if it['type'] == 'Serie' else 'movie', + contentTitle = title, + contentSerieName = title if it['type'] == 'Serie' else '', + action = 'episodios' if it['type'] == 'Serie' else 'findvideos', + plot = it['storyline'], + year = it['startDate'].split('-')[0], + thumbnail = thumb, + videolibrary= True + )) + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + support.nextPage(itemlist, item.clone(page = page + 1)) + return itemlist + + + +def get_thumbnail(data, key): + """ + " Returns the vertical image as per given key + " possibile values are: + " - small + " - full + " - blurred + " - medium + """ + value = None + verticalImages = data['verticalImages'] + if verticalImages: + first = verticalImages[0] + if first: + value = first[ 'image' + key.capitalize() ] + return value + + + + +def calendar(item): + pass + +def episodios(item): + support.info(item) + + support.dbg() + + itemId = item.id + url = '{}/api/anime/{}'.format(host, itemId) + + jsonDataStr = httptools.downloadpage(url, CF=False ).data + json = jsontools.load( jsonDataStr ) + + itemlist = [] + + episodes = json['episodes'] + + for it in episodes: + title = it['title'] # .split('(')[0].strip() + # scrapedlang = scrapertools.find_single_match(json['title'], r'\(([^\)]+)') + # lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA' + # long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') + + itemlist.append(item.clone(title = title, + id= it['id'], + fulltitle = title, + show = json['title'], + # contentLanguage = lang, + contentType = 'episode', + contentTitle = title, + contentSerieName = json['title'], + action = 'findvideos', + plot = json['storyline'], + year = it['airingDate'].split('-')[0] + )) + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + return itemlist + +# Questa def è utilizzata per generare i menu del canale +# per genere, per anno, per lettera, per qualità ecc ecc +@support.scrape +def genres(item): + support.info(item) + #support.dbg() + + action = '' + blacklist = [''] + patron = r'' + patronBlock = r'' + patronNext = '' + pagination = '' + + #debug = True + return locals() + +############## Fine ordine obbligato +## Def ulteriori + +# per quei casi dove il sito non differenzia film e/o serie e/o anime +# e la ricerca porta i titoli mischiati senza poterli distinguere tra loro +# andranno modificate anche le def peliculas e episodios ove occorre +def select(item): + support.info('select --->', item) + #support.dbg() + data = httptools.downloadpage(item.url, headers=headers).data + # pulizia di data, in caso commentare le prossime 2 righe + data = re.sub('\n|\t', ' ', data) + data = re.sub(r'>\s+<', '> <', data) + block = scrapertools.find_single_match(data, r'') + if re.findall('', data, re.IGNORECASE): + support.info('select = ### è una serie ###') + return episodios(Item(channel=item.channel, + title=item.title, + fulltitle=item.fulltitle, + url=item.url, + args='serie', + contentType='tvshow', + #data1 = data decommentando portiamo data nella def senza doverla riscaricare + )) + +############## Fondo Pagina +# da adattare al canale +def search(item, text): + support.info('search', item) + itemlist = [] + text = text.replace(' ', '+') + item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text) + # bisogna inserire item.contentType per la ricerca globale + # se il canale è solo film, si può omettere, altrimenti bisgona aggiungerlo e discriminare. + item.contentType = item.contentType + try: + return peliculas(item) + # Se captura la excepcion, para no interrumpir al buscador global si un canal falla + except: + import sys + for line in sys.exc_info(): + info('search log:', line) + return [] + + +# da adattare al canale +# inserire newest solo se il sito ha la pagina con le ultime novità/aggiunte +# altrimenti NON inserirlo +def newest(categoria): + support.info('newest ->', categoria) + itemlist = [] + item = Item() + try: + if categoria == 'peliculas': + item.url = host + item.action = 'peliculas' + itemlist = peliculas(item) + + if itemlist[-1].action == 'peliculas': + itemlist.pop() + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.info('newest log: ', {0}.format(line)) + return [] + + return itemlist + +# da adattare... +# consultare il wiki sia per support.server che ha vari parametri, +# sia per i siti con hdpass +#support.server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True) +def findvideos(item): + support.info('findvideos ->', item) + support.dbg() + urlpath = item.contentType + itemId = item.id + + url = '{}/api/{}/{}'.format(host, urlpath, itemId) + + jsonDataStr = httptools.downloadpage(url, CF=False ).data + json = jsontools.load( jsonDataStr ) + + videourl = json['episodeVideo'] + + itemlist = [ + item.clone( + url=videourl, + server='directo' + ) + ] + return support.server(item, itemlist=itemlist) + + + +def make_itemlist(itemlist, item, data): + search = item.search if item.search else '' + infoLabels = {} + for key in data['data']: + if search.lower() in encode(key['title']).lower(): + title = encode(key['title']) + fulltitle=title.split('-')[0].strip() + infoLabels['year'] = key['date_published'] + infoLabels['title'] = fulltitle + if item.contentType != 'movie': infoLabels['tvshowtitle'] = fulltitle + itemlist.append( + item.clone(title = support.typo(title, 'bold'), + fulltitle= title, + show= title, + url= main_host + str(key['show_id']) + '/seasons/', + action= 'findvideos' if item.contentType == 'movie' else 'episodios', + contentType = item.contentType, + contentSerieName= fulltitle if item.contentType != 'movie' else '', + contentTitle= fulltitle if item.contentType == 'movie' else '', + infoLabels=infoLabels, + videolibrary=False)) + return itemlist \ No newline at end of file From d53906a30a95a6c09676fdc105633e0e7939a178 Mon Sep 17 00:00:00 2001 From: fatshotty <fat@fatshotty.net> Date: Mon, 28 Jun 2021 16:12:56 +0200 Subject: [PATCH 055/139] aniplay --- channels/aniplay.py | 115 ++++++++++++++++++++++++++++++++------------ 1 file changed, 83 insertions(+), 32 deletions(-) diff --git a/channels/aniplay.py b/channels/aniplay.py index e32352f7..a0b1e902 100644 --- a/channels/aniplay.py +++ b/channels/aniplay.py @@ -38,7 +38,7 @@ def mainlist(item): ('Top del mese',['/api/home/monthly-top', 'toplist', '']) ] - stagionali = ['' , get_seasonal_menu()] + # stagionali = ['' , get_seasonal_menu()] search = '' @@ -78,7 +78,37 @@ def get_seasonal_menu(): return seasonal def toplist(item): - pass + + url = item.url + jsonDataStr = httptools.downloadpage(url, CF=False ).data + json = jsontools.load( jsonDataStr ) + itemlist = [] + for it in json: + + title = it['animeTitle'].split('(')[0].strip() + scrapedlang = scrapertools.find_single_match(it['animeTitle'], r'\(([^\)]+)') + lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA' + long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') + + + itemlist.append( + item.clone( + id= it['animeId'], + url = 'api/anime/{}'.format(it['animeId']), + title = long_title, + show = title, + contentLanguage = lang, + contentType = 'tvshow', + contentTitle = title, + contentSerieName = title, + action = 'episodios' , + videolibrary= True, + thumbnail= get_thumbnail(it, prop ='animeHorizontalImages' ) + ) + ) + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + return itemlist + def seasonal(item): @@ -121,6 +151,7 @@ def alphabetical_strip(item): action= 'alphabetical_letter', videolibrary= False) ) + return itemlist @@ -144,6 +175,7 @@ def alphabetical_letter(item): itemlist.append(item.clone(title = long_title, id= it['id'], + url = 'api/anime/{}'.format(it['id']), fulltitle = title, show = title, contentLanguage = lang, @@ -162,7 +194,7 @@ def alphabetical_letter(item): -def get_thumbnail(data, key): +def get_thumbnail(data, key = 'medium', prop = 'verticalImages'): """ " Returns the vertical image as per given key " possibile values are: @@ -172,7 +204,7 @@ def get_thumbnail(data, key): " - medium """ value = None - verticalImages = data['verticalImages'] + verticalImages = data[prop] if verticalImages: first = verticalImages[0] if first: @@ -180,45 +212,64 @@ def get_thumbnail(data, key): return value - - -def calendar(item): - pass - def episodios(item): support.info(item) support.dbg() - itemId = item.id - url = '{}/api/anime/{}'.format(host, itemId) + url = '{}/{}'.format(host, item.url) jsonDataStr = httptools.downloadpage(url, CF=False ).data json = jsontools.load( jsonDataStr ) itemlist = [] - episodes = json['episodes'] + if 'seasons' in json and len(json['seasons']) > 0: + seasons = json['seasons'] - for it in episodes: - title = it['title'] # .split('(')[0].strip() - # scrapedlang = scrapertools.find_single_match(json['title'], r'\(([^\)]+)') - # lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA' - # long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') + seasons.sort(key=lambda s: s['episodeStart']) + + for it in seasons: + title = it['name'] # .split('(')[0].strip() + + itemlist.append( + item.clone(title = title, + id= it['id'], + url= 'api/anime/{}/season/{}'.format(it['animeId'], it['id']), + fulltitle = it['name'], + show = json['title'], + contentType = 'season', + contentTitle = title, + contentSerieName = json['title'], + action = 'episodios', + plot = json['storyline'], + year = it['yearStart'] + ) + ) + + elif ('episodes' in json and len(json['episodes']) > 0) or len(json) > 0: + episodes = json['episodes'] if 'episodes' in json else json + + episodes.sort(key=lambda ep: int(ep['episodeNumber'])) + + for it in episodes: + title = it['title'] # .split('(')[0].strip() + + itemlist.append( + item.clone(title = title, + id= it['id'], + url= 'api/episode/{}'.format(it['id']), + fulltitle = title, + # contentLanguage = lang, + contentType = 'episode', + contentTitle = title, + action = 'findvideos', + year = it['airingDate'].split('-')[0] + ) + ) - itemlist.append(item.clone(title = title, - id= it['id'], - fulltitle = title, - show = json['title'], - # contentLanguage = lang, - contentType = 'episode', - contentTitle = title, - contentSerieName = json['title'], - action = 'findvideos', - plot = json['storyline'], - year = it['airingDate'].split('-')[0] - )) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + return itemlist # Questa def è utilizzata per generare i menu del canale @@ -314,10 +365,10 @@ def newest(categoria): def findvideos(item): support.info('findvideos ->', item) support.dbg() - urlpath = item.contentType - itemId = item.id - url = '{}/api/{}/{}'.format(host, urlpath, itemId) + urlpath = item.url + + url = '{}/{}'.format(host, urlpath) jsonDataStr = httptools.downloadpage(url, CF=False ).data json = jsontools.load( jsonDataStr ) From 514ee756e1c8bd99e9ac9167c9ec2691fa3a51ff Mon Sep 17 00:00:00 2001 From: fatshotty <fat@fatshotty.net> Date: Mon, 28 Jun 2021 16:38:24 +0200 Subject: [PATCH 056/139] wip aniplay --- channels/aniplay.py | 75 ++++++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/channels/aniplay.py b/channels/aniplay.py index a0b1e902..e155f405 100644 --- a/channels/aniplay.py +++ b/channels/aniplay.py @@ -252,26 +252,35 @@ def episodios(item): episodes.sort(key=lambda ep: int(ep['episodeNumber'])) - for it in episodes: - title = it['title'] # .split('(')[0].strip() - - itemlist.append( - item.clone(title = title, - id= it['id'], - url= 'api/episode/{}'.format(it['id']), - fulltitle = title, - # contentLanguage = lang, - contentType = 'episode', - contentTitle = title, - action = 'findvideos', - year = it['airingDate'].split('-')[0] - ) - ) + itemlist = build_itemlist_by_episodes(episodes, item) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) return itemlist + + +def build_itemlist_by_episodes(episodes, item): + itemlist = [] + for it in episodes: + title = it['title'] # .split('(')[0].strip() + + itemlist.append( + item.clone(title = title, + id= it['id'], + url= 'api/episode/{}'.format(it['id']), + fulltitle = title, + # contentLanguage = lang, + contentType = 'episode', + contentTitle = title, + action = 'findvideos', + year = it['airingDate'].split('-')[0] + ) + ) + return itemlist + + + # Questa def è utilizzata per generare i menu del canale # per genere, per anno, per lettera, per qualità ecc ecc @support.scrape @@ -319,19 +328,29 @@ def select(item): def search(item, text): support.info('search', item) itemlist = [] - text = text.replace(' ', '+') - item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text) - # bisogna inserire item.contentType per la ricerca globale - # se il canale è solo film, si può omettere, altrimenti bisgona aggiungerlo e discriminare. - item.contentType = item.contentType - try: - return peliculas(item) - # Se captura la excepcion, para no interrumpir al buscador global si un canal falla - except: - import sys - for line in sys.exc_info(): - info('search log:', line) - return [] + # text = text.replace(' ', '%20') + # item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text) + # # bisogna inserire item.contentType per la ricerca globale + # # se il canale è solo film, si può omettere, altrimenti bisgona aggiungerlo e discriminare. + # item.contentType = item.contentType + # try: + # return peliculas(item) + # # Se captura la excepcion, para no interrumpir al buscador global si un canal falla + # except: + # import sys + # for line in sys.exc_info(): + # info('search log:', line) + # return [] + + # https://aniplay.it/api/anime/search?query=lupin + support.dbg() + url = '{}/api/anime/search?query={}'.format(host, text) + + jsonDataStr = httptools.downloadpage(url, CF=False ).data + json = jsontools.load( jsonDataStr ) + + return build_itemlist_by_episodes(json, item) + # da adattare al canale From 8b7450a343d823648112d2587e51f65ac0645b30 Mon Sep 17 00:00:00 2001 From: fatshotty <fat@fatshotty.net> Date: Mon, 28 Jun 2021 19:41:36 +0200 Subject: [PATCH 057/139] fix aniplay --- channels/aniplay.py | 510 ++++++++++++++++---------------------------- 1 file changed, 182 insertions(+), 328 deletions(-) diff --git a/channels/aniplay.py b/channels/aniplay.py index e155f405..e373c454 100644 --- a/channels/aniplay.py +++ b/channels/aniplay.py @@ -1,207 +1,155 @@ -# -*- coding: utf-8 -*- -# ------------------------------------------------------------ -# Canale per 'aniplay' -# By: fatshotty! -# ringrazio mia mamma -# ------------------------------------------------------------ -# Rev: 0.1 - -# Qui gli import - -# per l'uso dei decoratori, per i log, e funzioni per siti particolari -from core import support, config, tmdb -from datetime import datetime -# in caso di necessità -from core import scrapertools, httptools, jsontools -from core.item import Item - -host = config.get_channel_url() -headers = [['Referer', host]] +from platformcode import config +from core import httptools, scrapertools, support, tmdb +host = 'https://aniplay.it' @support.menu def mainlist(item): - support.info(item) - - # Voce ANIME, puoi solo impostare l'url - top = [ # url per la voce Anime, se possibile la pagina con titoli di anime - #Voce Menu,['url','action','args',contentType] - ('Lista Anime', ['/ricerca-avanzata', 'alphabetical_strip', '']) - # ('Calendario',['/calendario', 'calendar', '', '']), - # ('News',['/news', 'newest', '', '']), - # ('Anime stagionali',['/anime-stagionali', 'seasonal', '', '']) - ] - - ontop = [ - ('Top di oggi',['/api/home/daily-top', 'toplist', '']), - ('Top della settimana',['/api/home/weekly-top', 'toplist', '']), - ('Top del mese',['/api/home/monthly-top', 'toplist', '']) + anime=['/api/anime/advanced-search', + ('A-Z', ['/api/anime/advanced-search', 'alphabetical_strip', '']), + ('Anno', ['', 'seasonal_by_year', '']), + ('Top', ['', 'top_items', '']), + ('Ultimi aggiunti', ['', 'latest_added', '']), ] - - # stagionali = ['' , get_seasonal_menu()] - - search = '' - return locals() - - -def get_seasonal_menu(): - today = datetime.today() - years = [ - str(today.year), - str(today.year - 1), - str(today.year - 2), - str(today.year - 3) - ] - url = '{}/api/seasonal-view?page=0&size=36&years={}'.format( host, ','.join(years) ) - - jsonDataStr = httptools.downloadpage(url, CF=False ).data - json = jsontools.load( jsonDataStr ) - - seasonal = () - - for year in json: - y = year['year'] - seasons = year['seasonalAnime'] - for season in seasons: - seasonStr = season['season'] - stagione = 'Autunno' - if 'winter' in seasonStr: - stagione = 'Inverno' - elif 'spring' in seasonStr: - stagione = 'Primavera' - elif 'summer' in seasonStr: - stagione = 'Estate' - seasonal = seasonal + ( '{} {} ({})'.format(stagione, str(y) , str(season['animeCount']) ) , ['', 'seasonal', '']) - - return seasonal - -def toplist(item): - - url = item.url - jsonDataStr = httptools.downloadpage(url, CF=False ).data - json = jsontools.load( jsonDataStr ) - itemlist = [] - for it in json: - - title = it['animeTitle'].split('(')[0].strip() - scrapedlang = scrapertools.find_single_match(it['animeTitle'], r'\(([^\)]+)') - lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA' - long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') - - - itemlist.append( - item.clone( - id= it['animeId'], - url = 'api/anime/{}'.format(it['animeId']), - title = long_title, - show = title, - contentLanguage = lang, - contentType = 'tvshow', - contentTitle = title, - contentSerieName = title, - action = 'episodios' , - videolibrary= True, - thumbnail= get_thumbnail(it, prop ='animeHorizontalImages' ) - ) - ) - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) - return itemlist - - - -def seasonal(item): - pass - -# Legenda known_keys per i groups nei patron -# known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality', -# 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang'] -# url = link relativo o assoluto alla pagina titolo film/serie -# title = titolo Film/Serie/Anime/Altro -# title2 = titolo dell'episodio Serie/Anime/Altro -# season = stagione in formato numerico -# episode = numero episodio, in formato numerico. -# thumb = linkrealtivo o assoluto alla locandina Film/Serie/Anime/Altro -# quality = qualità indicata del video -# year = anno in formato numerico (4 cifre) -# duration = durata del Film/Serie/Anime/Altro -# genere = genere del Film/Serie/Anime/Altro. Es: avventura, commedia -# rating = punteggio/voto in formato numerico -# type = tipo del video. Es. movie per film o tvshow per le serie. Di solito sono discrimanti usati dal sito -# lang = lingua del video. Es: ITA, Sub-ITA, Sub, SUB ITA. -# AVVERTENZE: Se il titolo è trovato nella ricerca TMDB/TVDB/Altro allora le locandine e altre info non saranno quelle recuperate nel sito.!!!! -@support.scrape -def peliculas(item): - pass - - - def alphabetical_strip(item): - # support.dbg() itemlist = [] alphabet = ("0-9, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z").split(', ') for letter in alphabet: itemlist.append( - item.clone( - title = support.typo(letter, 'bold'), - fulltitle= letter, - show= letter, - letter = letter.upper(), - action= 'alphabetical_letter', - videolibrary= False) + item.clone(title = support.typo(letter, 'bold'), + fulltitle= letter, + show= letter, + url= host + '/api/anime/find-by-char', + action= 'peliculas', + videolibrary= False, + variable= '&character=' + letter, + thumbnail=support.thumb('az')) ) - + return itemlist + +def seasonal_by_year(item): + itemlist = [] + from datetime import date + current = date.today().year + first = int(httptools.downloadpage('{}/api/anime/advanced-search?page=0&size=1&sort=startDate,asc&sort=id'.format(host)).json[0]['startDate'].split('-')[0]) -1 + for year in range(current, first, -1): + itemlist.append( + item.clone(title = support.typo(year, 'bold'), + fulltitle= year, + show= year, + action= 'seasonal', + videolibrary= False, + variable= year, + thumbnail=support.thumb('az')) + ) + return itemlist -def alphabetical_letter(item): - # support.dbg() - page = item.page if item.page else 0 - url = '{}/api/anime/find-by-char?page={}&size=36&character={}&sort=title,asc&sort=id'.format( host, page, item.letter ) - - jsonDataStr = httptools.downloadpage(url, CF=False ).data - json = jsontools.load( jsonDataStr ) - +def top_items(item): itemlist = [] - - for it in json: - title = it['title'].split('(')[0].strip() - scrapedlang = scrapertools.find_single_match(it['title'], r'\(([^\)]+)') + links = {'Top del giorno':'daily-top', 'Top della settimana':'weekly-top', 'Top del mese':'monthly-top'} + for label in links: + link = links[ label ] + itemlist.append( + item.clone(title = support.typo(label, 'bold'), + fulltitle= label, + show= label, + action= 'top_of', + videolibrary= False, + variable= link, + ) + ) + return itemlist + + +def seasonal(item): + itemlist = [] + url= '{}/api/seasonal-view?page=0&size=36&years={}'.format(host, item.variable) + js = httptools.downloadpage(url).json[0]['seasonalAnime'] + for season in js: + seasons = {'winter':'Inverno', 'spring':'Primavera', 'summer':'Estate', 'fall':'Autunno'} + s = season['season'].split('.')[-1] + title = seasons[s] + itemlist.append( + item.clone(title=title, + url = '{}/api/seasonal-view/{}-{}'.format(host, s, item.variable), + thumbnail = support.thumb(s), + action = 'peliculas', + variable='' + ) + ) + return itemlist + + +def top_of(item): + itemlist = [] + url= '{}/api/home/{}'.format(host, item.variable) + js = httptools.downloadpage(url).json + for anime in js: + fulltitle = anime['animeTitle'] + title = fulltitle.split('(')[0].strip() + scrapedlang = scrapertools.find_single_match(fulltitle, r'\(([^\)]+)') lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA' long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') - thumb = get_thumbnail(it, 'medium') + itemlist.append( + item.clone(title=long_title, + id=anime['animeId'], + url = '{}/api/anime/{}'.format(host, anime['animeId']), + thumbnail = get_thumbnail(anime, prop='animeHorizontalImages'), + action = 'episodios', + variable=anime['animeId'] + ) + ) - itemlist.append(item.clone(title = long_title, - id= it['id'], - url = 'api/anime/{}'.format(it['id']), - fulltitle = title, - show = title, - contentLanguage = lang, - contentType = 'tvshow' if it['type'] == 'Serie' else 'movie', - contentTitle = title, - contentSerieName = title if it['type'] == 'Serie' else '', - action = 'episodios' if it['type'] == 'Serie' else 'findvideos', - plot = it['storyline'], - year = it['startDate'].split('-')[0], - thumbnail = thumb, - videolibrary= True - )) - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + return itemlist + + +def latest_added(item): + itemlist = [] + page = item.page if item.page else 0 + url= '{}/api/home/latest-episodes?page={}'.format(host, page) + js = httptools.downloadpage(url).json + for episode in js: + fulltitle = episode['title'] + title = fulltitle + quality = episode['fullHd'] + lang = 'FHD' if quality else 'HD' + long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') + itemlist.append( + item.clone( + title=long_title, + animeId = episode['animeId'], + id=episode['id'], + contentType = 'episode', + contentTitle = fulltitle, + contentSerieName = episode['animeTitle'], + animeUrl = '{}/api/anime/{}'.format(host, episode['animeId']), + thumbnail = get_thumbnail(episode, prop='episodeImages'), + action = 'findvideos', + ) + ) support.nextPage(itemlist, item.clone(page = page + 1)) return itemlist - def get_thumbnail(data, key = 'medium', prop = 'verticalImages'): """ - " Returns the vertical image as per given key - " possibile values are: + " Returns the vertical image as per given key and prop + " possibile key values are: " - small " - full " - blurred " - medium + " possibile prop values are: + " - verticalImages + " - animeHorizontalImages + " - animeVerticalImages + " - horizontalImages + " - episodeImages """ value = None verticalImages = data[prop] @@ -212,15 +160,54 @@ def get_thumbnail(data, key = 'medium', prop = 'verticalImages'): return value +def search(item, texto): + support.info(texto) + item.url = host + '/api/anime/advanced-similar-search' + item.variable = '&query=' + texto + + try: + return peliculas(item) + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.logger.error("%s" % line) + return [] + +def peliculas(item): + itemlist = [] + page = item.page if item.page else 0 + js = httptools.downloadpage('{}?page={}&size=36{}&sort=title,asc&sort=id'.format(item.url, page, item.variable)).json + for it in js: + title = it['title'].split('(')[0].strip() + scrapedlang = scrapertools.find_single_match(it['title'], r'\(([^\)]+)') + lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA' + long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') + itemlist.append(item.clone(title = long_title, + fulltitle = title, + show = title, + contentLanguage = lang, + contentType = 'tvshow' if it['type'] == 'Serie' else 'movie', + contentTitle = title, + contentSerieName = title if it['type'] == 'Serie' else '', + action = 'episodios' if it['type'] == 'Serie' else 'findvideos', + plot = it['storyline'], + year = it['startDate'].split('-')[0], + id= it['id'] + )) + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + support.nextPage(itemlist, item.clone(page = page + 1)) + return itemlist + def episodios(item): support.info(item) - support.dbg() + # support.dbg() - url = '{}/{}'.format(host, item.url) + url = '{}/api/anime/{}'.format(host, item.id) - jsonDataStr = httptools.downloadpage(url, CF=False ).data - json = jsontools.load( jsonDataStr ) + json = httptools.downloadpage(url, CF=False ).json + # json = jsontools.load( jsonDataStr ) itemlist = [] @@ -228,19 +215,15 @@ def episodios(item): seasons = json['seasons'] seasons.sort(key=lambda s: s['episodeStart']) - - for it in seasons: + + for i, it in enumerate(seasons): title = it['name'] # .split('(')[0].strip() itemlist.append( item.clone(title = title, - id= it['id'], - url= 'api/anime/{}/season/{}'.format(it['animeId'], it['id']), - fulltitle = it['name'], - show = json['title'], + id= '{}/season/{}'.format(it['animeId'], it['id']), contentType = 'season', - contentTitle = title, - contentSerieName = json['title'], + contentSeason = i, action = 'episodios', plot = json['storyline'], year = it['yearStart'] @@ -251,178 +234,49 @@ def episodios(item): episodes = json['episodes'] if 'episodes' in json else json episodes.sort(key=lambda ep: int(ep['episodeNumber'])) - + itemlist = build_itemlist_by_episodes(episodes, item) - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) - + # tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + return itemlist - - def build_itemlist_by_episodes(episodes, item): itemlist = [] + # support.dbg() for it in episodes: title = it['title'] # .split('(')[0].strip() itemlist.append( - item.clone(title = title, + item.clone(title = '{}x{:02d}. {}'.format(item.contentSeason if item.contentSeason else 1, int(it['episodeNumber']), title), id= it['id'], url= 'api/episode/{}'.format(it['id']), - fulltitle = title, - # contentLanguage = lang, contentType = 'episode', - contentTitle = title, + contentEpisodeNumber = int(it['episodeNumber']), + contentSeason = item.contentSeason if item.contentSeason else 1, action = 'findvideos', year = it['airingDate'].split('-')[0] ) ) return itemlist - - -# Questa def è utilizzata per generare i menu del canale -# per genere, per anno, per lettera, per qualità ecc ecc -@support.scrape -def genres(item): - support.info(item) - #support.dbg() - - action = '' - blacklist = [''] - patron = r'' - patronBlock = r'' - patronNext = '' - pagination = '' - - #debug = True - return locals() - -############## Fine ordine obbligato -## Def ulteriori - -# per quei casi dove il sito non differenzia film e/o serie e/o anime -# e la ricerca porta i titoli mischiati senza poterli distinguere tra loro -# andranno modificate anche le def peliculas e episodios ove occorre -def select(item): - support.info('select --->', item) - #support.dbg() - data = httptools.downloadpage(item.url, headers=headers).data - # pulizia di data, in caso commentare le prossime 2 righe - data = re.sub('\n|\t', ' ', data) - data = re.sub(r'>\s+<', '> <', data) - block = scrapertools.find_single_match(data, r'') - if re.findall('', data, re.IGNORECASE): - support.info('select = ### è una serie ###') - return episodios(Item(channel=item.channel, - title=item.title, - fulltitle=item.fulltitle, - url=item.url, - args='serie', - contentType='tvshow', - #data1 = data decommentando portiamo data nella def senza doverla riscaricare - )) - -############## Fondo Pagina -# da adattare al canale -def search(item, text): - support.info('search', item) - itemlist = [] - # text = text.replace(' ', '%20') - # item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text) - # # bisogna inserire item.contentType per la ricerca globale - # # se il canale è solo film, si può omettere, altrimenti bisgona aggiungerlo e discriminare. - # item.contentType = item.contentType - # try: - # return peliculas(item) - # # Se captura la excepcion, para no interrumpir al buscador global si un canal falla - # except: - # import sys - # for line in sys.exc_info(): - # info('search log:', line) - # return [] - - # https://aniplay.it/api/anime/search?query=lupin - support.dbg() - url = '{}/api/anime/search?query={}'.format(host, text) - - jsonDataStr = httptools.downloadpage(url, CF=False ).data - json = jsontools.load( jsonDataStr ) - - return build_itemlist_by_episodes(json, item) - - - -# da adattare al canale -# inserire newest solo se il sito ha la pagina con le ultime novità/aggiunte -# altrimenti NON inserirlo -def newest(categoria): - support.info('newest ->', categoria) - itemlist = [] - item = Item() - try: - if categoria == 'peliculas': - item.url = host - item.action = 'peliculas' - itemlist = peliculas(item) - - if itemlist[-1].action == 'peliculas': - itemlist.pop() - # Continua la ricerca in caso di errore - except: - import sys - for line in sys.exc_info(): - support.info('newest log: ', {0}.format(line)) - return [] - - return itemlist - -# da adattare... -# consultare il wiki sia per support.server che ha vari parametri, -# sia per i siti con hdpass -#support.server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True) def findvideos(item): - support.info('findvideos ->', item) - support.dbg() + support.info() - urlpath = item.url + url = '{}/api/{}/{}'.format(host, 'episode' if item.contentType == 'episode' else 'anime', item.id) - url = '{}/{}'.format(host, urlpath) + json = httptools.downloadpage(url, CF=False ).json - jsonDataStr = httptools.downloadpage(url, CF=False ).data - json = jsontools.load( jsonDataStr ) + if json.get('episodes', []): + json = httptools.downloadpage('{}/api/episode/{}'.format(host, json['episodes'][0]['id'])).json videourl = json['episodeVideo'] itemlist = [ item.clone( + title=config.get_localized_string(30137), url=videourl, server='directo' ) ] - return support.server(item, itemlist=itemlist) - - - -def make_itemlist(itemlist, item, data): - search = item.search if item.search else '' - infoLabels = {} - for key in data['data']: - if search.lower() in encode(key['title']).lower(): - title = encode(key['title']) - fulltitle=title.split('-')[0].strip() - infoLabels['year'] = key['date_published'] - infoLabels['title'] = fulltitle - if item.contentType != 'movie': infoLabels['tvshowtitle'] = fulltitle - itemlist.append( - item.clone(title = support.typo(title, 'bold'), - fulltitle= title, - show= title, - url= main_host + str(key['show_id']) + '/seasons/', - action= 'findvideos' if item.contentType == 'movie' else 'episodios', - contentType = item.contentType, - contentSerieName= fulltitle if item.contentType != 'movie' else '', - contentTitle= fulltitle if item.contentType == 'movie' else '', - infoLabels=infoLabels, - videolibrary=False)) - return itemlist \ No newline at end of file + return support.server(item, itemlist=itemlist) \ No newline at end of file From 62fd35e9e26049967e621176e593be6bc22cbb2c Mon Sep 17 00:00:00 2001 From: fatshotty <fat@fatshotty.net> Date: Wed, 30 Jun 2021 17:52:16 +0200 Subject: [PATCH 058/139] refactor codes --- channels/aniplay.json | 35 +++- channels/aniplay.py | 445 ++++++++++++++++++++++-------------------- 2 files changed, 267 insertions(+), 213 deletions(-) diff --git a/channels/aniplay.json b/channels/aniplay.json index 81ab99ef..78334d1f 100644 --- a/channels/aniplay.json +++ b/channels/aniplay.json @@ -1,13 +1,38 @@ { "id": "aniplay", "name": "AniPlay", - "language": ["ita"], "active": true, - "thumbnail": "", - "banner": "", - "categories": ["anime"], - "not_active": ["include_in_newest"], + "language": ["ita", "sub-ita"], + "thumbnail": "aniplay.png", + "banner": "aniplay.png", + "categories": ["anime", "vos"], "settings": [ + { + "id": "sort", + "type": "list", + "label": "Ordine di Visualizzazione", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ "Popolarità", "Titolo", "Numero Episodi", "Data di inizio", "Data di fine", "Data di aggiunta"] + }, + { + "id": "order", + "type": "bool", + "label": "Visualizza in ordine Discendente?", + "default": false, + "enabled": true, + "visible": true + }, + { + "id": "perpage", + "type": "list", + "label": "Numero di elementi per pagina", + "default": 1, + "enabled": true, + "visible": true, + "lvalues": ["10", "20", "30", "40", "50", "60", "80", "90"] + }, { "id": "include_in_global_search", "type": "bool", diff --git a/channels/aniplay.py b/channels/aniplay.py index e373c454..fb7a285c 100644 --- a/channels/aniplay.py +++ b/channels/aniplay.py @@ -1,90 +1,78 @@ -from platformcode import config +from platformcode import config, logger, autorenumber from core import httptools, scrapertools, support, tmdb +from inspect import stack + +import sys +if sys.version_info[0] >= 3: + from concurrent import futures +else: + from concurrent_py2 import futures + +host = config.get_channel_url() +sort = ['views', 'title', 'episodeNumber', 'startDate', 'endDate', 'createdDate'][config.get_setting('sort', 'aniplay')] +order = 'desc' if config.get_setting('order', 'aniplay') else 'asc' +perpage = [10, 20, 30 ,40, 50, 60, 70, 80, 90][config.get_setting('perpage', 'aniplay')] -host = 'https://aniplay.it' @support.menu def mainlist(item): anime=['/api/anime/advanced-search', - ('A-Z', ['/api/anime/advanced-search', 'alphabetical_strip', '']), - ('Anno', ['', 'seasonal_by_year', '']), - ('Top', ['', 'top_items', '']), - ('Ultimi aggiunti', ['', 'latest_added', '']), - ] + ('A-Z', ['/api/anime/advanced-search', 'submenu_az', '']), + ('Anno', ['', 'submenu_year', '']), + ('Top', ['', 'submenu_top', '']), + ('Ultimi aggiunti', ['', 'latest_added', ''])] return locals() -def alphabetical_strip(item): + +def submenu_az(item): itemlist = [] - alphabet = ("0-9, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z").split(', ') - for letter in alphabet: - itemlist.append( - item.clone(title = support.typo(letter, 'bold'), - fulltitle= letter, - show= letter, - url= host + '/api/anime/find-by-char', - action= 'peliculas', - videolibrary= False, - variable= '&character=' + letter, - thumbnail=support.thumb('az')) - ) + if item.args == 'az': + for letter in ['0-9'] + list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'): + itemlist.append(item.clone(title = support.typo(letter, 'bold'), + url= host + '/api/anime/find-by-char', + action= 'peliculas', + variable= '&character=' + letter, + thumbnail=support.thumb('az'))) return itemlist -def seasonal_by_year(item): +def submenu_year(item): itemlist = [] from datetime import date current = date.today().year first = int(httptools.downloadpage('{}/api/anime/advanced-search?page=0&size=1&sort=startDate,asc&sort=id'.format(host)).json[0]['startDate'].split('-')[0]) -1 for year in range(current, first, -1): - itemlist.append( - item.clone(title = support.typo(year, 'bold'), - fulltitle= year, - show= year, - action= 'seasonal', - videolibrary= False, - variable= year, - thumbnail=support.thumb('az')) - ) - + itemlist.append(item.clone(title = support.typo(year, 'bold'), + action= 'submenu_season', + variable= year, + thumbnail=support.thumb('year'))) return itemlist - -def top_items(item): +def submenu_top(item): itemlist = [] links = {'Top del giorno':'daily-top', 'Top della settimana':'weekly-top', 'Top del mese':'monthly-top'} for label in links: - link = links[ label ] - itemlist.append( - item.clone(title = support.typo(label, 'bold'), - fulltitle= label, - show= label, - action= 'top_of', - videolibrary= False, - variable= link, - ) - ) + link = links[label] + itemlist.append(item.clone(title = support.typo(label, 'bold'), + action= 'submenu_top_of', + variable= link)) return itemlist - -def seasonal(item): +def submenu_season(item): itemlist = [] + seasons = {'winter':'Inverno', 'spring':'Primavera', 'summer':'Estate', 'fall':'Autunno'} url= '{}/api/seasonal-view?page=0&size=36&years={}'.format(host, item.variable) js = httptools.downloadpage(url).json[0]['seasonalAnime'] for season in js: - seasons = {'winter':'Inverno', 'spring':'Primavera', 'summer':'Estate', 'fall':'Autunno'} s = season['season'].split('.')[-1] title = seasons[s] - itemlist.append( - item.clone(title=title, - url = '{}/api/seasonal-view/{}-{}'.format(host, s, item.variable), - thumbnail = support.thumb(s), - action = 'peliculas', - variable='' - ) - ) + itemlist.append(item.clone(title=title, + url = '{}/api/seasonal-view/{}-{}'.format(host, s, item.variable), + thumbnail = support.thumb(s), + action = 'peliculas', + variable='')) return itemlist - -def top_of(item): +def submenu_top_of(item): itemlist = [] url= '{}/api/home/{}'.format(host, item.variable) js = httptools.downloadpage(url).json @@ -95,48 +83,204 @@ def top_of(item): lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA' long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') - itemlist.append( - item.clone(title=long_title, - id=anime['animeId'], - url = '{}/api/anime/{}'.format(host, anime['animeId']), - thumbnail = get_thumbnail(anime, prop='animeHorizontalImages'), - action = 'episodios', - variable=anime['animeId'] - ) - ) - + itemlist.append(item.clone(title=long_title, + id=anime['animeId'], + url = '{}/api/anime/{}'.format(host, anime['animeId']), + thumbnail = get_thumbnail(anime, 'animeHorizontalImages'), + action = 'episodios', + variable=anime['animeId'])) return itemlist + +def search(item, texto): + support.info(texto) + item.url = host + '/api/anime/advanced-search' + item.variable = '&query=' + texto + + try: + return peliculas(item) + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.logger.error("%s" % line) + return [] + + +def newest(categoria): + support.info(categoria) + item = support.Item() + try: + if categoria == "anime": + return latest_added(item) + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.logger.error("{0}".format(line)) + return [] + + def latest_added(item): itemlist = [] page = item.page if item.page else 0 url= '{}/api/home/latest-episodes?page={}'.format(host, page) js = httptools.downloadpage(url).json + for episode in js: - fulltitle = episode['title'] - title = fulltitle - quality = episode['fullHd'] - lang = 'FHD' if quality else 'HD' - long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') - itemlist.append( - item.clone( - title=long_title, - animeId = episode['animeId'], - id=episode['id'], - contentType = 'episode', - contentTitle = fulltitle, - contentSerieName = episode['animeTitle'], - animeUrl = '{}/api/anime/{}'.format(host, episode['animeId']), - thumbnail = get_thumbnail(episode, prop='episodeImages'), - action = 'findvideos', - ) - ) - support.nextPage(itemlist, item.clone(page = page + 1)) + title = episode['title'] + animeTitle, lang = get_lang(episode['animeTitle']) + quality = 'Full HD' if episode['fullHd'] else 'HD' + long_title = support.typo('{}. {}{}'.format(int(float(episode['episodeNumber'])), title + ' - ' if title else '', animeTitle), 'bold') + support.typo(lang, '_ [] color kod') + support.typo(quality, '_ [] color kod') + image = get_thumbnail(episode, 'episodeImages') + + itemlist.append(item.clone(title=long_title, + fulltitle=title, + animeId = episode['animeId'], + id=episode['id'], + contentType = 'episode', + contentTitle = title, + contentSerieName = animeTitle, + contentLanguage = lang, + quality = quality, + contentEpisodeNumber = int(float(episode['episodeNumber'])), + animeUrl = '{}/api/anime/{}'.format(host, episode['animeId']), + thumbnail = image, + fanart = image, + action = 'findvideos')) + + if stack()[1][3] not in ['newest']: + support.nextPage(itemlist, item.clone(page = page + 1)) + return itemlist -def get_thumbnail(data, key = 'medium', prop = 'verticalImages'): +def peliculas(item): + logger.debug() + + itemlist = [] + page = item.page if item.page else 0 + js = httptools.downloadpage('{}?page={}&size={}{}&sort={},{}&sort=id'.format(item.url, page, perpage, item.variable, sort, order)).json + + for it in js: + title, lang = get_lang(it['title']) + active = False if it['status'] == 'Annunciato' or not it['episodeNumber'] else True + + if active: + long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') + else: + long_title = support.typo(title, 'italic') + support.typo('Annunciato', '_ [] color kod italic') + + itemlist.append(item.clone(title = long_title, + fulltitle = title, + show = title, + contentLanguage = lang, + contentType = 'movie' if it['type'] == 'Movie' else 'tvshow', + contentTitle = title, + contentSerieName = title if it['type'] == 'Serie' else '', + action = '' if not active else 'findvideos' if it['type'] == 'Movie' else 'episodios', + plot = it['storyline'], + year = it['startDate'].split('-')[0], + id= it['id'], + thumbnail = get_thumbnail(it), + fanart = get_thumbnail(it, 'horizontalImages'))) + + autorenumber.start(itemlist) + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + + if len(itemlist) == perpage: + support.nextPage(itemlist, item.clone(page = page + 1)) + return itemlist + + +def episodios(item): + logger.debug() + itemlist = [] + + url = '{}/api/anime/{}'.format(host, item.id) + json = httptools.downloadpage(url, CF=False ).json + + if 'seasons' in json and len(json['seasons']) > 0: + seasons = json['seasons'] + seasons.sort(key=lambda s: s['episodeStart']) + + for i, it in enumerate(seasons): + title = it['name'] + + itemlist.append(item.clone(title = title, + id= '{}/season/{}'.format(it['animeId'], it['id']), + contentType = 'season', + contentSeason = i, + action = 'episodios', + plot = json['storyline'], + year = it['yearStart'])) + + if stack()[1][3] in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']: + itlist = [] + with futures.ThreadPoolExecutor() as executor: + eplist = [executor.submit(episodios, item) for item in itemlist] + for res in futures.as_completed(eplist): + if res.result(): + itlist.extend(res.result()) + itemlist = itlist + + elif ('episodes' in json and len(json['episodes']) > 0) or len(json) > 0: + episodes = json['episodes'] if 'episodes' in json else json + + episodes.sort(key=lambda ep: int(ep['episodeNumber'])) + + for it in episodes: + quality = 'Full HD' if it['fullHd'] else 'HD' + + if item.contentSeason: + episode = '{}x{:02d}'.format(item.contentSeason, int(it['episodeNumber'])) + else: + episode = '{:02d}'.format(int(it['episodeNumber'])) + + title = support.typo('{}. {}'.format(episode, it['title']), 'bold') + image = get_thumbnail(it, 'episodeImages') + + itemlist.append(item.clone(title = title, + id= it['id'], + url= 'api/episode/{}'.format(it['id']), + contentType = 'episode', + contentEpisodeNumber = int(it['episodeNumber']), + contentSeason = item.contentSeason if item.contentSeason else '', + action = 'findvideos', + quality = quality, + thumbnail = image, + fanart= image, + year = it['airingDate'].split('-')[0])) + + if not item.contentSeason and stack()[1][3] not in ['find_episodes']: + autorenumber.start(itemlist, item) + + if stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']: + support.videolibrary(itemlist, item) + return itemlist + + +def findvideos(item): + logger.debug() + + url = '{}/api/{}/{}'.format(host, 'episode' if item.contentType == 'episode' else 'anime', item.id) + + json = httptools.downloadpage(url, CF=False ).json + + if json.get('episodes', []): + json = httptools.downloadpage('{}/api/episode/{}'.format(host, json['episodes'][0]['id'])).json + + videourl = json['episodeVideo'] + + itemlist = [item.clone(title=config.get_localized_string(30137), + url=videourl, + server='directo')] + + return support.server(item, itemlist=itemlist) + + +def get_thumbnail(data, prop = 'verticalImages', key = 'full'): """ " Returns the vertical image as per given key and prop " possibile key values are: @@ -152,131 +296,16 @@ def get_thumbnail(data, key = 'medium', prop = 'verticalImages'): " - episodeImages """ value = None - verticalImages = data[prop] + verticalImages = data.get(prop, []) if verticalImages: first = verticalImages[0] if first: - value = first[ 'image' + key.capitalize() ] + value = first.get('image' + key.capitalize(), '') return value -def search(item, texto): - support.info(texto) - item.url = host + '/api/anime/advanced-similar-search' - item.variable = '&query=' + texto - - try: - return peliculas(item) - # Continua la ricerca in caso di errore - except: - import sys - for line in sys.exc_info(): - support.logger.error("%s" % line) - return [] - -def peliculas(item): - itemlist = [] - page = item.page if item.page else 0 - js = httptools.downloadpage('{}?page={}&size=36{}&sort=title,asc&sort=id'.format(item.url, page, item.variable)).json - for it in js: - title = it['title'].split('(')[0].strip() - scrapedlang = scrapertools.find_single_match(it['title'], r'\(([^\)]+)') - lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA' - long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') - itemlist.append(item.clone(title = long_title, - fulltitle = title, - show = title, - contentLanguage = lang, - contentType = 'tvshow' if it['type'] == 'Serie' else 'movie', - contentTitle = title, - contentSerieName = title if it['type'] == 'Serie' else '', - action = 'episodios' if it['type'] == 'Serie' else 'findvideos', - plot = it['storyline'], - year = it['startDate'].split('-')[0], - id= it['id'] - )) - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) - support.nextPage(itemlist, item.clone(page = page + 1)) - return itemlist - -def episodios(item): - support.info(item) - - # support.dbg() - - url = '{}/api/anime/{}'.format(host, item.id) - - json = httptools.downloadpage(url, CF=False ).json - # json = jsontools.load( jsonDataStr ) - - itemlist = [] - - if 'seasons' in json and len(json['seasons']) > 0: - seasons = json['seasons'] - - seasons.sort(key=lambda s: s['episodeStart']) - - for i, it in enumerate(seasons): - title = it['name'] # .split('(')[0].strip() - - itemlist.append( - item.clone(title = title, - id= '{}/season/{}'.format(it['animeId'], it['id']), - contentType = 'season', - contentSeason = i, - action = 'episodios', - plot = json['storyline'], - year = it['yearStart'] - ) - ) - - elif ('episodes' in json and len(json['episodes']) > 0) or len(json) > 0: - episodes = json['episodes'] if 'episodes' in json else json - - episodes.sort(key=lambda ep: int(ep['episodeNumber'])) - - itemlist = build_itemlist_by_episodes(episodes, item) - - # tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) - - return itemlist - -def build_itemlist_by_episodes(episodes, item): - itemlist = [] - # support.dbg() - for it in episodes: - title = it['title'] # .split('(')[0].strip() - - itemlist.append( - item.clone(title = '{}x{:02d}. {}'.format(item.contentSeason if item.contentSeason else 1, int(it['episodeNumber']), title), - id= it['id'], - url= 'api/episode/{}'.format(it['id']), - contentType = 'episode', - contentEpisodeNumber = int(it['episodeNumber']), - contentSeason = item.contentSeason if item.contentSeason else 1, - action = 'findvideos', - year = it['airingDate'].split('-')[0] - ) - ) - return itemlist - -def findvideos(item): - support.info() - - url = '{}/api/{}/{}'.format(host, 'episode' if item.contentType == 'episode' else 'anime', item.id) - - json = httptools.downloadpage(url, CF=False ).json - - if json.get('episodes', []): - json = httptools.downloadpage('{}/api/episode/{}'.format(host, json['episodes'][0]['id'])).json - - videourl = json['episodeVideo'] - - itemlist = [ - item.clone( - title=config.get_localized_string(30137), - url=videourl, - server='directo' - ) - ] - return support.server(item, itemlist=itemlist) \ No newline at end of file +def get_lang(value): + title = value.split('(')[0] if value else '' + scrapedlang = scrapertools.find_single_match(value, r'\(([^\)]+)') + lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA' + return title, lang \ No newline at end of file From e728947a6e46e944a8cc86c39eab5a713347cbc4 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Thu, 1 Jul 2021 09:23:37 +0200 Subject: [PATCH 059/139] Rimossi settaggi superflui da Aniplay --- channels/aniplay.json | 77 ------------------------------------------- core/item.py | 6 ++-- 2 files changed, 4 insertions(+), 79 deletions(-) diff --git a/channels/aniplay.json b/channels/aniplay.json index 78334d1f..afc23c7b 100644 --- a/channels/aniplay.json +++ b/channels/aniplay.json @@ -32,83 +32,6 @@ "enabled": true, "visible": true, "lvalues": ["10", "20", "30", "40", "50", "60", "80", "90"] - }, - { - "id": "include_in_global_search", - "type": "bool", - "label": "@70728", - "default": false, - "enabled": false, - "visible": false - }, - { - "id": "include_in_newest_peliculas", - "type": "bool", - "label": "@70727", - "default": false, - "enabled": false, - "visible": false - }, - { - "id": "include_in_newest_series", - "type": "bool", - "label": "@70727", - "default": false, - "enabled": false, - "visible": false - }, - { - "id": "include_in_newest_anime", - "type": "bool", - "label": "@70727", - "default": false, - "enabled": false, - "visible": false - }, - { - "id": "checklinks", - "type": "bool", - "label": "Verifica se i link esistono", - "default": false, - "enabled": false, - "visible": false - }, - { - "id": "checklinks_number", - "type": "list", - "label": "Numero di link da verificare", - "default": 2, - "enabled": false, - "visible": "eq(-1,false)", - "lvalues": [ "3", "5", "10", "15", "20" ] - }, - { - "id": "filter_languages", - "type": "list", - "label": "@30019", - "default": 0, - "enabled": false, - "visible": false, - "lvalues": ["Non Filtrare"] - } - ], - - "renumber": [ - { - "id": "autorenumber", - "type": "bool", - "label": "@70712", - "default": false, - "enabled": false, - "visible": false - }, - { - "id": "autorenumber_mode", - "type": "bool", - "label": "@70688", - "default": false, - "enabled": false, - "visible": "eq(-1,false)" } ] } \ No newline at end of file diff --git a/core/item.py b/core/item.py index a2b119e3..0bda66c9 100644 --- a/core/item.py +++ b/core/item.py @@ -150,7 +150,7 @@ class Item(object): for k in kw: if k in ["contentTitle", "contentPlot", "contentSerieName", "show", "contentType", "contentEpisodeTitle", "contentSeason", "contentEpisodeNumber", "contentThumbnail", "plot", "duration", "contentQuality", - "quality"]: + "quality", "year"]: self.__setattr__(k, kw[k]) del kwargs[k] @@ -180,7 +180,7 @@ class Item(object): # By modifying any of these attributes content... if name in ["contentTitle", "contentPlot", "plot", "contentSerieName", "contentType", "contentEpisodeTitle", - "contentSeason", "contentEpisodeNumber", "contentThumbnail", "show", "contentQuality", "quality"]: + "contentSeason", "contentEpisodeNumber", "contentThumbnail", "show", "contentQuality", "quality", "year"]: # ...and update infoLables if name == "contentTitle": self.__dict__["infoLabels"]["title"] = value @@ -200,6 +200,8 @@ class Item(object): self.__dict__["infoLabels"]["thumbnail"] = value elif name == "contentQuality" or name == "quality": self.__dict__["infoLabels"]["quality"] = value + elif name == "year": + self.__dict__["infoLabels"]["year"] = value elif name == "duration": # String q represents the duration of the video in seconds From b561d3708fa2ff8bdf2471adee4b3ab33008de27 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Thu, 1 Jul 2021 10:19:05 +0200 Subject: [PATCH 060/139] Fix Numerazione AniPlay --- channels/aniplay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/aniplay.py b/channels/aniplay.py index fb7a285c..62291bf2 100644 --- a/channels/aniplay.py +++ b/channels/aniplay.py @@ -211,7 +211,7 @@ def episodios(item): itemlist.append(item.clone(title = title, id= '{}/season/{}'.format(it['animeId'], it['id']), contentType = 'season', - contentSeason = i, + contentSeason = i + 1, action = 'episodios', plot = json['storyline'], year = it['yearStart'])) From 333cb14dfaa360d6af59022c9a278a4251fc4258 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 2 Jul 2021 19:41:17 +0200 Subject: [PATCH 061/139] AniPlay Fix Rinumerazione e aggiunta alla videoteca --- channels/aniplay.py | 97 +++++++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 43 deletions(-) diff --git a/channels/aniplay.py b/channels/aniplay.py index 62291bf2..7d362a04 100644 --- a/channels/aniplay.py +++ b/channels/aniplay.py @@ -10,7 +10,7 @@ else: host = config.get_channel_url() sort = ['views', 'title', 'episodeNumber', 'startDate', 'endDate', 'createdDate'][config.get_setting('sort', 'aniplay')] -order = 'desc' if config.get_setting('order', 'aniplay') else 'asc' +order = 'asc' if config.get_setting('order', 'aniplay') else 'desc' perpage = [10, 20, 30 ,40, 50, 60, 70, 80, 90][config.get_setting('perpage', 'aniplay')] @@ -165,12 +165,8 @@ def peliculas(item): for it in js: title, lang = get_lang(it['title']) - active = False if it['status'] == 'Annunciato' or not it['episodeNumber'] else True - if active: - long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') - else: - long_title = support.typo(title, 'italic') + support.typo('Annunciato', '_ [] color kod italic') + long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod') itemlist.append(item.clone(title = long_title, fulltitle = title, @@ -179,7 +175,7 @@ def peliculas(item): contentType = 'movie' if it['type'] == 'Movie' else 'tvshow', contentTitle = title, contentSerieName = title if it['type'] == 'Serie' else '', - action = '' if not active else 'findvideos' if it['type'] == 'Movie' else 'episodios', + action ='findvideos' if it['type'] == 'Movie' else 'episodios',# '' if not active else 'findvideos' if it['type'] == 'Movie' else 'episodios', plot = it['storyline'], year = it['startDate'].split('-')[0], id= it['id'], @@ -205,59 +201,74 @@ def episodios(item): seasons = json['seasons'] seasons.sort(key=lambda s: s['episodeStart']) - for i, it in enumerate(seasons): + for it in seasons: title = it['name'] itemlist.append(item.clone(title = title, id= '{}/season/{}'.format(it['animeId'], it['id']), contentType = 'season', - contentSeason = i + 1, - action = 'episodios', + action = 'list_episodes', plot = json['storyline'], - year = it['yearStart'])) + year = it['yearStart'], + show_renumber = True)) + # If the call come from the videolibrary or autorenumber, shows the episodes if stack()[1][3] in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']: itlist = [] with futures.ThreadPoolExecutor() as executor: - eplist = [executor.submit(episodios, item) for item in itemlist] + eplist = [] + for ep in itemlist: + ep.show_renumber = False + eplist.append(executor.submit(list_episodes, ep)) for res in futures.as_completed(eplist): if res.result(): itlist.extend(res.result()) itemlist = itlist - elif ('episodes' in json and len(json['episodes']) > 0) or len(json) > 0: - episodes = json['episodes'] if 'episodes' in json else json - - episodes.sort(key=lambda ep: int(ep['episodeNumber'])) - - for it in episodes: - quality = 'Full HD' if it['fullHd'] else 'HD' - - if item.contentSeason: - episode = '{}x{:02d}'.format(item.contentSeason, int(it['episodeNumber'])) - else: - episode = '{:02d}'.format(int(it['episodeNumber'])) - - title = support.typo('{}. {}'.format(episode, it['title']), 'bold') - image = get_thumbnail(it, 'episodeImages') - - itemlist.append(item.clone(title = title, - id= it['id'], - url= 'api/episode/{}'.format(it['id']), - contentType = 'episode', - contentEpisodeNumber = int(it['episodeNumber']), - contentSeason = item.contentSeason if item.contentSeason else '', - action = 'findvideos', - quality = quality, - thumbnail = image, - fanart= image, - year = it['airingDate'].split('-')[0])) - - if not item.contentSeason and stack()[1][3] not in ['find_episodes']: + # add renumber option + if stack()[1][3] not in ['find_episodes'] and itemlist and itemlist[0].contentType == 'episode': autorenumber.start(itemlist, item) - if stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']: - support.videolibrary(itemlist, item) + # add add to videolibrary menu + if stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']: + support.videolibrary(itemlist, item) + return itemlist + +def list_episodes(item): + itemlist = [] + + url = '{}/api/anime/{}'.format(host, item.id) + json = httptools.downloadpage(url, CF=False ).json + + episodes = json['episodes'] if 'episodes' in json else json + episodes.sort(key=lambda ep: int(ep['episodeNumber'].split('.')[0])) + + for it in episodes: + quality = 'Full HD' if it['fullHd'] else 'HD' + + if item.contentSeason: + episode = '{}x{:02d}'.format(item.contentSeason, int(it['episodeNumber'].split('.')[0])) + else: + episode = '{:02d}'.format(int(it['episodeNumber'].split('.')[0])) + + title = support.typo('{}. {}'.format(episode, it['title']), 'bold') + image = get_thumbnail(it, 'episodeImages') + + itemlist.append(item.clone(title = title, + id= it['id'], + url= 'api/episode/{}'.format(it['id']), + contentType = 'episode', + contentEpisodeNumber = int(it['episodeNumber'].split('.')[0]), + contentSeason = item.contentSeason if item.contentSeason else '', + action = 'findvideos', + quality = quality, + thumbnail = image, + fanart= image)) + + # Renumber episodes only if shown in the menu + if item.show_renumber: + autorenumber.start(itemlist, item) + return itemlist From 3f08dc88e1c1b4e476b728e62046dcf3efeffa60 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Fri, 2 Jul 2021 17:45:47 +0000 Subject: [PATCH 062/139] {Aggiornamento domini} --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index 85048b23..279b9380 100644 --- a/channels.json +++ b/channels.json @@ -48,6 +48,6 @@ "altadefinizioneclick": "https://altadefinizione-nuovo.click", "animealtadefinizione": "https://www.animealtadefinizione.it", "filmpertutti": "https://filmpertuttiii.nuovo.live", - "seriehd": "https://nuovoindirizzo.info/seriehd" + "seriehd": "https://altadefinizione-nuovo.click" } } \ No newline at end of file From 32ce20c630ca48ebb0c01bd3ab1174317cfe8902 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Sat, 3 Jul 2021 15:23:45 +0200 Subject: [PATCH 063/139] Fix AniPlay --- channels/aniplay.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/channels/aniplay.py b/channels/aniplay.py index 7d362a04..257cfaf8 100644 --- a/channels/aniplay.py +++ b/channels/aniplay.py @@ -197,7 +197,7 @@ def episodios(item): url = '{}/api/anime/{}'.format(host, item.id) json = httptools.downloadpage(url, CF=False ).json - if 'seasons' in json and len(json['seasons']) > 0: + if json.get('seasons'): seasons = json['seasons'] seasons.sort(key=lambda s: s['episodeStart']) @@ -224,21 +224,25 @@ def episodios(item): if res.result(): itlist.extend(res.result()) itemlist = itlist + elif json.get('episodes'): + itemlist = list_episodes(item, json) - # add renumber option - if stack()[1][3] not in ['find_episodes'] and itemlist and itemlist[0].contentType == 'episode': - autorenumber.start(itemlist, item) + # add renumber option + if stack()[1][3] not in ['find_episodes'] and itemlist and itemlist[0].contentType == 'episode': + autorenumber.start(itemlist, item) - # add add to videolibrary menu - if stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']: - support.videolibrary(itemlist, item) - return itemlist + # add add to videolibrary menu + if stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']: + support.videolibrary(itemlist, item) + + return itemlist + -def list_episodes(item): +def list_episodes(item, json=None): itemlist = [] - - url = '{}/api/anime/{}'.format(host, item.id) - json = httptools.downloadpage(url, CF=False ).json + if not json: + url = '{}/api/anime/{}'.format(host, item.id) + json = httptools.downloadpage(url, CF=False ).json episodes = json['episodes'] if 'episodes' in json else json episodes.sort(key=lambda ep: int(ep['episodeNumber'].split('.')[0])) From 07e7c550ae8ca4772e414878b2e2f2080deeeaee Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sun, 4 Jul 2021 14:27:42 +0200 Subject: [PATCH 064/139] altadefinizioneclick: fix referer (mixdrop) --- channels/altadefinizioneclick.py | 8 ++++---- core/support.py | 9 ++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/channels/altadefinizioneclick.py b/channels/altadefinizioneclick.py index 6956348c..d35cb31e 100644 --- a/channels/altadefinizioneclick.py +++ b/channels/altadefinizioneclick.py @@ -138,7 +138,7 @@ def findvideos(item): support.info('findvideos', item) return support.hdpass_get_servers(item) -def play(item): - if 'hdpass' in item.url: - return support.hdpass_get_url(item) - return [item] +# def play(item): +# if 'hdpass' in item.url: +# return support.hdpass_get_url(item) +# return [item] diff --git a/core/support.py b/core/support.py index 09597c50..a99c6c77 100755 --- a/core/support.py +++ b/core/support.py @@ -49,6 +49,7 @@ def hdpass_get_servers(item): url = url.replace("&download=1", "") if 'hdpass' not in url and 'hdplayer' not in url: return itemlist if not url.startswith('http'): url = 'https:' + url + item.referer = url data = httptools.downloadpage(url, CF=False).data patron_res = '<div class="buttons-bar resolutions-bar">(.*?)<div class="buttons-bar' @@ -57,6 +58,11 @@ def hdpass_get_servers(item): res = scrapertools.find_single_match(data, patron_res) + # non threaded for webpdb + # for res_url, res_video in scrapertools.find_multiple_matches(res, patron_option): + # res_url = scrapertools.decodeHtmlentities(res_url) + # itemlist.extend(get_hosts(res_url, res_video)) + # with futures.ThreadPoolExecutor() as executor: thL = [] for res_url, res_video in scrapertools.find_multiple_matches(res, patron_option): @@ -68,8 +74,8 @@ def hdpass_get_servers(item): return server(item, itemlist=itemlist) + def hdpass_get_url(item): - item.referer = item.url data = httptools.downloadpage(item.url, CF=False).data src = scrapertools.find_single_match(data, r'<iframe allowfullscreen custom-src="([^"]+)') if src: item.url = base64.b64decode(src) @@ -77,6 +83,7 @@ def hdpass_get_url(item): item.url, c = unshortenit.unshorten_only(item.url) return [item] + def color(text, color): return "[COLOR " + color + "]" + text + "[/COLOR]" From 65c63fdf8717ddf262bae89366ecae73bb365cb1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Sun, 4 Jul 2021 17:42:40 +0000 Subject: [PATCH 065/139] {Aggiornamento domini} --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index 279b9380..56ea5850 100644 --- a/channels.json +++ b/channels.json @@ -22,7 +22,7 @@ "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", "guardaserieclick": "https://www.guardaserie.support", - "guardaserieicu": "https://guardaserie.catering", + "guardaserieicu": "https://guardaserie.solutions", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", "ilgeniodellostreaming": "https://ilgeniodellostreaming.mba", From 79198b9f0ede921be53f3f488b0fe37ed910883c Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Mon, 5 Jul 2021 20:07:58 +0200 Subject: [PATCH 066/139] - Aggiunte Serie ad Altadefinizione Click - Disattivato Serie HD --- channels/altadefinizioneclick.json | 3 +- channels/altadefinizioneclick.py | 67 ++++++++++++++++++++++++++---- channels/seriehd.json | 2 +- 3 files changed, 62 insertions(+), 10 deletions(-) diff --git a/channels/altadefinizioneclick.json b/channels/altadefinizioneclick.json index ec82baa7..b0c115d9 100644 --- a/channels/altadefinizioneclick.json +++ b/channels/altadefinizioneclick.json @@ -5,6 +5,7 @@ "language": ["ita","sub-ita"], "thumbnail": "altadefinizioneclick.png", "bannermenu": "altadefinizioneciclk.png", - "categories": ["movie","vos"], + "categories": ["tvshow","movie","vos"], + "not_active":["include_in_newest_series"], "settings": [] } diff --git a/channels/altadefinizioneclick.py b/channels/altadefinizioneclick.py index d35cb31e..31676b9c 100644 --- a/channels/altadefinizioneclick.py +++ b/channels/altadefinizioneclick.py @@ -17,6 +17,7 @@ """ +from platformcode.logger import debug from core import support from core.item import Item from platformcode import config @@ -42,28 +43,29 @@ def mainlist(item): ('Mi sento Fortunato',[ '', 'genres', 'lucky']), ('Sub-ITA', ['/sub-ita/', 'peliculas', 'sub']) ] + + tvshow = ['/serie-tv/'] + + search = '' return locals() @support.scrape def peliculas(item): - # debug=True + action = 'check' + patron = r'<div class="wrapperImage">\s*(?:<span class="year">(?P<year>[^<]+)[^>]+>)?(?:<span class="hd">(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)".+?<h2 class="titleFilm">[^>]+>(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?</a>.*?(?:IMDB\:</strong>[ ](?P<rating>.+?)<|</div>)' - # patronBlock = r'h1>(?P<block>.*?)</section' if item.args == 'az': patron = r'<img style="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><a href="(?P<url>[^"]+)" [^>]+>(?P<title>[^<\[]+)(?:\[(?P<lang>[^\]]+)\]\s*)?<'\ r'[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<year>\d{4})[^>]+>[^>]+>\s*(?P<quality>[^<]+).*?<span class="label">(?P<ratting>[^<]+)<' patronBlock ='' - # elif item.args == 'genres': - # patron = r'<div class="wrapperImage">[ ]?(?:<span class="hd">(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)"'\ - # r'.+?<h2 class="titleFilm(?:Mobile)?">[^>]+>(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?(IMDB\:[ ](?P<rating>.+?))<' elif item.args == 'search': patronBlock = r'<section id="lastUpdate">(?P<block>.*?)(?:<div class="row ismobile">|<section)' - patron = r'<a href="(?P<url>[^"]+)">\s*<div class="wrapperImage">(?:\s*<span class="year">(?P<year>[^<]+)<\/span>)?(?:\s*<span class="hd">(?P<quality>[^<]+)<\/span>)?[^>]+>\s*<img[^s]+src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<rating>[^<]+)[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)' + patron = r'<a href="(?P<url>[^"]+)">\s*<div class="wrapperImage">(?:\s*<span class="year">(?P<year>[^<]+)<\/span>)?(?:\s*<span class="hd">(?P<quality>[^<]+)<\/span>)?[^>]+>\s*<img[^s]+src="(?P<thumb>[^"]+)"(?:(?:[^>]+>){5}\s*(?P<rating>[^<]+))?(?:[^>]+>){4}(?P<title>[^<]+)' if not item.args: - patronBlock = r'ULTIMI INSERITI(?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="([^"]+)">' @@ -72,7 +74,6 @@ def peliculas(item): @support.scrape def genres(item): - # debugBlock=True action = 'peliculas' patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<' @@ -134,6 +135,56 @@ def newest(categoria): return itemlist + +def check(item): + def get_season(pageData, seas_url, season): + data = '' + episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches + 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 + data += title + '|' + episode_url + '\n' + return data + + patron_season = '<div class="[^"]+" id="seasonsModal"[^>]+>(.*?)</ul>' + patron_episode = '<div class="[^"]+" id="episodesModal"[^>]+>(.*?)</ul>' + patron_option = r'<a href="([^"]+?)".*?>(?:Stagione |Episodio )([^<]+?)</a>' + + url = support.match(item, patron=r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen').match + seasons = support.match(url, patronBlock=patron_season, patron=patron_option) + if not seasons.match: + item.contentType = 'tvshow' + return findvideos(item) + + data = '' + + import sys + if sys.version_info[0] >= 3: from concurrent import futures + else: from concurrent_py2 import futures + with futures.ThreadPoolExecutor() as executor: + thL = [] + for i, season in enumerate(seasons.matches): + thL.append(executor.submit(get_season, seasons.data if i == 0 else '', season[0], season[1])) + for res in futures.as_completed(thL): + if res.result(): + data += res.result() + item.data = data + return episodios(item) + +@support.scrape +def episodios(item): + data = item.data + + patron = r'(?P<season>\d+)x(?P<episode>\d+)\s*-\s*(?P<title>[^\|]+)\|(?P<url>[^ ]+)' + action = 'findvideos' + + def itemlistHook(itemlist): + itemlist.sort(key=lambda item: (item.infoLabels['season'], item.infoLabels['episode'])) + return itemlist + + return locals() + def findvideos(item): support.info('findvideos', item) return support.hdpass_get_servers(item) diff --git a/channels/seriehd.json b/channels/seriehd.json index eda29eb2..9c7ade33 100644 --- a/channels/seriehd.json +++ b/channels/seriehd.json @@ -1,7 +1,7 @@ { "id": "seriehd", "name": "SerieHD", - "active": true, + "active": false, "language": ["ita"], "thumbnail": "seriehd.png", "banner": "seriehd.png", From 6cca77bcf24a67380ce095b5a6215490dc6fefa4 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Mon, 5 Jul 2021 20:08:41 +0200 Subject: [PATCH 067/139] =?UTF-8?q?=20-=20Aggiungi=20alla=20videoteca=20se?= =?UTF-8?q?=20non=20si=20sa=20se=20=C3=A8=20un=20film=20o=20una=20serie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/tmdb.py | 9 ++++++--- core/videolibrarytools.py | 10 ++++++++++ platformcode/launcher.py | 5 +++++ platformcode/platformtools.py | 3 +++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/core/tmdb.py b/core/tmdb.py index f709b555..6f3222c9 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -410,15 +410,18 @@ def set_infoLabels_item(item, seekTmdb=True, search_language=def_lang, lock=None # do it by title if search_type == 'tv': # Serial search by title and filtering your results if necessary - otmdb = Tmdb(searched_text=scrapertools.unescape(item.infoLabels['tvshowtitle']), search_type=search_type, + searched_title = scrapertools.unescape(item.infoLabels['tvshowtitle']) + searched_title = searched_title.split('-')[0].strip() + otmdb = Tmdb(searched_text=searched_title, search_type=search_type, search_language=search_language, filtro=item.infoLabels.get('filtro', {}), year=item.infoLabels['year']) else: # Movie search by title ... # if item.infoLabels['year'] or item.infoLabels['filtro']: # ...and year or filter - searched_title = item.contentTitle if item.contentTitle else item.fulltitle - otmdb = Tmdb(searched_text=scrapertools.unescape(searched_title), search_type=search_type, search_language=search_language, + searched_title = scrapertools.unescape(item.contentTitle if item.contentTitle else item.fulltitle) + searched_title = searched_title.split('-')[0].strip() + otmdb = Tmdb(searched_text=searched_title, search_type=search_type, search_language=search_language, filtro=item.infoLabels.get('filtro', {}), year=item.infoLabels['year']) if otmdb is not None: if otmdb.get_id() and config.get_setting("tmdb_plus_info", default=False): diff --git a/core/videolibrarytools.py b/core/videolibrarytools.py index 0d793db6..2daf2093 100644 --- a/core/videolibrarytools.py +++ b/core/videolibrarytools.py @@ -949,6 +949,14 @@ def get_local_content(path): return local_episodelist +def add_to_videolibrary(item, channel): + itemlist = getattr(channel, item.from_action)(item) + if itemlist and itemlist[0].contentType == 'episode': + return add_tvshow(item, channel) + else: + return add_movie(item) + + def add_movie(item): """ Keep a movie at the movie library. The movie can be a link within a channel or a previously downloaded video. @@ -966,6 +974,7 @@ def add_movie(item): """ logger.debug() from platformcode.launcher import set_search_temp; set_search_temp(item) + item.contentType = 'movie' # 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 @@ -1012,6 +1021,7 @@ def add_tvshow(item, channel=None): """ logger.debug("show=#" + item.show + "#") + item.contentType = 'tvshow' from platformcode.launcher import set_search_temp; set_search_temp(item) if item.channel == "downloads": diff --git a/platformcode/launcher.py b/platformcode/launcher.py index da9379cc..693bdd67 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -237,6 +237,11 @@ def run(item=None): from core import videolibrarytools videolibrarytools.add_tvshow(item, channel) + # Special action for adding a undefined to the library + elif item.action == "add_to_library": + from core import videolibrarytools + videolibrarytools.add_to_videolibrary(item, channel) + # Special action for downloading all episodes from a serie elif item.action == "download_all_episodes": from specials import downloads diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index c3d8ca30..a3eb98c9 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -621,6 +621,9 @@ def set_context_commands(item, item_url, parent_item, **kwargs): # Add Movie to Video Library elif item.action in ["detail", "findvideos"] and item.contentType == 'movie' and item.contentTitle: context_commands.append((config.get_localized_string(60353), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_pelicula_to_library&from_action=' + item.action))) + # Add to Video Library + elif item.action in ['check'] and item.contentTitle: + context_commands.append((config.get_localized_string(30161), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_to_library&from_action=' + item.action))) if not item.local and item.channel not in ["downloads", "filmontv", "search"] and item.server != 'torrent' and parent_item.action != 'mainlist' and config.get_setting('downloadenabled'): # Download movie From e531962cd9dfb104b1aa7121fbb9cf5ee97ccf2a Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Tue, 6 Jul 2021 17:26:09 +0200 Subject: [PATCH 068/139] Fix streamZ --- servers/streamz.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/servers/streamz.py b/servers/streamz.py index 2615a1a0..1220cdc7 100644 --- a/servers/streamz.py +++ b/servers/streamz.py @@ -4,8 +4,9 @@ # -------------------------------------------------------- import re -from core import httptools +from core import httptools, scrapertools, support from platformcode import logger, config +from lib import jsunpack def test_video_exists(page_url): @@ -21,15 +22,19 @@ def test_video_exists(page_url): def get_video_url(page_url, video_password=""): logger.info("(page_url='%s')" % page_url) video_urls = [] - # real_video = scrapertools.find_single_match(data.data, r"var player = [^\(]+\('(video_\d)") - # packed_data = scrapertools.find_single_match(data.data, r'(eval\(function\(p,a,c,k,e,d\).*?{}[^<]+)'.format(real_video)) - # if packed_data: - # url = scrapertools.find_single_match(jsunpack.unpack(packed_data), r"src:\\'([^'\\]+)") - # url += "|User-Agent=%s" % httptools.get_user_agent() - # video_urls.append([".mp4 [streamZ]", url]) - # else: - url = re.sub(r'(\.\w{2,3})/\w', '\\1/getl1nk-', data.url) + '.dll' - url += "|User-Agent=%s" % httptools.get_user_agent() - video_urls.append([".mp4 [streamZ]", url]) + packed_data = scrapertools.find_multiple_matches(data.data, r'(eval.*?video(\d).*?video_(\d)[^<]+)') + if packed_data: + for p, index, control in packed_data: + if index == control: + try: + url = scrapertools.find_single_match(jsunpack.unpack(p), r"src:\\'([^'\\]+)") + break + except: + pass + + else: + url = re.sub(r'(\.\w{2,3})/\w', '\\1/getl1nk-', data.url) + '.dll' + url += "|Referer=https://streamz.ws/&User-Agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14'" + video_urls.append(["mp4 [streamZ]", url]) return video_urls \ No newline at end of file From 4f322793b1d8bd86f0707dfc6d7884a75b6028d2 Mon Sep 17 00:00:00 2001 From: fatshotty <fat@fatshotty.net> Date: Wed, 7 Jul 2021 16:54:15 +0200 Subject: [PATCH 069/139] Aggiunto Server Streamon * added streamon * fix: use tabber.js in order to retrieve variables * refactor: do not use js2py * remove debugger * remove obsolete js chars and obsolete code. Added comments * removed not used import * use 4 spaces * fix tab space 4 --- servers/streamon.json | 17 ++++++ servers/streamon.py | 124 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 servers/streamon.json create mode 100644 servers/streamon.py diff --git a/servers/streamon.json b/servers/streamon.json new file mode 100644 index 00000000..9dc6792e --- /dev/null +++ b/servers/streamon.json @@ -0,0 +1,17 @@ +{ + "active": true, + "find_videos": { + "ignore_urls": [], + "patterns": [{ + "pattern": "streamon\\.to/d/(\\w+)", + "url": "https://streamon.to/d/\\1" + }] + }, + "free": true, + "id": "streamon", + "name": "streamon", + "premium": [ + ], + "settings": [ + ] +} diff --git a/servers/streamon.py b/servers/streamon.py new file mode 100644 index 00000000..39fd2171 --- /dev/null +++ b/servers/streamon.py @@ -0,0 +1,124 @@ +# -*- coding: utf-8 -*- +from core import httptools, scrapertools, config +import base64 +import math +import re + +files = None + +def test_video_exists(page_url): + + global htmldata + htmldata = httptools.downloadpage(page_url).data + + if 'Oops! video not found' in htmldata: + return False, config.get_localized_string(70449) % "Streamon" + else: + return True, "" + + +def get_video_url(page_url, premium=False, user="", password="", video_password=""): + + tabbler = httptools.downloadpage('https://streamon.to/assets/js/tabber.js').data + params_tabber = scrapertools.find_single_match(tabbler, r'\}\(([^\)]+)') + + + params_tabber_decoder = params_tabber.split(',') + decoded_tabler = eval_fn( + params_tabber_decoder[0].replace('"', ''), + int(params_tabber_decoder[1]), + params_tabber_decoder[2].replace('"', ''), + int(params_tabber_decoder[3]), + int(params_tabber_decoder[4]), + int(params_tabber_decoder[5]) + ) + + decoder = scrapertools.find_single_match(decoded_tabler, r'var res = ([a-z]{12})\.replace\("([^"]+)[^\.]+\.replace\("([^"]+)') + + params_from_page = scrapertools.find_single_match(htmldata, '<script\s+?type=[\'|"].*?[\'|"]>\s?var.*?\}\((.*?)\)\)<\/script>') + + params_from_page_decoder = params_from_page.split(',') + + first_decoder_fn = eval_fn( + params_from_page_decoder[0].replace('"', ''), + int(params_from_page_decoder[1]), + params_from_page_decoder[2].replace('"', ''), + int(params_from_page_decoder[3]), + int(params_from_page_decoder[4]), + int(params_from_page_decoder[5]) + ) + + variable_value = scrapertools.find_single_match(first_decoder_fn, 'var {}="([^"]+)"'.format(decoder[0])) + + res = variable_value.replace(decoder[1], "") + res2 = res.replace(decoder[2], "") + media_url = base64.b64decode( res2 ).decode('ascii') + + video_urls = [] + + video_urls.append([scrapertools.get_filename_from_url(media_url)[-4:] + " [Streamon]", media_url]) + + return video_urls + + + + +""" +" I don't know what following lines do. Maybe neither God knows... +" but they seem to be working :) +""" + +def loop_reduce(lst, h, e): + """ + " Simulate the Array.reduce functionality + """ + acc = 0 + for index, val in enumerate(lst): + indexOf = h.find(val) + if indexOf > -1: + pow = int(math.pow(e, index)) + acc = acc + indexOf * pow + + return acc + + +def decrypt_string(d, e, f): + """ + " Decrypt char-sequence from given key + """ + g = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/' + + h = g[0 : e] + i = g[0 : f] + + j = loop_reduce(list(d)[::-1], h, e) + k = '' + while j > 0: + j = int(j) + k = i[j % f] + k + j = (j - (j % f)) / f + + return k or '' + + + +def eval_fn(h, u, n, t, e, r): + """ + " Extract decrypter key and convert decrypted string into a ASCII string + """ + r = "" + i = -1 + while i < len(h) - 1: + i = i + 1 + s = '' + while h[i] != n[e]: + s += h[i] + i = i + 1 + for j in range(0, len(n)): + reg = re.compile(n[j]) + s = re.sub(reg, str(j), s) + + res = decrypt_string(s, e, 10) + r += chr( int( res ) - t ) + + return r \ No newline at end of file From 846ac879fdbc94e79fcf7f3800482ed569eda536 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Wed, 7 Jul 2021 17:18:06 +0200 Subject: [PATCH 070/139] Corretton nome Streamon --- servers/streamon.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/streamon.json b/servers/streamon.json index 9dc6792e..3dd54d9a 100644 --- a/servers/streamon.json +++ b/servers/streamon.json @@ -9,7 +9,7 @@ }, "free": true, "id": "streamon", - "name": "streamon", + "name": "Streamon", "premium": [ ], "settings": [ From 4c82dbdc2d310272e3e5ab5afc00c8fd326e4c95 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Wed, 7 Jul 2021 17:51:30 +0000 Subject: [PATCH 071/139] {Aggiornamento domini} --- channels.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/channels.json b/channels.json index 56ea5850..fce0a5a8 100644 --- a/channels.json +++ b/channels.json @@ -18,7 +18,7 @@ "discoveryplus": "https://www.discoveryplus.com", "dreamsub": "https://dreamsub.stream", "dsda": "https://www.dsda.press", - "eurostreaming": "https://eurostreaming.rocks", + "eurostreaming": "https://eurostreaming.bar", "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", "guardaserieclick": "https://www.guardaserie.support", @@ -27,7 +27,7 @@ "ilcorsaronero": "https://ilcorsaronero.link", "ilgeniodellostreaming": "https://ilgeniodellostreaming.mba", "ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.city", - "italiaserie": "https://italiaserie.buzz", + "italiaserie": "https://italiaserie.city", "mediasetplay": "https://www.mediasetplay.mediaset.it", "mondoserietv": "https://mondoserietv.club", "paramount": "https://www.paramountnetwork.it", @@ -37,7 +37,7 @@ "serietvonline": "https://serietvonline.art", "serietvsubita": "http://serietvsubita.xyz", "serietvu": "https://www.serietvu.live", - "streamingcommunity": "https://streamingcommunity.tv", + "streamingcommunity": "https://streamingcommunity.work", "streamtime": "https://t.me/s/StreamTime", "tantifilm": "https://www.tantifilm.in", "tapmovie": "https://it.tapmovie.net", From 0b52bd671a0433bd77a3b6c5af390983954c6b6b Mon Sep 17 00:00:00 2001 From: Enrico Da Rodda <enricodarodda@hotmail.it> Date: Wed, 7 Jul 2021 23:33:18 +0200 Subject: [PATCH 072/139] attempt fix sort_servers --- core/servertools.py | 57 ++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/core/servertools.py b/core/servertools.py index dfb32f43..d2bc7bf1 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -670,7 +670,7 @@ def sort_servers(servers_list): """ If the option "Order servers" is activated in the server configuration and there is a list of servers favorites in settings use it to sort the servers_list list - :param servers_list: List of servers to order. The items in the servers_list can be strings or Item objects. In which case it is necessary that they have an item.server attribute of type str. + :param servers_list: List of servers to order. The items in the servers_list can be strings or Item objects. In both cases it is necessary to have an item.server attribute of type str. :return: List of the same type of objects as servers_list ordered according to the favorite servers. """ def index(lst, value): @@ -696,18 +696,19 @@ def sort_servers(servers_list): sorted_list = [] url_list_valid = [] - favorite_quality = [] + favorite_quality = [quality_list.reverse() if config.get_setting('default_action') == 1 else quality_list] # Priorities when ordering itemlist: - # 0: Servers and qualities - # 1: Servers only - # 2: Only qualities - # 3: Do not order + # 0: Servers and Qualities + # 1: Qualities and Servers + # 2: Servers only + # 3: Only qualities + # 4: Do not order if config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and not config.get_setting('quality_priority'): - priority = 0 # 0: Servers and qualities + priority = 0 # 0: Servers and Qualities elif config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and config.get_setting('quality_priority'): - priority = 1 # 0: Servers and qualities + priority = 1 # 0: Qualities and Servers elif config.get_setting('favorites_servers') and favorite_servers: priority = 2 # Servers only elif config.get_setting('default_action'): @@ -715,9 +716,7 @@ def sort_servers(servers_list): else: priority = 4 # Do not order - if config.get_setting('default_action') == 1: - quality_list.reverse() - favorite_quality = quality_list + for item in servers_list: element = dict() @@ -729,19 +728,19 @@ def sort_servers(servers_list): continue - if priority < 2: # 0: Servers and qualities or 1: Qualities and servers - element["indice_server"] = index(favorite_servers, item.server.lower()) - element["indice_quality"] = index(favorite_quality, item.quality.lower()) + # if priority < 2: # 0: Servers and qualities or 1: Qualities and servers + element["indice_server"] = index(favorite_servers, item.server.lower()) + element["indice_quality"] = index(favorite_quality, item.quality.lower()) - elif priority == 2: # Servers only - element["indice_server"] = index(favorite_servers, item.server.lower()) + # elif priority == 2: # Servers only + # element["indice_server"] = index(favorite_servers, item.server.lower()) - elif priority == 3: # Only qualities - element["indice_quality"] = index(favorite_quality, item.quality.lower()) + # elif priority == 3: # Only qualities + # element["indice_quality"] = index(favorite_quality, item.quality.lower()) - else: # Do not order - if item.url in url_list_valid: - continue + # else: # Do not order + # if item.url in url_list_valid: + # continue element['indice_language'] = 0 if item.contentLanguage == 'ITA' else 1 @@ -749,11 +748,17 @@ def sort_servers(servers_list): sorted_list.append(element) # We order according to priority - if priority == 0: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_server'], orden['indice_quality'])) # Servers and qualities - elif priority == 1: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_quality'], orden['indice_server'])) # Servers and qualities - elif priority == 2: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_server'])) # Servers only - elif priority == 3: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_quality'])) # Only qualities - else: sorted_list.sort(key=lambda orden: orden['indice_language']) + # if priority == 0: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_server'], orden['indice_quality'])) # Servers and Qualities + # elif priority == 1: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_quality'], orden['indice_server'])) # Qualities and Servers + # elif priority == 2: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_server'])) # Servers only + # elif priority == 3: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_quality'])) # Only qualities + # else: sorted_list.sort(key=lambda orden: orden['indice_language']) + + if priority == 0: sorted_list.sort(key=lambda row: (row['indice_language'], row['indice_server'], row['indice_quality'])) # Servers and Qualities + elif priority == 1: sorted_list.sort(key=lambda row: (row['indice_language'], row['indice_quality'], row['indice_server'])) # Qualities and Servers + elif priority == 2: sorted_list.sort(key=lambda row: (row['indice_language'], row['indice_server'])) # Servers only + elif priority == 3: sorted_list.sort(key=lambda row: (row['indice_language'], row['indice_quality'])) # Only qualities + else: sorted_list.sort(key=lambda row: row['indice_language']) return [v['videoitem'] for v in sorted_list if v] From d7918418a2ac0e82f0d2f68ef5ed3bc9fa8a9831 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Thu, 8 Jul 2021 09:03:35 +0200 Subject: [PATCH 073/139] Fix AniPlay --- channels/aniplay.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/channels/aniplay.py b/channels/aniplay.py index 257cfaf8..9215f738 100644 --- a/channels/aniplay.py +++ b/channels/aniplay.py @@ -197,7 +197,11 @@ def episodios(item): url = '{}/api/anime/{}'.format(host, item.id) json = httptools.downloadpage(url, CF=False ).json - if json.get('seasons'): + if type(json) == list: + item.show_renumber = False + itemlist = list_episodes(item, json) + + elif json.get('seasons'): seasons = json['seasons'] seasons.sort(key=lambda s: s['episodeStart']) @@ -234,12 +238,13 @@ def episodios(item): # add add to videolibrary menu if stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']: support.videolibrary(itemlist, item) - + return itemlist - + def list_episodes(item, json=None): itemlist = [] + if not json: url = '{}/api/anime/{}'.format(host, item.id) json = httptools.downloadpage(url, CF=False ).json @@ -323,4 +328,4 @@ def get_lang(value): title = value.split('(')[0] if value else '' scrapedlang = scrapertools.find_single_match(value, r'\(([^\)]+)') lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA' - return title, lang \ No newline at end of file + return title, lang From 79781333ef7250e270aee32d42a2fa4e8e3e5dc2 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Thu, 8 Jul 2021 15:38:30 +0200 Subject: [PATCH 074/139] Riabilitato SerieHD --- channels.json | 6 +++--- channels/seriehd.json | 2 +- channels/seriehd.py | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/channels.json b/channels.json index fce0a5a8..df7e4136 100644 --- a/channels.json +++ b/channels.json @@ -42,12 +42,12 @@ "tantifilm": "https://www.tantifilm.in", "tapmovie": "https://it.tapmovie.net", "toonitalia": "https://toonitalia.co", - "vvvvid": "https://www.vvvvid.it" + "vvvvid": "https://www.vvvvid.it", + "seriehd": "https://seriehd.cam" }, "findhost": { "altadefinizioneclick": "https://altadefinizione-nuovo.click", "animealtadefinizione": "https://www.animealtadefinizione.it", - "filmpertutti": "https://filmpertuttiii.nuovo.live", - "seriehd": "https://altadefinizione-nuovo.click" + "filmpertutti": "https://filmpertuttiii.nuovo.live" } } \ No newline at end of file diff --git a/channels/seriehd.json b/channels/seriehd.json index 9c7ade33..eda29eb2 100644 --- a/channels/seriehd.json +++ b/channels/seriehd.json @@ -1,7 +1,7 @@ { "id": "seriehd", "name": "SerieHD", - "active": false, + "active": true, "language": ["ita"], "thumbnail": "seriehd.png", "banner": "seriehd.png", diff --git a/channels/seriehd.py b/channels/seriehd.py index 34294b76..8aba8a60 100644 --- a/channels/seriehd.py +++ b/channels/seriehd.py @@ -8,7 +8,7 @@ from core import support def findhost(url): return support.match(url, patron=r'<h2[^>]+><a href="([^"]+)"').match -host = support.config.get_channel_url(findhost) +host = support.config.get_channel_url() headers = [['Referer', host]] @@ -17,10 +17,10 @@ def mainlist(item): tvshow = [('Genere', ['', 'menu', 'genre']), ('A-Z', ['', 'menu', 'a-z']), - ('In Corso', ['category/serie-tv-streaming/serie-in-corso', 'peliculas']), - ('Complete', ['category/serie-tv-streaming/serie-complete', 'peliculas']), - ('Americane', ['category/serie-tv-streaming/serie-tv-americane', 'peliculas']), - ('Italiane', ['category/serie-tv-streaming/serie-tv-italiane', 'peliculas']), + ('In Corso', ['/category/serie-tv-streaming/serie-in-corso', 'peliculas']), + ('Complete', ['/category/serie-tv-streaming/serie-complete', 'peliculas']), + ('Americane', ['/category/serie-tv-streaming/serie-tv-americane', 'peliculas']), + ('Italiane', ['/category/serie-tv-streaming/serie-tv-italiane', 'peliculas']), ('Ultimi Episodi', ['/aggiornamenti', 'peliculas', 'last']), ('Evidenza', ['', 'peliculas', 'best'])] return locals() From 30e4fa0261ea141da8d84c65221ecb7aec1d7ee5 Mon Sep 17 00:00:00 2001 From: Enrico Da Rodda <enricodarodda@hotmail.it> Date: Thu, 8 Jul 2021 18:27:25 +0200 Subject: [PATCH 075/139] Fix casacinema e altadefinizioneclick --- channels/altadefinizioneclick.py | 3 ++- channels/casacinema.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/channels/altadefinizioneclick.py b/channels/altadefinizioneclick.py index 31676b9c..6115f687 100644 --- a/channels/altadefinizioneclick.py +++ b/channels/altadefinizioneclick.py @@ -65,7 +65,8 @@ def peliculas(item): patron = r'<a href="(?P<url>[^"]+)">\s*<div class="wrapperImage">(?:\s*<span class="year">(?P<year>[^<]+)<\/span>)?(?:\s*<span class="hd">(?P<quality>[^<]+)<\/span>)?[^>]+>\s*<img[^s]+src="(?P<thumb>[^"]+)"(?:(?:[^>]+>){5}\s*(?P<rating>[^<]+))?(?:[^>]+>){4}(?P<title>[^<]+)' if not item.args: - patronBlock = r'(?:ULTIMI INSERITI|Serie TV)(?P<block>.*?)</section' + # patronBlock = r'(?:ULTIMI INSERITI|Serie TV)(?P<block>.*?)</section' + patronBlock = r'({})(?P<block>.*?)</section'.format('ULTIMI INSERITI' if item.contentType == 'movie' else 'Serie TV') # nella pagina "CERCA", la voce "SUCCESSIVO" apre la maschera di inserimento dati patronNext = r'<a class="next page-numbers" href="([^"]+)">' diff --git a/channels/casacinema.py b/channels/casacinema.py index 9ecd7cea..73aa5576 100644 --- a/channels/casacinema.py +++ b/channels/casacinema.py @@ -106,7 +106,8 @@ def peliculas(item): if item.args == 'newest': patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?:\[(?P<quality1>HD)\])?[ ]?(?:\(|\[)?(?P<lang>[sS]ub-[iI][tT][aA])?(?:\)|\])?[ ]?(?:\[(?P<quality>.+?)\])?[ ]?(?:\((?P<year>\d+)\))?<(?:[^>]+>.+?(?:title="Nuovi episodi">(?P<episode>\d+x\d+)[ ]?(?P<lang2>Sub-Ita)?|title="IMDb">(?P<rating>[^<]+)))?' else: - patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?:\[(?P<quality1>HD)\])?\s?(?:[\(\[])?(?P<lang>[sS]ub-[iI][tT][aA])?(?:[\)\]])?\s?(?:\[(?P<quality>.+?)\])?\s?(?:\((?P<year>\d+)\))?<' + # patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?:\[(?P<quality1>HD)\])?\s?(?:[\(\[])?(?P<lang>[sS]ub-[iI][tT][aA])?(?:[\)\]])?\s?(?:\[(?P<quality>.+?)\])?\s?(?:\((?P<year>\d+)\))?<' + patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?P<title2>\([\D*]+\))?(?:\[(?P<quality1>HD)\])?\s?(?:[\(\[])?(?P<lang>[sS]ub-[iI][tT][aA])?(?:[\)\]])?\s?(?:\[(?P<quality>.+?)\])?\s?(?:\((?P<year>\d+)\))?<' patronNext = r'<a href="([^"]+)"\s*>Pagina' # debug = True From e7d5a98c4e9745567fb157b11e892b1899bcdbc0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Thu, 8 Jul 2021 17:48:36 +0000 Subject: [PATCH 076/139] {Aggiornamento domini} --- channels.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/channels.json b/channels.json index df7e4136..a88891c7 100644 --- a/channels.json +++ b/channels.json @@ -13,7 +13,7 @@ "casacinema": "https://www.casacinema.page", "cb01anime": "https://www.cineblog01.red", "cineblog01": "https://cb01.uno", - "cinemalibero": "https://cinemalibero.biz", + "cinemalibero": "https://cinemalibero.quest", "cinetecadibologna": "http://cinestore.cinetecadibologna.it", "discoveryplus": "https://www.discoveryplus.com", "dreamsub": "https://dreamsub.stream", @@ -34,6 +34,7 @@ "piratestreaming": "https://www.piratestreaming.shop", "polpotv": "https://roma.polpo.tv", "raiplay": "https://www.raiplay.it", + "seriehd": "https://seriehd.cam", "serietvonline": "https://serietvonline.art", "serietvsubita": "http://serietvsubita.xyz", "serietvu": "https://www.serietvu.live", @@ -42,8 +43,7 @@ "tantifilm": "https://www.tantifilm.in", "tapmovie": "https://it.tapmovie.net", "toonitalia": "https://toonitalia.co", - "vvvvid": "https://www.vvvvid.it", - "seriehd": "https://seriehd.cam" + "vvvvid": "https://www.vvvvid.it" }, "findhost": { "altadefinizioneclick": "https://altadefinizione-nuovo.click", From 2c852fd826d9fe689b1da40e271be9bb496970a5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Fri, 9 Jul 2021 17:45:06 +0000 Subject: [PATCH 077/139] {Aggiornamento domini} --- channels.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channels.json b/channels.json index a88891c7..bf68db31 100644 --- a/channels.json +++ b/channels.json @@ -22,7 +22,7 @@ "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", "guardaserieclick": "https://www.guardaserie.support", - "guardaserieicu": "https://guardaserie.solutions", + "guardaserieicu": "https://guardaserie.quest", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", "ilgeniodellostreaming": "https://ilgeniodellostreaming.mba", @@ -40,7 +40,7 @@ "serietvu": "https://www.serietvu.live", "streamingcommunity": "https://streamingcommunity.work", "streamtime": "https://t.me/s/StreamTime", - "tantifilm": "https://www.tantifilm.in", + "tantifilm": "https://www.tantifilm.bond", "tapmovie": "https://it.tapmovie.net", "toonitalia": "https://toonitalia.co", "vvvvid": "https://www.vvvvid.it" From d3bde5dd5196981f14d3c458e5dbe32013dd83a3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Sat, 10 Jul 2021 17:42:53 +0000 Subject: [PATCH 078/139] {Aggiornamento domini} --- channels.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channels.json b/channels.json index bf68db31..da489eb8 100644 --- a/channels.json +++ b/channels.json @@ -21,7 +21,7 @@ "eurostreaming": "https://eurostreaming.bar", "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", - "guardaserieclick": "https://www.guardaserie.support", + "guardaserieclick": "https://www.guardaserie.services", "guardaserieicu": "https://guardaserie.quest", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", @@ -31,7 +31,7 @@ "mediasetplay": "https://www.mediasetplay.mediaset.it", "mondoserietv": "https://mondoserietv.club", "paramount": "https://www.paramountnetwork.it", - "piratestreaming": "https://www.piratestreaming.shop", + "piratestreaming": "https://www.piratestreaming.design", "polpotv": "https://roma.polpo.tv", "raiplay": "https://www.raiplay.it", "seriehd": "https://seriehd.cam", From 3950ad91ef5a31a11772bc616396b1a1ecebb9bc Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Tue, 13 Jul 2021 15:57:46 +0200 Subject: [PATCH 079/139] Fix Trakt --- core/trakt_tools.py | 8 ++++---- specials/tvmoviedb.py | 13 ++++++++++--- specials/videolibrary.py | 5 ++++- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/core/trakt_tools.py b/core/trakt_tools.py index f1fb8aca..bf00588a 100644 --- a/core/trakt_tools.py +++ b/core/trakt_tools.py @@ -26,7 +26,7 @@ def auth_trakt(): post = {'client_id': client_id} post = jsontools.dump(post) # Se solicita url y código de verificación para conceder permiso a la app - url = "http://api-v2launch.trakt.tv/oauth/device/code" + url = "http://api.trakt.tv/oauth/device/code" data = httptools.downloadpage(url, post=post, headers=headers).data data = jsontools.load(data) item.verify_url = data["verification_url"] @@ -57,14 +57,14 @@ def token_trakt(item): try: if item.extra == "renew": refresh = config.get_setting("refresh_token_trakt", "trakt") - url = "http://api-v2launch.trakt.tv/oauth/device/token" + url = "http://api.trakt.tv/oauth/device/token" post = {'refresh_token': refresh, 'client_id': client_id, 'client_secret': client_secret, 'redirect_uri': 'urn:ietf:wg:oauth:2.0:oob', 'grant_type': 'refresh_token'} post = jsontools.dump(post) data = httptools.downloadpage(url, post=post, headers=headers).data data = jsontools.load(data) elif item.action == "token_trakt": - url = "http://api-v2launch.trakt.tv/oauth/device/token" + url = "http://api.trakt.tv/oauth/device/token" post = "code=%s&client_id=%s&client_secret=%s" % (item.device_code, client_id, client_secret) data = httptools.downloadpage(url, post=post, headers=headers).data data = jsontools.load(data) @@ -83,7 +83,7 @@ def token_trakt(item): config.set_setting("trakt_sync", False) return - url = "http://api-v2launch.trakt.tv/oauth/device/token" + url = "http://api.trakt.tv/oauth/device/token" post = {'code': item.device_code, 'client_id': client_id, 'client_secret': client_secret} post = jsontools.dump(post) data = httptools.downloadpage(url, post=post, headers=headers).data diff --git a/specials/tvmoviedb.py b/specials/tvmoviedb.py index 8861e2fe..d2a2a142 100644 --- a/specials/tvmoviedb.py +++ b/specials/tvmoviedb.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import re from core import filetools, jsontools, trakt_tools +from core import support from core.tmdb import Tmdb from core.scrapertools import htmlclean, decodeHtmlentities from core.support import thumb, typo, match, Item @@ -1910,7 +1911,7 @@ def acciones_trakt(item): post = None if item.post: post = jsontools.dump(item.post) - url = "http://api-v2launch.trakt.tv/%s" % item.url + url = "http://api.trakt.tv/%s" % item.url data = httptools.downloadpage(url, post=post, headers=headers) if data.code == "401": trakt_tools.token_trakt(item.clone(args="renew")) @@ -1966,14 +1967,20 @@ def acciones_trakt(item): # try: entry = entry[item.args] # except: pass new_item = item.clone(action="details") - if 'show' in entry or 'show' in item.args: + if 'show' in entry and 'show' in item.args: entry = entry['show'] new_item.args = 'show' new_item.contentType = 'tvshow' - else: + elif 'movie' in entry and 'movie' in item.args: entry = entry['movie'] new_item.args = 'movie' new_item.contentType = 'movie' + elif 'show' in item.args: + new_item.args = 'show' + new_item.contentType = 'tvshow' + else: + new_item.args = 'movie' + new_item.contentType = 'movie' new_item.title = entry["title"] + " (%s)" % entry["year"] new_item.infoLabels["tmdb_id"] = entry["ids"]["tmdb"] try: ratings.append(entry["rating"]) diff --git a/specials/videolibrary.py b/specials/videolibrary.py index f3d20e28..fcf2a3fb 100644 --- a/specials/videolibrary.py +++ b/specials/videolibrary.py @@ -920,7 +920,8 @@ def mark_content_as_watched(item): if config.is_xbmc(): from platformcode import xbmc_videolibrary xbmc_videolibrary.mark_content_as_watched_on_kodi(item, item.playcount) - + if config.get_setting("trakt_sync"): + xbmc_videolibrary.sync_trakt_kodi() platformtools.itemlist_refresh() @@ -975,6 +976,8 @@ def mark_season_as_watched(item): # We update the Kodi database from platformcode import xbmc_videolibrary xbmc_videolibrary.mark_season_as_watched_on_kodi(item, item.playcount) + if config.get_setting("trakt_sync"): + xbmc_videolibrary.sync_trakt_kodi() platformtools.itemlist_refresh() From 25a97a3f115314e32b2db72d2fd912068b8103e4 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Tue, 13 Jul 2021 21:17:01 +0200 Subject: [PATCH 080/139] "Vai a pagina" nel menu contestuale --- core/tmdb.py | 2 ++ platformcode/launcher.py | 12 +++++++++++- platformcode/platformtools.py | 2 ++ .../language/resource.language.en_gb/strings.po | 4 ++-- .../language/resource.language.it_it/strings.po | 8 ++++---- specials/search.py | 12 +++++++----- 6 files changed, 28 insertions(+), 12 deletions(-) diff --git a/core/tmdb.py b/core/tmdb.py index 6f3222c9..ed320df1 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -622,6 +622,8 @@ def discovery(item, dict_=False, cast=False): from core.item import Item if dict_: + if item.page: + item.discovery['page'] = item.page listado = Tmdb(discover = dict_, cast=cast) elif item.search_type == 'discover': diff --git a/platformcode/launcher.py b/platformcode/launcher.py index 693bdd67..d11216fc 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -2,7 +2,6 @@ # ------------------------------------------------------------ # XBMC Launcher (xbmc / kodi) # ------------------------------------------------------------ - import sys, os PY3 = False if sys.version_info[0] >= 3:PY3 = True; unicode = str; unichr = chr; long = int @@ -151,6 +150,17 @@ def run(item=None): import urllib short = urllib.urlopen('https://u.nu/api.php?action=shorturl&format=simple&url=' + item.url).read().decode('utf-8') platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(70740) % short) + elif item.action == "gotopage": + page = platformtools.dialog_numeric(0, config.get_localized_string(70513)) + if page: + import xbmc + item.action = item.real_action + if item.page: + item.page = page + else: + import re + item.url = re.sub('([=/])[0-9]+(/?)$', '\g<1>' + page + '\g<2>', item.url) + xbmc.executebuiltin("Container.Update(%s?%s)" % (sys.argv[0], item.tourl())) else: # Checks if channel exists if os.path.isfile(os.path.join(config.get_runtime_path(), 'channels', item.channel + ".py")): diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index a3eb98c9..81f7c69c 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -648,6 +648,8 @@ def set_context_commands(item, item_url, parent_item, **kwargs): if (item.contentTitle and item.contentType in ['movie', 'tvshow']) or "buscar_trailer" in context: context_commands.append((config.get_localized_string(60359), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, urllib.urlencode({ 'channel': "trailertools", 'action': "buscartrailer", 'search_title': item.contentTitle if item.contentTitle else item.fulltitle, 'contextual': True})))) + if item.nextPage: + context_commands.append((config.get_localized_string(70511), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=gotopage&real_action='+item.action))) if config.dev_mode(): context_commands.insert(0, ("item info", "Container.Update (%s?%s)" % (sys.argv[0], Item(action="itemInfo", parent=item.tojson()).tourl()))) return context_commands diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 0c59e78d..da5a632b 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -4845,7 +4845,7 @@ msgid "Manual Search" msgstr "" msgctxt "#70511" -msgid "" +msgid "Goto page" msgstr "" msgctxt "#70512" @@ -4853,7 +4853,7 @@ msgid "Searching in Mymovies" msgstr "" msgctxt "#70513" -msgid "" +msgid "Insert page number" msgstr "" msgctxt "#70514" diff --git a/resources/language/resource.language.it_it/strings.po b/resources/language/resource.language.it_it/strings.po index 0163f562..8c0632da 100644 --- a/resources/language/resource.language.it_it/strings.po +++ b/resources/language/resource.language.it_it/strings.po @@ -4844,16 +4844,16 @@ msgid "Manual Search" msgstr "Ricerca Manuale" msgctxt "#70511" -msgid "" -msgstr "" +msgid "Goto page" +msgstr "Vai a pagina" msgctxt "#70512" msgid "Searching in Mymovies" msgstr "Ricerca in Mymovies" msgctxt "#70513" -msgid "" -msgstr "" +msgid "Insert page number" +msgstr "Inserisci numero di pagina" msgctxt "#70514" msgid "" diff --git a/specials/search.py b/specials/search.py index e420d47d..bbf94837 100644 --- a/specials/search.py +++ b/specials/search.py @@ -722,12 +722,14 @@ def discover_list(item): elif len(result) > 19 and item.discovery: item.discovery['page'] = str(int(item.discovery['page']) + 1) - itemlist.append(Item(channel=item.channel, action='discover_list', title=typo(config.get_localized_string(30992), 'color kod bold'), - list_type=item.list_type, discovery=item.discovery, thumbnail=thumb())) + itemlist.append(Item(channel=item.channel, action='discover_list', nextPage=True, + title=typo(config.get_localized_string(30992), 'color kod bold'), + list_type=item.list_type, discovery=item.discovery, thumbnail=thumb(), page=item.discovery['page'])) elif len(result) > 19: next_page = str(int(item.page) + 1) - itemlist.append(Item(channel=item.channel, action='discover_list', title=typo(config.get_localized_string(30992), 'color kod bold'), + itemlist.append(Item(channel=item.channel, action='discover_list', nextPage=True, + title=typo(config.get_localized_string(30992), 'color kod bold'), list_type=item.list_type, search_type=item.search_type, mode=item.mode, page=next_page, thumbnail=thumb())) return itemlist @@ -789,8 +791,8 @@ def get_from_temp(item): results = [Item().fromurl(elem) for elem in item.itemlist[prevp:nextp]] if nextp < nTotal: - results.append(Item(channel='search', title=typo(config.get_localized_string(30992),'bold color kod'), - action='get_from_temp', itemlist=item.itemlist, page=item.page + 1)) + results.append(Item(channel='search', title=typo(config.get_localized_string(30992), 'bold color kod'), + action='get_from_temp', itemlist=item.itemlist, page=item.page + 1, nextPage=True)) tmdb.set_infoLabels_itemlist(results, True) for elem in results: From 9f1b65613aeb847a28f0080e35cd4ddd3826d689 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sun, 18 Jul 2021 13:38:16 +0200 Subject: [PATCH 081/139] Aggiunto AltadefinizioneCommunity --- channels.json | 1 + core/support.py | 3 ++- core/tmdb.py | 10 ++++++++-- servers/youdbox.py | 4 ++-- tests/test_generic.py | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/channels.json b/channels.json index da489eb8..3f64f88c 100644 --- a/channels.json +++ b/channels.json @@ -2,6 +2,7 @@ "direct": { "altadefinizione01": "https://www.altadefinizione01.plus", "altadefinizione01_link": "https://altadefinizione01.travel", + "altadefinizionecommunity": "https://altadefinizionecommunity.org", "animealtadefinizione": "https://www.animealtadefinizione.it", "animeforce": "https://www.animeforce.it", "animeleggendari": "https://animezeus.com", diff --git a/core/support.py b/core/support.py index a99c6c77..ee02a3b4 100755 --- a/core/support.py +++ b/core/support.py @@ -1166,6 +1166,7 @@ def nextPage(itemlist, item, data='', patron='', function_or_level=1, next_page= thumbnail=thumb())) return itemlist[-1] + def pagination(itemlist, item, page, perpage, function_level=1): if len(itemlist) >= page * perpage: itemlist.append( @@ -1385,7 +1386,7 @@ def get_jwplayer_mediaurl(data, srvName, onlyHttp=False, dataIsBlock=False): from core import jsontools video_urls = [] - block = scrapertools.find_single_match(data, r'sources:\s*([^\]]+\])') if not dataIsBlock else data + block = scrapertools.find_single_match(data, r'sources"?\s*:\s*(.*?}])') if not dataIsBlock else data if block: json = jsontools.load(block) if json: diff --git a/core/tmdb.py b/core/tmdb.py index ed320df1..bddacd2b 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -1055,7 +1055,10 @@ class Tmdb(object): # We sort result based on fuzzy match to detect most similar if len(results) > 1: from lib.fuzzy_match import algorithims - results.sort(key=lambda r: algorithims.trigram(text_simple, r.get('name', '') if self.search_type == 'tv' else r.get('title', '')), reverse=True) + if self.search_type == 'multi': + results.sort(key=lambda r: algorithims.trigram(text_simple, r.get('name', '') if r.get('media_type') == 'tv' else r.get('title', '')), reverse=True) + else: + results.sort(key=lambda r: algorithims.trigram(text_simple, r.get('name', '') if self.search_type == 'tv' else r.get('title', '')), reverse=True) # We return the number of results of this page self.results = results @@ -1654,7 +1657,10 @@ class Tmdb(object): if v == "None": continue - if k == 'overview': + if k == 'media_type': + ret_infoLabels['mediatype'] = 'tvshow' if v == 'tv' else 'movie' + + elif k == 'overview': if origen: ret_infoLabels['plot'] = v else: diff --git a/servers/youdbox.py b/servers/youdbox.py index c60e6794..e8bd9a74 100644 --- a/servers/youdbox.py +++ b/servers/youdbox.py @@ -14,7 +14,7 @@ def test_video_exists(page_url): return True, "" -def get_video_url(page_url, video_password): +def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("(page_url='%s')" % page_url) global data video_urls = [] @@ -26,4 +26,4 @@ def get_video_url(page_url, video_password): url += decoded.decode("utf8") url = scrapertools.find_single_match(url, '<source src="([^"]+)"') video_urls.append(["[youdbox]", url]) - return video_urls \ No newline at end of file + return video_urls diff --git a/tests/test_generic.py b/tests/test_generic.py index 111b4329..e89b677e 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -315,7 +315,7 @@ class GenericServerTest(unittest.TestCase): def test_get_video_url(self): module = __import__('servers.%s' % self.name, fromlist=["servers.%s" % self.name]) page_url = self.server.url - httptools.default_headers['Referer'] = self.server.referer + # httptools.default_headers['Referer'] = self.server.referer print('testing ' + page_url) print('Found on ' + self.server.foundOn) print() From 8b051e49f27dcf840f1c673c3cfa716cd5f3c8bb Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sun, 18 Jul 2021 13:38:42 +0200 Subject: [PATCH 082/139] ops --- channels/altadefinizionecommunity.json | 27 ++++ channels/altadefinizionecommunity.py | 202 +++++++++++++++++++++++++ 2 files changed, 229 insertions(+) create mode 100644 channels/altadefinizionecommunity.json create mode 100644 channels/altadefinizionecommunity.py diff --git a/channels/altadefinizionecommunity.json b/channels/altadefinizionecommunity.json new file mode 100644 index 00000000..cc0ccff9 --- /dev/null +++ b/channels/altadefinizionecommunity.json @@ -0,0 +1,27 @@ +{ + "id": "altadefinizionecommunity", + "name": "Altadefinizione Community", + "language": ["ita", "sub-ita"], + "active": true, + "thumbnail": "", + "banner": "", + "categories": ["movie", "tvshow", "vos"], + "not_active": ["include_in_newest"], + "settings": [ + { + "default": "", + "enabled": true, + "id": "username", + "label": "username", + "type": "text", + "visible": true + }, + { + "default": "", + "enabled": true, + "id": "password", + "label": "password", + "type": "text", + "visible": true + }] +} diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py new file mode 100644 index 00000000..1c0fa1bf --- /dev/null +++ b/channels/altadefinizionecommunity.py @@ -0,0 +1,202 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Canale per Altadefinizione Community +from core import support +from lib.fakeMail import Gmailnator +from platformcode import config, platformtools, logger +from core import scrapertools, httptools + +host = config.get_channel_url() +register_url = 'https://altaregistrazione.com' +headers = [['Referer', host]] + + +@support.menu +def mainlist(item): + support.info(item) + + # Ordine delle voci + # Voce FILM, puoi solo impostare l'url + film = ['/type/movie', # url per la voce FILM, se possibile la pagina principale con le ultime novità + #Voce Menu,['url','action','args',contentType] + ('Generi', ['', 'genres', 'genres']), + ] + + # Voce SERIE, puoi solo impostare l'url + tvshow = ['', # url per la voce Serie, se possibile la pagina con titoli di serie + #Voce Menu,['url','action','args',contentType] + ('Generi', ['', 'genres', 'genres']), + ] + + altri = [ + # ('Per Lettera', ['/lista-film', 'genres', 'letters']), + ('Qualità', ['', 'genres', 'quality']), + # ('Anni', ['/anno', 'genres', 'years']) + ] + search = '' + + return locals() + + +def login(): + r = httptools.downloadpage(host) + if 'id="logged"' in r.data: + logger.info('Già loggato') + else: + logger.info('Login in corso') + r = httptools.downloadpage(host + '/login', post={'email': config.get_setting('username', channel='altadefinizionecommunity'), + 'password': config.get_setting('password', channel='altadefinizionecommunity')}) + if not r.success or 'Email o Password non validi' in r.data: + platformtools.dialog_ok('AltadefinizioneCommunity', 'Username/password non validi') + return False + + return 'id="logged"' in r.data + + +def registerOrLogin(): + if config.get_setting('username', channel='altadefinizionecommunity') and config.get_setting('password', channel='altadefinizionecommunity'): + if login(): + return True + + action = platformtools.dialog_yesno('AltadefinizioneCommunity', + 'Questo server necessita di un account, ne hai già uno oppure vuoi tentare una registrazione automatica?', + yeslabel='Accedi', nolabel='Tenta registrazione', customlabel='Annulla') + if action == 1: # accedi + from specials import setting + from core.item import Item + user_pre = config.get_setting('username', channel='altadefinizionecommunity') + password_pre = config.get_setting('password', channel='altadefinizionecommunity') + setting.server_config(Item(config='altadefinizionecommunity')) + user_post = config.get_setting('username', channel='altadefinizionecommunity') + password_post = config.get_setting('password', channel='altadefinizionecommunity') + + if user_pre != user_post or password_pre != password_post: + return registerOrLogin() + else: + return [] + elif action == 0: # tenta registrazione + import random + import string + logger.debug('Registrazione automatica in corso') + mailbox = Gmailnator() + randPsw = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(10)) + logger.debug('email: ' + mailbox.address) + logger.debug('pass: ' + randPsw) + reg = platformtools.dialog_register(register_url, email=True, password=True, email_default=mailbox.address, password_default=randPsw) + if not reg: + return False + regPost = httptools.downloadpage(register_url, post={'email': reg['email'], 'password': reg['password']}) + + if regPost.url == register_url: + error = scrapertools.htmlclean(scrapertools.find_single_match(regPost.data, 'Impossibile proseguire.*?</div>')) + error = scrapertools.unescape(scrapertools.re.sub('\n\s+', ' ', error)) + platformtools.dialog_ok('AltadefinizioneCommunity', error) + return False + if reg['email'] == mailbox.address: + if "L'indirizzo email risulta già registrato" in regPost.data: + # httptools.downloadpage(baseUrl + '/forgotPassword', post={'email': reg['email']}) + platformtools.dialog_ok('AltadefinizioneCommunity', 'Indirizzo mail già utilizzato') + return False + mail = mailbox.waitForMail() + if mail: + checkUrl = scrapertools.find_single_match(mail.body, '<a href="([^"]+)[^>]+>Verifica').replace(r'\/', '/') + logger.debug('CheckURL: ' + checkUrl) + httptools.downloadpage(checkUrl) + config.set_setting('username', mailbox.address, channel='altadefinizionecommunity') + config.set_setting('password', randPsw, channel='altadefinizionecommunity') + platformtools.dialog_ok('AltadefinizioneCommunity', + 'Registrato automaticamente con queste credenziali:\nemail:' + mailbox.address + '\npass: ' + randPsw) + else: + platformtools.dialog_ok('AltadefinizioneCommunity', 'Impossibile registrarsi automaticamente') + return False + else: + platformtools.dialog_ok('AltadefinizioneCommunity', 'Hai modificato la mail quindi KoD non sarà in grado di effettuare la verifica in autonomia, apri la casella ' + reg['email'] + + ' e clicca sul link. Premi ok quando fatto') + logger.debug('Registrazione completata') + else: + return False + + return True + + +@support.scrape +def peliculas(item): + support.info(item) + + patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*<span[^>]+>[^<]+</span>\s*<span class="qual">(?P<quality>[^<]+).*?<img src="(?P<thumbnail>[^"]+)[^>]+>\s*<h3>(?P<title>[^<]+)' + patronNext = '' + + # debug = True + return locals() + + +def search(item, texto): + support.info("search ", texto) + + item.args = 'search' + item.url = host + "/search?s=" + texto + try: + return peliculas(item) + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.logger.error("%s" % line) + return [] + + +@support.scrape +def genres(item): + support.info(item) + + patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)' + if item.args == 'quality': + patronBlock = 'Risoluzione(?P<block>.*?)</ul>' + else: + patronBlock = ('Film' if item.contentType == 'movie' else 'Serie TV') + r'<span></span></a>\s+<ul class="dropdown-menu(?P<block>.*?)active-parent-menu' + action = 'peliculas' + + # debug = True + return locals() + + +@support.scrape +def episodios(item): + support.info(item) + data = item.data + patron = r'class="playtvshow " data-href="(?P<url>[^"]+)' + + # debug = True + def itemHook(it): + spl = it.url.split('/')[-2:] + it.contentSeason = int(spl[0])+1 + it.contentEpisodeNumber = int(spl[1])+1 + return it + return locals() + + +def findvideos(item): + itemlist = [] + video_url = item.url + if not '/watch-unsubscribed' in video_url: + playWindow = support.match(item.url, patron='playWindow" href="([^"]+)') + video_url = playWindow.match + if '/tvshow' in video_url: + item.data = playWindow.data + return episodios(item) + itemlist.append(item.clone(action='play', url=support.match(video_url.replace('/watch-unsubscribed', '/watch-external'), + patron='src="([^"]+)').match, quality='')) + itemlist.append(item.clone(action='play', server='directo', title=support.config.get_localized_string(30137), + url=video_url.replace('/watch-unsubscribed', '/watch'))) + return support.server(item, itemlist=itemlist) + + +def play(item): + if host in item.url: # intercetto il server proprietario + if registerOrLogin(): + return support.get_jwplayer_mediaurl(httptools.downloadpage(item.url).data, 'Diretto') + else: + platformtools.play_canceled = True + return [] + else: + return [item] From 8d6d6a41cf27e172c63b87bd7a854dbe14271ca7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Sun, 18 Jul 2021 17:43:13 +0000 Subject: [PATCH 083/139] {Aggiornamento domini} --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index 3f64f88c..b9943d20 100644 --- a/channels.json +++ b/channels.json @@ -23,7 +23,7 @@ "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", "guardaserieclick": "https://www.guardaserie.services", - "guardaserieicu": "https://guardaserie.quest", + "guardaserieicu": "https://guardaserie.network", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", "ilgeniodellostreaming": "https://ilgeniodellostreaming.mba", From 993ac5ab16eff225384e68b29d9b94557d1a1ea0 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Tue, 20 Jul 2021 20:40:49 +0200 Subject: [PATCH 084/139] Fix proxytranslate --- core/resolverdns.py | 4 ++-- lib/proxytranslate.py | 26 ++++++++++++-------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/core/resolverdns.py b/core/resolverdns.py index 325faf35..e6f57c08 100644 --- a/core/resolverdns.py +++ b/core/resolverdns.py @@ -112,8 +112,8 @@ class CipherSuiteAdapter(host_header_ssl.HostHeaderSSLAdapter): request.url = urlparse.urlunparse(parse) try: ret = super(CipherSuiteAdapter, self).send(request, **kwargs) - if 400 <= ret.status_code < 500: - raise Exception + # if 400 <= ret.status_code < 500: + # raise Exception except (requests.exceptions.HTTPError, requests.exceptions.ConnectionError, requests.exceptions.SSLError) as e: logger.info('Request for ' + domain + ' with ip ' + ip + ' failed') logger.info(e) diff --git a/lib/proxytranslate.py b/lib/proxytranslate.py index c0871d5f..4949430a 100644 --- a/lib/proxytranslate.py +++ b/lib/proxytranslate.py @@ -11,28 +11,26 @@ else: import re import time - import requests try: from platformcode import logger except ImportError: logger = None -HEADERS = { - 'Host': 'translate.google.com', - 'User-Agent': 'android' -} +HEADERS = {'User-Agent': 'android', + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", + "Accept-Language": "it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3", "Accept-Charset": "UTF-8", + "Accept-Encoding": "gzip"} -MAX_CONECTION_THREAD = 10 SL = 'en' TL = 'it' BASE_URL_PROXY = 'https://translate.googleusercontent.com' -BASE_URL_TRANSLATE = 'https://translate.google.com/translate?hl=it&sl=' + SL + '&tl=' + TL + '&u=[TARGET_URL]&sandbox=0' # noqa: E501 +BASE_URL_TRANSLATE = 'https://translate.google.com/translate?hl=it&sl=' + SL + '&tl=' + TL + '&u=[TARGET_URL]' # noqa: E501 def checker_url(html, url): - grep_regex = re.findall(r'(?:href="|src="|value=")([^"]+)', html) # noqa: E501 + grep_regex = re.findall(r'(?:href="|src="|value=")(https?://translate[^"]+)', html) # noqa: E501 for url_result_regex in grep_regex: if url in url_result_regex: return url_result_regex.replace('&', '&') @@ -44,6 +42,8 @@ def process_request_proxy(url): try: domain = urlparse.urlparse(url).netloc + session = requests.Session() + session.headers.update(HEADERS) target_url = \ BASE_URL_TRANSLATE.replace('[TARGET_URL]', request.quote(url)) @@ -53,7 +53,7 @@ def process_request_proxy(url): else: print(target_url) - return_html = requests.get(target_url, timeout=20, headers=HEADERS) + return_html = session.get(target_url, timeout=20) if not return_html: return @@ -68,10 +68,9 @@ def process_request_proxy(url): else: print(url_request) - request_final = requests.get( + request_final = session.get( url_request, - timeout=20, - headers={'User-Agent': 'android'} + timeout=20 ) url_request_proxy = checker_url( @@ -86,10 +85,9 @@ def process_request_proxy(url): result = None while not data or 'Sto traducendo' in data: time.sleep(0.5) - result = requests.get( + result = session.get( url_request_proxy, timeout=20 - # headers={'User-Agent': 'android'} ) data = result.content.decode('utf-8', 'ignore') if not PY3: From b81d66bd813595b3cb95d70a4db5f58fa13b82b5 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Wed, 21 Jul 2021 18:34:35 +0200 Subject: [PATCH 085/139] Fix episodi Toonitalia --- channels/toonitalia.py | 20 +++++++++----------- core/support.py | 14 +++++++------- lib/proxytranslate.py | 2 +- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/channels/toonitalia.py b/channels/toonitalia.py index 69ebb1e6..2a16dae9 100644 --- a/channels/toonitalia.py +++ b/channels/toonitalia.py @@ -93,17 +93,15 @@ def peliculas(item): @support.scrape def episodios(item): anime = True - def get_ep(item): - find = '' - data = support.match(item, headers=headers).data - match = support.match(data, patron=r'(?: /> |<p>)(?:(?P<season>\d+)×)?(?P<episode>\d+)(?:\s+–\s+)?(?P<title>[^<]+)<a (?P<data>.*?)(?:<br|</p)').matches - if match: - for m in match: - find += '{}{:02d}|{}|{}|'.format(m[0]+'x' if m[0] else '', int(m[1]), clean_title(m[2]), m[3]) - return find - - data = get_ep(item) - patron = r'(?P<episode>[^|]+)\|(?P<title>[^|]+)\|(?P<data>[^|]+)\|' + # debug = True + patron = r'>\s*(?:(?P<season>\d+)(?:×|x|×))?(?P<episode>\d+)(?:\s+–\s+)?[ –]+(?P<title2>[^<]+)[ –]+<a (?P<data>.*?)(?:<br|</p)' + # data = '' + # match = support.match(item, headers=headers, patron=r'(?: /> |<p>)(?:(?P<season>\d+)×)?(?P<episode>\d+)(?:\s+–\s+)?(?P<title>[^<]+)<a (?P<data>.*?)(?:<br|</p)').matches + # if match: + # for m in match: + # data += '{}{:02d}|{}|{}|'.format(m[0]+'x' if m[0] else '', int(m[1]), clean_title(m[2]), m[3]) + # + # patron = r'(?P<episode>[^|]+)\|(?P<title>[^|]+)\|(?P<data>[^|]+)\|' return locals() diff --git a/core/support.py b/core/support.py index ee02a3b4..eb26e9f7 100755 --- a/core/support.py +++ b/core/support.py @@ -552,13 +552,13 @@ def scrape(func): if patronNext and inspect.stack()[1][3] not in ['newest'] and len(inspect.stack()) > 2 and inspect.stack()[2][3] not in ['get_channel_results']: nextPage(itemlist, item, data, patronNext, function) - for it in itemlist: - if it.contentEpisodeNumber and it.contentSeason: - it.title = '[B]{:d}x{:02d} - {}[/B]'.format(it.contentSeason, it.contentEpisodeNumber, it.infoLabels['title'] if it.infoLabels['title'] else it.fulltitle) - if it.contentLanguage: - it.title += typo(it.contentLanguage, '_ [] color kod') - if it.quality: - it.title += typo(it.quality, '_ [] color kod') + # for it in itemlist: + # if it.contentEpisodeNumber and it.contentSeason: + # it.title = '[B]{:d}x{:02d} - {}[/B]'.format(it.contentSeason, it.contentEpisodeNumber, it.infoLabels['title'] if it.infoLabels['title'] else it.fulltitle) + # if it.contentLanguage: + # it.title += typo(it.contentLanguage, '_ [] color kod') + # if it.quality: + # it.title += typo(it.quality, '_ [] color kod') # next page for pagination if pagination and len(matches) > pag * pagination and not search: diff --git a/lib/proxytranslate.py b/lib/proxytranslate.py index 4949430a..47be03b9 100644 --- a/lib/proxytranslate.py +++ b/lib/proxytranslate.py @@ -97,7 +97,7 @@ def process_request_proxy(url): data = re.sub('\s(\w+)=(?!")([^<>\s]+)', r' \1="\2"', data) data = re.sub('https://translate\.googleusercontent\.com/.*?u=(.*?)&usg=[A-Za-z0-9_-]+', '\\1', data) - data = re.sub('https?://[a-zA-Z0-9-]+' + domain.replace('.', '-') + '\.translate\.goog(/[a-zA-Z0-9#/-]+)', 'https://' + domain + '\\1', data) + data = re.sub('https?://[a-zA-Z0-9-]*' + domain.replace('.', '-') + '\.translate\.goog(/[a-zA-Z0-9#/-]+)', 'https://' + domain + '\\1', data) data = re.sub('\s+<', '<', data) data = data.replace('&', '&').replace('https://translate.google.com/website?sl=' + SL + '&tl=' + TL + '&ajax=1&u=', '') From 01577f9c898faae7c883333048bf367c7800add8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 17:45:50 +0000 Subject: [PATCH 086/139] {Aggiornamento domini} --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index b9943d20..8067c4df 100644 --- a/channels.json +++ b/channels.json @@ -26,7 +26,7 @@ "guardaserieicu": "https://guardaserie.network", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", - "ilgeniodellostreaming": "https://ilgeniodellostreaming.mba", + "ilgeniodellostreaming": "https://ilgeniodellostreaming.rip", "ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.city", "italiaserie": "https://italiaserie.city", "mediasetplay": "https://www.mediasetplay.mediaset.it", From 803400a693708705c7e3e43d756db1dc84de8c03 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Thu, 22 Jul 2021 12:27:06 +0200 Subject: [PATCH 087/139] Fix Icone Rai Play --- channels/raiplay.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/channels/raiplay.py b/channels/raiplay.py index e394be75..14340edc 100644 --- a/channels/raiplay.py +++ b/channels/raiplay.py @@ -185,8 +185,9 @@ def live(item): itemlist =[] for channel, value in liveDict().items(): itemlist.append(item.clone(title = support.typo(channel, 'bold'), fulltitle = channel, show = channel, url = value['url'], - plot = value['plot'], action = 'play', fanart = value['fanart'], manifest='hls', no_return=True)) - return support.thumb(itemlist, live=True) + plot = value['plot'], action = 'play', fanart = value['fanart'], manifest='hls', forcethumb=True, no_return=True)) + support.thumb(itemlist, live=True) + return itemlist def peliculas(item): From 876e66dcf858b595f678c19e6d358e175f2e42ba Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Thu, 22 Jul 2021 17:45:35 +0000 Subject: [PATCH 088/139] {Aggiornamento domini} --- channels.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/channels.json b/channels.json index 8067c4df..24db451c 100644 --- a/channels.json +++ b/channels.json @@ -26,9 +26,9 @@ "guardaserieicu": "https://guardaserie.network", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", - "ilgeniodellostreaming": "https://ilgeniodellostreaming.rip", + "ilgeniodellostreaming": "https://ilgeniodellostreaming.wtf", "ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.city", - "italiaserie": "https://italiaserie.city", + "italiaserie": "https://italiaserie.date", "mediasetplay": "https://www.mediasetplay.mediaset.it", "mondoserietv": "https://mondoserietv.club", "paramount": "https://www.paramountnetwork.it", @@ -39,9 +39,9 @@ "serietvonline": "https://serietvonline.art", "serietvsubita": "http://serietvsubita.xyz", "serietvu": "https://www.serietvu.live", - "streamingcommunity": "https://streamingcommunity.work", + "streamingcommunity": "https://streamingcommunity.vip", "streamtime": "https://t.me/s/StreamTime", - "tantifilm": "https://www.tantifilm.bond", + "tantifilm": "https://www.tantifilm.stream", "tapmovie": "https://it.tapmovie.net", "toonitalia": "https://toonitalia.co", "vvvvid": "https://www.vvvvid.it" From 605ca3affe4536fb342bed3a42aac3be94eada2a Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Fri, 23 Jul 2021 17:44:16 +0200 Subject: [PATCH 089/139] Prova aggiornamento domini su stabile --- .github/workflows/updateDomainsStable.yml | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/updateDomainsStable.yml diff --git a/.github/workflows/updateDomainsStable.yml b/.github/workflows/updateDomainsStable.yml new file mode 100644 index 00000000..5ab4d44a --- /dev/null +++ b/.github/workflows/updateDomainsStable.yml @@ -0,0 +1,32 @@ +name: Update channel domains +on: + workflow_dispatch: + schedule: + - cron: '30 17 * * *' + +jobs: + update: + runs-on: ubuntu-latest + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + with: + ref: stable + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install dependencies + run: pip install requests + + - name: Update domains + run: python tools/updateDomains.py + + - name: Commit & Push changes + uses: actions-js/push@master + with: + message: "Aggiornamento domini" + branch: "stable" + github_token: ${{ secrets.API_TOKEN_GITHUB }} \ No newline at end of file From f184ce97fd009d930cf50bea3e93ea272a7860a0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Fri, 23 Jul 2021 17:44:48 +0000 Subject: [PATCH 090/139] {Aggiornamento domini} --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index 24db451c..2cfa142d 100644 --- a/channels.json +++ b/channels.json @@ -14,7 +14,7 @@ "casacinema": "https://www.casacinema.page", "cb01anime": "https://www.cineblog01.red", "cineblog01": "https://cb01.uno", - "cinemalibero": "https://cinemalibero.quest", + "cinemalibero": "https://cinemalibero.bar", "cinetecadibologna": "http://cinestore.cinetecadibologna.it", "discoveryplus": "https://www.discoveryplus.com", "dreamsub": "https://dreamsub.stream", From db444c2eb27168a93a03519736652bbf7de6d321 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sat, 24 Jul 2021 14:52:43 +0200 Subject: [PATCH 091/139] Completato altadefinizionecommunity --- channels.json | 2 +- channels/altadefinizionecommunity.py | 45 ++++++++++++++++++---------- core/support.py | 3 +- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/channels.json b/channels.json index 24db451c..31a28afe 100644 --- a/channels.json +++ b/channels.json @@ -2,7 +2,6 @@ "direct": { "altadefinizione01": "https://www.altadefinizione01.plus", "altadefinizione01_link": "https://altadefinizione01.travel", - "altadefinizionecommunity": "https://altadefinizionecommunity.org", "animealtadefinizione": "https://www.animealtadefinizione.it", "animeforce": "https://www.animeforce.it", "animeleggendari": "https://animezeus.com", @@ -47,6 +46,7 @@ "vvvvid": "https://www.vvvvid.it" }, "findhost": { + "altadefinizionecommunity": "https://altaregistrazione.com", "altadefinizioneclick": "https://altadefinizione-nuovo.click", "animealtadefinizione": "https://www.animealtadefinizione.it", "filmpertutti": "https://filmpertuttiii.nuovo.live" diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index 1c0fa1bf..79247c9b 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -6,24 +6,26 @@ from lib.fakeMail import Gmailnator from platformcode import config, platformtools, logger from core import scrapertools, httptools -host = config.get_channel_url() + +def findhost(url): + return support.match(url, patron=r'<a href="([^"]+)/\w+">Accedi').match + + +host = config.get_channel_url(findhost) register_url = 'https://altaregistrazione.com' -headers = [['Referer', host]] +headers = [['Referer', host], ['x-requested-with', 'XMLHttpRequest']] @support.menu def mainlist(item): support.info(item) - # Ordine delle voci - # Voce FILM, puoi solo impostare l'url - film = ['/type/movie', # url per la voce FILM, se possibile la pagina principale con le ultime novità + film = ['/load-more-film?anno=&order=&support_webp=1&type=movie&page=1', #Voce Menu,['url','action','args',contentType] ('Generi', ['', 'genres', 'genres']), ] - # Voce SERIE, puoi solo impostare l'url - tvshow = ['', # url per la voce Serie, se possibile la pagina con titoli di serie + tvshow = ['/load-more-film?type=tvshow&anno=&order=&support_webp=1&page=1', #Voce Menu,['url','action','args',contentType] ('Generi', ['', 'genres', 'genres']), ] @@ -66,7 +68,7 @@ def registerOrLogin(): from core.item import Item user_pre = config.get_setting('username', channel='altadefinizionecommunity') password_pre = config.get_setting('password', channel='altadefinizionecommunity') - setting.server_config(Item(config='altadefinizionecommunity')) + setting.channel_config(Item(config='altadefinizionecommunity')) user_post = config.get_setting('username', channel='altadefinizionecommunity') password_post = config.get_setting('password', channel='altadefinizionecommunity') @@ -121,12 +123,24 @@ def registerOrLogin(): @support.scrape def peliculas(item): - support.info(item) - - patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*<span[^>]+>[^<]+</span>\s*<span class="qual">(?P<quality>[^<]+).*?<img src="(?P<thumbnail>[^"]+)[^>]+>\s*<h3>(?P<title>[^<]+)' - patronNext = '' - # debug = True + support.info(item) + if '/load-more-film' not in item.url and '/search' not in item.url: # generi o altri menu, converto + import ast + ajax = support.match(item.url, patron="ajax_data\s*=\s*([^;]+)").match + item.url = host + '/load-more-film?' + support.urlencode(ast.literal_eval(ajax)) + '&page=1' + json = support.httptools.downloadpage(item.url, headers=headers).json + data = "\n".join(json['data']) + patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*<span[^>]+>[^<]+</span>\s*<span class="qual">(?P<quality>[^<]+).*?<img src="(?P<thumbnail>[^"]+)[^>]+>\s*<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?' + + # paginazione + if json.get('have_next'): + def fullItemlistHook(itemlist): + spl = item.url.split('=') + url = '='.join(spl[:-1]) + page = str(int(spl[-1])+1) + support.nextPage(itemlist, item, next_page='='.join((url, page)), function_or_level='peliculas') + return itemlist return locals() @@ -134,7 +148,7 @@ def search(item, texto): support.info("search ", texto) item.args = 'search' - item.url = host + "/search?s=" + texto + item.url = host + "/search?s={0}&page=1".format(texto) try: return peliculas(item) # Continua la ricerca in caso di errore @@ -171,6 +185,7 @@ def episodios(item): spl = it.url.split('/')[-2:] it.contentSeason = int(spl[0])+1 it.contentEpisodeNumber = int(spl[1])+1 + it.title = str(it.contentSeason) + 'x' + str(it.contentEpisodeNumber) return it return locals() @@ -178,7 +193,7 @@ def episodios(item): def findvideos(item): itemlist = [] video_url = item.url - if not '/watch-unsubscribed' in video_url: + if '/watch-unsubscribed' not in video_url: playWindow = support.match(item.url, patron='playWindow" href="([^"]+)') video_url = playWindow.match if '/tvshow' in video_url: diff --git a/core/support.py b/core/support.py index eb26e9f7..338a94af 100755 --- a/core/support.py +++ b/core/support.py @@ -1384,7 +1384,6 @@ def addQualityTag(item, itemlist, data, patron): def get_jwplayer_mediaurl(data, srvName, onlyHttp=False, dataIsBlock=False): from core import jsontools - video_urls = [] block = scrapertools.find_single_match(data, r'sources"?\s*:\s*(.*?}])') if not dataIsBlock else data if block: @@ -1407,7 +1406,7 @@ def get_jwplayer_mediaurl(data, srvName, onlyHttp=False, dataIsBlock=False): for url, quality in sources: quality = 'auto' if not quality else quality if url.split('.')[-1] != 'mpd': - video_urls.append(['.' + url.split('.')[-1] + ' [' + quality + '] [' + srvName + ']', url if not onlyHttp else url.replace('https://', 'http://')]) + video_urls.append(['.' + url.split('.')[-1].split('?')[0] + ' [' + quality + '] [' + srvName + ']', url.replace(' ', '%20') if not onlyHttp else url.replace('https://', 'http://')]) video_urls.sort(key=lambda x: x[0].split()[1]) return video_urls From c42bc9c0eb49bdc335c7bb3747d667e7dcfc918d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Sat, 24 Jul 2021 17:43:01 +0000 Subject: [PATCH 092/139] {Aggiornamento domini} --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index 6b0f2416..6fd8980b 100644 --- a/channels.json +++ b/channels.json @@ -46,8 +46,8 @@ "vvvvid": "https://www.vvvvid.it" }, "findhost": { - "altadefinizionecommunity": "https://altaregistrazione.com", "altadefinizioneclick": "https://altadefinizione-nuovo.click", + "altadefinizionecommunity": "https://altaregistrazione.com", "animealtadefinizione": "https://www.animealtadefinizione.it", "filmpertutti": "https://filmpertuttiii.nuovo.live" } From eee60e9187a3b87e3b3529ce50220e4fedee194d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Sun, 25 Jul 2021 17:43:03 +0000 Subject: [PATCH 093/139] {Aggiornamento domini} --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index 6fd8980b..f4040158 100644 --- a/channels.json +++ b/channels.json @@ -22,7 +22,7 @@ "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", "guardaserieclick": "https://www.guardaserie.services", - "guardaserieicu": "https://guardaserie.network", + "guardaserieicu": "https://guardaserie.sbs", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", "ilgeniodellostreaming": "https://ilgeniodellostreaming.wtf", From 6fc76ddcaedbbbb155b015ed53784017699f7883 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Tue, 27 Jul 2021 17:44:39 +0000 Subject: [PATCH 094/139] {Aggiornamento domini} --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index f4040158..ebb2b4b6 100644 --- a/channels.json +++ b/channels.json @@ -22,7 +22,7 @@ "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", "guardaserieclick": "https://www.guardaserie.services", - "guardaserieicu": "https://guardaserie.sbs", + "guardaserieicu": "https://guardaserie.blog", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", "ilgeniodellostreaming": "https://ilgeniodellostreaming.wtf", From 4838be5705746b567f6e0a1f6a447714667ca5d9 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Wed, 28 Jul 2021 17:45:16 +0200 Subject: [PATCH 095/139] Logo Altadefinizione Community --- channels/altadefinizionecommunity.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/altadefinizionecommunity.json b/channels/altadefinizionecommunity.json index cc0ccff9..970bab9e 100644 --- a/channels/altadefinizionecommunity.json +++ b/channels/altadefinizionecommunity.json @@ -3,7 +3,7 @@ "name": "Altadefinizione Community", "language": ["ita", "sub-ita"], "active": true, - "thumbnail": "", + "thumbnail": "altadefinizionecommunity.png", "banner": "", "categories": ["movie", "tvshow", "vos"], "not_active": ["include_in_newest"], From fef622860c38b7317e1c404228ce8963042825c7 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Wed, 28 Jul 2021 17:46:15 +0200 Subject: [PATCH 096/139] - Ricritto Mediaset Play - Ordine Canali Live --- channels/discoveryplus.py | 4 +- channels/mediasetplay.json | 12 +- channels/mediasetplay.py | 536 +++++++++++++++++-------------------- core/support.py | 53 +++- specials/filmontv.py | 1 + 5 files changed, 317 insertions(+), 289 deletions(-) diff --git a/channels/discoveryplus.py b/channels/discoveryplus.py index 9f735cd9..abe3ffd1 100644 --- a/channels/discoveryplus.py +++ b/channels/discoveryplus.py @@ -35,7 +35,9 @@ def mainlist(item): def liveDict(): livedict = {} - for key in session.get(api + '/cms/routes/home?decorators=viewingHistory&include=default', headers=headers).json()['included']: + + for key in session.get(api + '/cms/routes/canali?decorators=viewingHistory&include=default', headers=headers).json()['included']: + if key['type'] == 'channel' and key.get('attributes',{}).get('hasLiveStream', '') and 'Free' in key.get('attributes',{}).get('packages', []): title = key['attributes']['name'] livedict[title] = {} diff --git a/channels/mediasetplay.json b/channels/mediasetplay.json index 660a0a7b..c482bf94 100644 --- a/channels/mediasetplay.json +++ b/channels/mediasetplay.json @@ -8,6 +8,14 @@ "categories": ["movie", "tvshow", "documentary", "live"], "not_active": ["include_in_newest"], "default_off": ["include_in_global_search"], - "settings": [], - "cloudflare": true + "settings": [ + { + "id": "mpd", + "type": "bool", + "label": "Preferisci mpd", + "default": true, + "enabled": true, + "visible": true + } + ] } diff --git a/channels/mediasetplay.py b/channels/mediasetplay.py index 1ee3c480..abac9da5 100644 --- a/channels/mediasetplay.py +++ b/channels/mediasetplay.py @@ -2,359 +2,325 @@ # ------------------------------------------------------------ # Canale per Mediaset Play # ------------------------------------------------------------ -from platformcode import logger -import uuid +from time import time +from platformcode import logger, config +import uuid, datetime, xbmc import requests, sys -from core import support -if sys.version_info[0] >= 3: from urllib.parse import urlencode, quote -else: from urllib import urlencode, quote -if sys.version_info[0] >= 3: from concurrent import futures -else: from concurrent_py2 import futures +from core import support, jsontools, tmdb +if sys.version_info[0] >= 3: + from urllib.parse import urlencode, quote + from concurrent import futures +else: + from urllib import urlencode, quote + from concurrent_py2 import futures from collections import OrderedDict -PAGINATION = 4 +host = 'https://www.mediasetplay.mediaset.it' +loginUrl = 'https://api-ott-prod-fe.mediaset.net/PROD/play/idm/anonymous/login/v2.0' -host = '' -post_url = '?assetTypes=HD,browser,widevine,geoIT|geoNo:HD,browser,geoIT|geoNo:HD,geoIT|geoNo:SD,browser,widevine,geoIT|geoNo:SD,browser,geoIT|geoNo:SD,geoIT|geoNo&auto=true&balance=true&format=smil&formats=MPEG-DASH,MPEG4,M3U&tracking=true' -deviceid = '61d27df7-5cbf-4419-ba06-cfd27ecd4588' -loginUrl = 'https://api-ott-prod-fe.mediaset.net/PROD/play/idm/anonymous/login/v1.0' -loginData = {"cid": deviceid, "platform": "pc", "appName": "web/mediasetplay-web/d667681"} -lic_url = 'https://widevine.entitlement.theplatform.eu/wv/web/ModularDrm/getRawWidevineLicense?releasePid=%s&account=http://access.auth.theplatform.com/data/Account/2702976343&schema=1.0&token={token}|Accept=*/*&Content-Type=&User-Agent=' + support.httptools.get_user_agent() + '|R{{SSM}}|' -entry = 'https://api.one.accedo.tv/content/entry/{id}?locale=it' -entries = 'https://api.one.accedo.tv/content/entries?id={id}&locale=it' +clientid = 'f66e2a01-c619-4e53-8e7c-4761449dd8ee' + + +loginData = {"client_id": clientid, "platform": "pc", "appName": "web//mediasetplay-web/5.1.493-plus-da8885b"} sessionUrl = "https://api.one.accedo.tv/session?appKey=59ad346f1de1c4000dfd09c5&uuid={uuid}&gid=default" -current_session = requests.Session() -current_session.headers.update({'Content-Type': 'application/json', 'User-Agent': support.httptools.get_user_agent(), 'Referer': support.config.get_channel_url()}) +session = requests.Session() +session.headers.update({'Content-Type': 'application/json', 'User-Agent': support.httptools.get_user_agent(), 'Referer': host}) + +entry = 'https://api.one.accedo.tv/content/entry/{id}?locale=it' +entries = 'https://api.one.accedo.tv/content/entries?id={id}&locale=it' # login anonimo -res = current_session.post(loginUrl, json=loginData, verify=False) -Token = res.headers['t-cts'] -current_session.headers.update({'t-apigw': res.headers['t-apigw'], 't-cts': Token}) -lic_url = lic_url.format(token=Token) -tracecid = res.json()['response']['traceCid'] -cwid = res.json()['response']['cwId'] +# support.dbg() +res = session.post(loginUrl, json=loginData, verify=False) +Token = res.json()['response']['beToken'] +sid = res.json()['response']['sid'] +session.headers.update({'authorization': 'Bearer ' + Token}) # sessione -res = current_session.get(sessionUrl.format(uuid=str(uuid.uuid4())), verify=False) -current_session.headers.update({'x-session': res.json()['sessionKey']}) - -cdict = {'CWFILMTOPVIEWED':'filmPiuVisti24H', - 'CWFILMCOMEDY':'filmCommedia', - 'CWFILMACTION':'filmAzioneThrillerAvventura', - 'CWFILMDRAMATIC':'filmDrammatico', - 'CWFILMSENTIMENTAL':'filmSentimentale', - 'CWFILMCLASSIC':'filmClassici', - 'personToContentFilm':'personToContentFilm', - 'CWHOMEFICTIONNOWELITE':'stagioniFictionSerieTvSezione', - 'CWFICTIONSOAP':'mostRecentSoapOpera', - 'CWFICTIONDRAMATIC':'stagioniFictionDrammatico', - 'CWFICTIONPOLICE':'stagioniFictionPoliziesco', - 'CWFICTIONCOMEDY':'stagioniFictionCommedia', - 'CWFICTIONSITCOM':'stagioniFictionSitCom', - 'CWFICTIONSENTIMENTAL':'stagioniFictionSentimentale', - 'CWFICTIONBIOGRAPHICAL':'stagioniFictionBiografico', - 'CWPROGTVPRIME':'stagioniPrimaSerata', - 'CWPROGTVDAY':'stagioniDaytime', - 'CWPROGTVTOPVIEWED':'programmiTvClip24H', - 'CWPROGTVTALENT':'stagioniReality', - 'CWPROGTVVARIETY':'stagioniVarieta', - 'CWPROGTVTALK':'stagioniTalk', - 'CWPROGTVTG':'mostRecentTg', - 'CWPROGTVSPORT':'mostRecentSport', - 'CWPROGTVMAGAZINE':'stagioniCucinaLifestyle', - 'CWDOCUMOSTRECENT':'mostRecentDocumentariFep', - 'CWDOCUTOPVIEWED':'stagioniDocumentari', - 'CWDOCUSPAZIO':'documentariSpazio', - 'CWDOCUNATURANIMALI':'documentariNatura', - 'CWDOCUSCIENZATECH':'documentariScienza', - 'CWDOCUBIOSTORIE':'documentariBioStoria', - 'CWDOCUINCHIESTE':'documentariInchiesta', - 'CWFILMDOCU':'filmDocumentario', - 'CWKIDSBOINGFORYOU':'kidsBoing', - 'CWKIDSCARTOONITO':'kidsCartoonito', - 'CWKIDSMEDIASETBRAND':'kidsMediaset', - 'CWENABLERKIDS':'stagioniKids'} +sessionKey = session.get(sessionUrl.format(uuid=str(uuid.uuid4())), verify=False).json()['sessionKey'] +session.headers.update({'x-session': sessionKey}) @support.menu def mainlist(item): - top = [('Dirette {bold}', ['https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-stations?sort=ShortTitle', 'live'])] + top = [('Dirette {bold}', ['', 'live'])] - menu = [('Film {bullet bold}', ['5acfcbc423eec6000d64a6bb', 'menu', ['Tutti','all','searchMovie']]), - ('Fiction / Serie TV {bullet bold}', ['5acfcb3c23eec6000d64a6a4', 'menu', ['Tutte','all','searchStagioni'], 'tvshow']), - ('Programmi TV{ bullet bold}', ['5acfc8011de1c4000b6ec953', 'menu', ['Tutti','all','searchStagioni'], 'tvshow']), - ('Documentari {bullet bold}', ['5bfd17c423eec6001aec49f9', 'menu', ['Tutti','all',''], 'undefined']), - ('Kids {bullet bold}', ['5acfcb8323eec6000d64a6b3', 'menu',['Tutti','all',''], 'undefined']), - ('Family {bullet bold}', ['5e662d01a0e845001d56875b', 'menu',['Tutti','all',''], 'undefined']), - ] + menu = [('Fiction / Serie TV {bullet bold}', ['/fiction', 'menu', '5acfcb3c23eec6000d64a6a4', 'tvshow']), + ('Programmi TV{ bullet bold}', ['/programmitv', 'menu', '5acfc8011de1c4000b6ec953', 'tvshow']), + ('Documentari {bullet bold}', ['/documentari', 'menu', '5bfd17c423eec6001aec49f9', 'undefined']), + ('Kids {bullet bold}', ['/kids', 'menu', '5acfcb8323eec6000d64a6b3', 'undefined'])] search = '' return locals() +def menu(item): + logger.debug() + itemlist = [] + res = get_from_id(item) + for it in res: + logger.debug(jsontools.dump(it)) + if 'uxReference' in it: + itemlist.append(item.clone(title=support.typo(it['title'], 'bullet bold'), + url= it['landingUrl'], + feed = it.get('feedurlV2',''), + ref=it.get('uxReferenceV2', ''), + params=it.get('uxReferenceV2Params', ''), + args='', + action='peliculas')) + return itemlist + + +def live(item): + itemlist = [] + + res = session.get('https://static3.mediasetplay.mediaset.it/apigw/nownext/nownext.json').json()['response'] + allguide = res['listings'] + stations = res['stations'] + + for it in stations.values(): + plot = '' + title = it['title'] + url = 'https:' + it['mediasetstation$pageUrl'] + if 'plus' in title.lower() or 'premium' in title.lower(): continue + if it['callSign'] in allguide: + urls = [] + guide = allguide[it['callSign']] + plot = '[B]{}[/B]\n{}\n\nA Seguire:\n[B]{}[/B]\n{}'.format(guide['currentListing']['mediasetlisting$epgTitle'], + guide['currentListing']['description'], + guide['nextListing']['mediasetlisting$epgTitle'], + guide['nextListing']['description'],) + + itemlist.append(item.clone(title=support.typo(title, 'bold'), fulltitle=title, urls=guide['tuningInstruction']['urn:theplatform:tv:location:any'], plot=plot, url=url, action='play', forcethumb=True)) + + itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999)) + support.thumb(itemlist, live=True) + return itemlist + def search(item, text): - itemlist = [] - logger.debug(text) - item.search = text + item.ref = 'main' + item.query = text + item.params = 'channel≈' try: - itemlist = peliculas(item) + return peliculas(item) + # Continua la ricerca in caso di errore except: import sys for line in sys.exc_info(): support.logger.error("%s" % line) - - return itemlist - - -def menu(item): - logger.debug() - itemlist = [] - if item.url: - json = get_from_id(item) - for it in json: - if 'uxReference' in it: itemlist.append( - item.clone(title=support.typo(it['title'], 'bullet bold'), url= it['landingUrl'], ref=it['uxReference'], args='', action='peliculas')) - return itemlist - - -def liveDict(): - livedict = OrderedDict({}) - json = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-stations?sort=ShortTitle').json()['entries'] - for it in json: - urls = [] - if it.get('tuningInstruction') and not it.get('mediasetstation$digitalOnly'): - guide=current_session.get('https://static3.mediasetplay.mediaset.it/apigw/nownext/' + it['callSign'] + '.json').json()['response'] - for key in it['tuningInstruction']['urn:theplatform:tv:location:any']: - urls += key['publicUrls'] - title = it['title'] - livedict[title] = {} - livedict[title]['urls'] = urls - livedict[title]['plot'] = support.typo(guide['currentListing']['mediasetlisting$epgTitle'],'bold') + '\n' + guide['currentListing']['mediasetlisting$shortDescription'] + '\n' + guide['currentListing']['description'] + '\n\n' + support.typo('A Seguire:' + guide['nextListing']['mediasetlisting$epgTitle'], 'bold') - return livedict - - -def live(item): - logger.debug() - itemlist = [] - for key, value in liveDict().items(): - itemlist.append(item.clone(title=support.typo(key, 'bold'), - fulltitle=key, - show=key, - contentTitle=key, - forcethumb=True, - urls=value['urls'], - plot=value['plot'], - action='play', - no_return=True)) - return support.thumb(itemlist, live=True) + return [] def peliculas(item): - logger.debug() itemlist = [] - titlelist = [] - contentType = '' - if item.text: - json = [] - itlist = [] - with futures.ThreadPoolExecutor() as executor: - for arg in ['searchMovie', 'searchStagioni', 'searchClip']: - item.args = ['', 'search', arg] - itlist += [executor.submit(get_programs, item)] - for res in futures.as_completed(itlist): - json += res.result() - else: - json = get_programs(item) - for it in json: - if item.search.lower() in it['title'].lower() and it['title'] not in titlelist: - titlelist.append(it['title']) - if 'media' in it: - action = 'findvideos' - contentType = 'movie' - urls = [] - for key in it['media']: - urls.append(key['publicUrl']) + res = get_programs(item) + video_id= '' + for it in res['items']: + thumb = '' + fanart = '' + contentSerieName = '' + url = 'https:'+ it.get('mediasettvseason$pageUrl', it.get('mediasetprogram$videoPageUrl', it.get('mediasetprogram$pageUrl'))) + title = it.get('mediasetprogram$brandTitle', it.get('title')) + title2 = it['title'] + if title != title2: + title = '{} - {}'.format(title, title2) + plot = it.get('longDescription', it.get('description', it.get('mediasettvseason$brandDescription', ''))) + + if it.get('seriesTitle'): + contentSerieName = it['seriesTitle'] + contentType = 'tvshow' + action = 'epmenu' + else: + contentType = 'movie' + video_id = it['guid'] + action = 'play' + for k, v in it['thumbnails'].items(): + if 'image_vertical' in k and not thumb: + thumb = v['url'].replace('.jpg', '@3.jpg') + if 'image_header_poster' in k and not fanart: + fanart = v['url'].replace('.jpg', '@3.jpg') + if thumb and fanart: + break + + itemlist.append(item.clone(title=support.typo(title, 'bold'), + fulltitle=title, + contentTitle=title, + contentSerieName=contentSerieName, + action=action, + contentType=contentType, + thumbnail=thumb, + fanart=fanart, + plot=plot, + url=url, + video_id=video_id, + seriesid = it.get('id',''), + forcethumb=True)) + if res['next']: + item.page = res['next'] + support.nextPage(itemlist, item) - else: - action = 'epmenu' - contentType = 'tvshow' - urls = it['mediasetprogram$brandId'] - if urls: - title = it['mediasetprogram$brandTitle'] + ' - ' if 'mediasetprogram$brandTitle' in it and it['mediasetprogram$brandTitle'] != it['title'] else '' - itemlist.append( - item.clone(channel=item.channel, - action=action, - title=support.typo(title + it['title'], 'bold'), - fulltitle=it['title'], - show=it['title'], - contentType=contentType if contentType else item.contentType, - contentTitle=it['title'] if 'movie' in [contentType, item.contentType] else '', - contentSerieName=it['title'] if 'tvshow' in [contentType, item.contentType] else '', - thumbnail=it['thumbnails']['image_vertical-264x396']['url'] if 'image_vertical-264x396' in it['thumbnails'] else '', - fanart=it['thumbnails']['image_keyframe_poster-1280x720']['url'] if 'image_keyframe_poster-1280x720' in it['thumbnails'] else '', - plot=it['longDescription'] if 'longDescription' in it else it['description'] if 'description' in it else '', - urls=urls, - seriesid = it.get('seriesId',''), - url=it['mediasetprogram$pageUrl'], - forcethumb=True, - no_return=True)) return itemlist - def epmenu(item): logger.debug() itemlist = [] if item.seriesid: - seasons = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-tv-seasons?bySeriesId=' + item.seriesid).json()['entries'] - for season in seasons: - if 'mediasettvseason$brandId' in season and 'mediasettvseason$displaySeason' in season: - itemlist.append( - item.clone(seriesid = '', - title=support.typo(season['mediasettvseason$displaySeason'], 'bold'), - urls=season['mediasettvseason$brandId'])) + res = requests.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-subbrands-v2?byTvSeasonId={}&sort=mediasetprogram$order'.format(item.seriesid)).json()['entries'] + for it in res: + itemlist.append( + item.clone(seriesid = '', + title=support.typo(it['description'], 'bold'), + subbrand=it['mediasetprogram$subBrandId'], + action='episodios')) itemlist = sorted(itemlist, key=lambda it: it.title, reverse=True) - if len(itemlist) == 1: return epmenu(itemlist[0]) - if not itemlist: - entries = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-brands?byCustomValue={brandId}{' + item.urls + '}').json()['entries'] - for entry in entries: - if 'mediasetprogram$subBrandId' in entry: - itemlist.append( - item.clone(action='episodios', - title=support.typo(entry['description'], 'bold'), - url=entry['mediasetprogram$subBrandId'], - order=entry.get('mediasetprogram$order',0))) if len(itemlist) == 1: return episodios(itemlist[0]) - itemlist = sorted(itemlist, key=lambda it: it.order) - return itemlist + return itemlist def episodios(item): - logger.debug() itemlist = [] - if not item.nextIndex: item.nextIndex = 1 + res = requests.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-programs-v2?byCustomValue={subBrandId}{' + item.subbrand +'}&sort=:publishInfo_lastPublished|asc,tvSeasonEpisodeNumber').json()['entries'] - url = 'https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-programs?byCustomValue={subBrandId}{'+ item.url + '}&range=' + str(item.nextIndex) + '-' + str(item.nextIndex + PAGINATION) - json = current_session.get(url).json()['entries'] + for it in res: + thumb = '' + title = '' + season = it.get('tvSeasonNumber','') + episode = it.get('tvSeasonEpisodeNumber','') - for it in json: - urls = [] - if 'media' in it: - for key in it['media']: - urls.append(key['publicUrl']) - if urls: - title = it['title'] - itemlist.append( - item.clone(action='findvideos', - title=support.typo(title, 'bold'), - contentType='episode', - thumbnail=it['thumbnails']['image_vertical-264x396']['url'] if 'image_vertical-264x396' in it['thumbnails'] else '', - fanart=it['thumbnails']['image_keyframe_poster-1280x720']['url'] if 'image_keyframe_poster-1280x720' in it['thumbnails'] else '', - plot=it['longDescription'] if 'longDescription' in it else it['description'], - urls=urls, - url=it['mediasetprogram$pageUrl'], - year=it.get('year',''), - ep= it.get('tvSeasonEpisodeNumber', 0) if it.get('tvSeasonEpisodeNumber', 0) else 0, - forcethumb=True, - no_return=True)) + ep_title = it['title'] + if season and episode: + title = '{}x{:02d} - {}'.format(season, episode, ep_title) + elif episode: + title = '{:02d} - {}'.format(episode, ep_title) + else: + title = ep_title + for k, v in it['thumbnails'].items(): + if 'image_keyframe' in k and not thumb: + thumb = v['url'].replace('.jpg', '@3.jpg') + break + if not thumb: thumb = item.thumbnail - if len(itemlist) == 1: return findvideos(itemlist[0]) + itemlist.append(item.clone(title=title, + contentSeason = season, + contentEpisodeNumber = episode, + thumbnail=thumb, + forcethumb=True, + contentType='episode', + action='play', + video_id=it['guid'])) - if (len(json) >= PAGINATION): - item.nextIndex += PAGINATION + 1 - support.nextPage(itemlist, item) + itemlist.sort(key=lambda it: (it.contentSeson, it.contentEpisodeNumber)) return itemlist -def findvideos(item): - logger.debug() - itemlist = [item.clone(server='directo', title='Mediaset Play', urls=item.urls, action='play')] - return support.server(item, itemlist=itemlist, Download=False) - - def play(item): logger.debug() - for url in item.urls: - sec_data = support.match(url + post_url).data + item.no_return=True + mpd = config.get_setting('mpd', item.channel) + post = {format} + + lic_url = 'https://widevine.entitlement.theplatform.eu/wv/web/ModularDrm/getRawWidevineLicense?releasePid={pid}&account=http://access.auth.theplatform.com/data/Account/2702976343&schema=1.0&token={token}|Accept=*/*&Content-Type=&User-Agent={ua}|R{{SSM}}|' + url = '' + + if item.video_id: + payload = '{"contentId":"' + item.video_id + ' ","streamType":"VOD","delivery":"Streaming","createDevice":true}' + res = session.post('https://api-ott-prod-fe.mediaset.net/PROD/play/playback/check/v2.0?sid=' + sid, data=payload).json()['response']['mediaSelector'] + url = res['url'] + Formats = res['formats'] + Format = res['format'] + mpd = True if 'dash' in Formats else False + else: + for it in item.urls: + if (mpd and it['format'] == 'application/dash+xml') or (not mpd and it['format'] == 'application/x-mpegURL'): + try: + url = it['publicUrls'][0] + break + except: + logger.debug('No url find for', 'mpd' if mpd else 'hls') + pass + + if url: + post = {} + post['format'] = Format + post['assetTypes'] = 'HD,browser,widevine,geoIT|geoNo:HD,browser,geoIT|geoNo:HD,geoIT|geoNo:SD,browser,widevine,geoIT|geoNo:SD,browser,geoIT|geoNo:SD,geoIT|geoNo' + if Format == 'SMIL': + post['auth'] = Token + post['formats'] = Formats + + sec_data = support.match(url + '?' + urlencode(post)).data item.url = support.match(sec_data, patron=r'<video src="([^"]+)').match pid = support.match(sec_data, patron=r'pid=([^|]+)').match - item.manifest = 'mpd' - if pid: + if mpd and pid: + item.manifest = 'mpd' item.drm = 'com.widevine.alpha' - item.license = lic_url % pid - break + item.license = lic_url.format(pid=pid, token=Token, ua=support.httptools.get_user_agent()) + else: + item.manifest = 'hls' - return [item] - - -def subBrand(json): - logger.debug() - subBrandId = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-brands?byCustomValue={brandId}{' + json + '}').json()['entries'][-1]['mediasetprogram$subBrandId'] - json = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-programs?byCustomValue={subBrandId}{' + subBrandId + '}').json()['entries'] - return json + return [item] def get_from_id(item): logger.debug() - json = current_session.get(entry.format(id=item.url)).json() - if 'components' in json: - id = quote(",".join(json["components"])) - json = current_session.get(entries.format(id=id)).json() - if 'entries' in json: - return json['entries'] + sessionKey = session.get(sessionUrl.format(uuid=str(uuid.uuid4())), verify=False).json()['sessionKey'] + session.headers.update({'x-session': sessionKey}) + res = session.get(entry.format(id=item.args)).json() + if 'components' in res: + id = quote(",".join(res["components"])) + res = session.get(entries.format(id=id)).json() + if 'entries' in res: + return res['entries'] return {} - -def get_programs(item, ret=[], args={}): - hasMore = False +def get_programs(item, ret={}, args={}): url = '' + pag = item.page if item.page else 1 - if 'search' in item.args: - args['uxReference'] = item.args[2] - args["query"] = item.text - args['traceCid'] = tracecid - args['cwId'] = cwid - args['page'] = 1 - args['platform'] = 'pc' - args['hitsPerPage'] = 500 - url = 'https://api-ott-prod-fe.mediaset.net/PROD/play/rec2/search/v1.0?' + urlencode(args) - elif not args: - if item.ref in cdict: - args['uxReference'] = cdict[item.ref] - args['platform'] = 'pc' - else: - args = {"query": "*:*"} - if item.args[2]: - args['categories'] = item.args[2] + if item.feed: + pag = item.page if item.page else 1 + url='{}&range={}-{}'.format(item.feed, pag, pag + 20 - 1) + ret['next'] = pag + 20 + res = requests.get(url).json() - args['cwId'] = cwid - args['traceCid'] = tracecid - args['hitsPerPage'] = 500 - args['page'] = '0' - args['deviceId'] = deviceid - url="https://api-ott-prod-fe.mediaset.net/PROD/play/rec2/cataloguelisting/v1.0?" + urlencode(args) - - # if 'all' in item.args: url = 'https://api-ott-prod-fe.mediaset.net/PROD/play/rec/azlisting/v1.0?' + urlencode(args) - if url: - json = current_session.get(url).json() - if 'response' in json: - json = json['response'] - if 'hasMore' in json: - hasMore = json['hasMore'] - if 'components' in json: - id = quote(",".join(json["components"])) - json = current_session.get(entries.format(id=id)).json() - if 'entries' in json: - ret += json['entries'] - if hasMore: - args['page'] = str(int(args['page']) + 1) - return get_programs(item, ret, args) - else: - return ret else: - return ret + args['uxReference'] = item.ref + args['params'] = item.params + args['query'] = item.query + args['context'] = 'platform≈web' + args['sid'] = sid + args['sessionId'] = sid + args['hitsPerPage'] = 20 + args['property'] = 'search' if item.query else 'play' + args['tenant'] = 'play-prod-v2' + args['page'] = pag + args['deviceId'] = '017ac511182d008322c989f3aac803083002507b00bd0' + url="https://api-ott-prod-fe.mediaset.net/PROD/play/reco/anonymous/v2.0?" + urlencode(args) + + res = session.get(url).json() + + + if res: + res = res.get('response', res) + if 'entries' in res: + ret['items'] = res['entries'] + elif 'blocks' in res: + items = [] + for block in res['blocks']: + items += block['items'] + ret['items'] = items + if not 'next' in ret: + next = res.get('pagination',{}).get('hasNextPage', False) + ret['next'] = pag + 1 if next else 0 + return ret + + + + + + diff --git a/core/support.py b/core/support.py index 338a94af..ee532e4f 100755 --- a/core/support.py +++ b/core/support.py @@ -24,6 +24,56 @@ from platformcode import config from platformcode.logger import info from platformcode import logger +channels_order = {'Rai 1': 1, + 'Rai 2': 2, + 'Rai 3': 3, + 'Rete 4': 4, + 'Canale 5': 5, + 'Italia 1': 6, + 'La7': 7, + 'NOVE': 9, + '20': 20, + 'Rai 4': 21, + 'Iris': 22, + 'Rai 5': 23, + 'Rai Movie': 24, + 'Rai Premium': 25, + 'Paramount': 27, + 'La7d': 29, + 'La 5': 30, + 'Real Time': 31, + 'Food Network': 33, + 'Cine34': 34, + 'Focus': 35, + 'Giallo': 38, + 'Top Crime': 39, + 'Boing': 40, + 'K2': 41, + 'Rai Gulp': 42, + 'Rai Yoyo': 43, + 'Frisbee': 44, + 'Cartoonito': 46, + 'Super': 46, + 'Rai News 24': 48, + 'Spike': 49, + 'TGCom': 51, + 'DMAX': 52, + 'Rai Storia': 54, + 'Mediaset Extra': 55, + 'Home and Garden TV': 56, + 'Rai Sport piu HD': 57, + 'Rai Sport': 58, + 'Motor Trend': 59, + 'Italia 2': 66, + 'VH1': 67, + 'Rai Scuola': 146, + 'Radio 105': 157, + 'R101tv': 167, + 'RMC': 256, + 'Virgin Radio': 257, + 'Rai Radio 2': 999, + } + def hdpass_get_servers(item): def get_hosts(url, quality): @@ -1414,6 +1464,7 @@ def get_jwplayer_mediaurl(data, srvName, onlyHttp=False, dataIsBlock=False): def thumb(item_itemlist_string=None, genre=False, live=False): from channelselector import get_thumb + if live: if type(item_itemlist_string) == list: for item in item_itemlist_string: @@ -1526,4 +1577,4 @@ def thumb(item_itemlist_string=None, genre=False, live=False): return autoselect_thumb(item_itemlist_string, genre) else: - return get_thumb('next.png') \ No newline at end of file + return get_thumb('next.png') diff --git a/specials/filmontv.py b/specials/filmontv.py index 9b059edc..9e73d328 100644 --- a/specials/filmontv.py +++ b/specials/filmontv.py @@ -262,6 +262,7 @@ def live(item): # make itemlist for ch in channel_list: itemlist += channels_dict[ch] + itemlist.sort(key=lambda it: support.channels_order[it.fulltitle]) return itemlist From 934aa0c0057f716a62bb57fde61ed191779839e3 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Thu, 29 Jul 2021 17:48:18 +0200 Subject: [PATCH 097/139] Fix Mediaset Play --- channels/mediasetplay.py | 125 +++++++++++++++++++++------------------ 1 file changed, 67 insertions(+), 58 deletions(-) diff --git a/channels/mediasetplay.py b/channels/mediasetplay.py index abac9da5..530776ba 100644 --- a/channels/mediasetplay.py +++ b/channels/mediasetplay.py @@ -2,19 +2,16 @@ # ------------------------------------------------------------ # Canale per Mediaset Play # ------------------------------------------------------------ -from time import time + from platformcode import logger, config import uuid, datetime, xbmc import requests, sys -from core import support, jsontools, tmdb +from core import support if sys.version_info[0] >= 3: from urllib.parse import urlencode, quote - from concurrent import futures else: from urllib import urlencode, quote - from concurrent_py2 import futures -from collections import OrderedDict host = 'https://www.mediasetplay.mediaset.it' loginUrl = 'https://api-ott-prod-fe.mediaset.net/PROD/play/idm/anonymous/login/v2.0' @@ -32,7 +29,6 @@ entry = 'https://api.one.accedo.tv/content/entry/{id}?locale=it' entries = 'https://api.one.accedo.tv/content/entries?id={id}&locale=it' # login anonimo -# support.dbg() res = session.post(loginUrl, json=loginData, verify=False) Token = res.json()['response']['beToken'] sid = res.json()['response']['sid'] @@ -60,7 +56,6 @@ def menu(item): itemlist = [] res = get_from_id(item) for it in res: - logger.debug(jsontools.dump(it)) if 'uxReference' in it: itemlist.append(item.clone(title=support.typo(it['title'], 'bullet bold'), url= it['landingUrl'], @@ -85,14 +80,14 @@ def live(item): url = 'https:' + it['mediasetstation$pageUrl'] if 'plus' in title.lower() or 'premium' in title.lower(): continue if it['callSign'] in allguide: - urls = [] + guide = allguide[it['callSign']] plot = '[B]{}[/B]\n{}\n\nA Seguire:\n[B]{}[/B]\n{}'.format(guide['currentListing']['mediasetlisting$epgTitle'], guide['currentListing']['description'], guide['nextListing']['mediasetlisting$epgTitle'], guide['nextListing']['description'],) - itemlist.append(item.clone(title=support.typo(title, 'bold'), fulltitle=title, urls=guide['tuningInstruction']['urn:theplatform:tv:location:any'], plot=plot, url=url, action='play', forcethumb=True)) + itemlist.append(item.clone(title=support.typo(title, 'bold'), fulltitle=title, callSign=it['callSign'], urls=guide['tuningInstruction']['urn:theplatform:tv:location:any'], plot=plot, url=url, action='play', forcethumb=True)) itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999)) support.thumb(itemlist, live=True) @@ -118,7 +113,9 @@ def peliculas(item): itemlist = [] res = get_programs(item) video_id= '' + for it in res['items']: + if not 'MediasetPlay_ANY' in it.get('mediasetprogram$channelsRights',['MediasetPlay_ANY']): continue thumb = '' fanart = '' contentSerieName = '' @@ -129,8 +126,8 @@ def peliculas(item): title = '{} - {}'.format(title, title2) plot = it.get('longDescription', it.get('description', it.get('mediasettvseason$brandDescription', ''))) - if it.get('seriesTitle'): - contentSerieName = it['seriesTitle'] + if it.get('seriesTitle') or it.get('seriesTvSeasons'): + contentSerieName = it.get('seriesTitle', it.get('title')) contentType = 'tvshow' action = 'epmenu' else: @@ -156,7 +153,7 @@ def peliculas(item): plot=plot, url=url, video_id=video_id, - seriesid = it.get('id',''), + seriesid = it.get('seriesTvSeasons', it.get('id','')), forcethumb=True)) if res['next']: item.page = res['next'] @@ -168,36 +165,47 @@ def epmenu(item): logger.debug() itemlist = [] + epUrl = 'https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-subbrands-v2?byTvSeasonId={}&sort=mediasetprogram$order' + if item.seriesid: - res = requests.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-subbrands-v2?byTvSeasonId={}&sort=mediasetprogram$order'.format(item.seriesid)).json()['entries'] - for it in res: - itemlist.append( - item.clone(seriesid = '', - title=support.typo(it['description'], 'bold'), - subbrand=it['mediasetprogram$subBrandId'], - action='episodios')) - itemlist = sorted(itemlist, key=lambda it: it.title, reverse=True) - if len(itemlist) == 1: return episodios(itemlist[0]) + if type(item.seriesid) == list: + res = [] + for s in item.seriesid: + itemlist.append( + item.clone(seriesid = s['id'], + title=support.typo(s['title'], 'bold'))) + if len(itemlist) == 1: return epmenu(itemlist[0]) + else: + res = requests.get(epUrl.format(item.seriesid)).json()['entries'] + for it in res: + itemlist.append( + item.clone(seriesid = '', + title=support.typo(it['description'], 'bold'), + subbrand=it['mediasetprogram$subBrandId'], + action='episodios')) + itemlist = sorted(itemlist, key=lambda it: it.title, reverse=True) + if len(itemlist) == 1: return episodios(itemlist[0]) return itemlist def episodios(item): + # create month list + months = [] + try: + for month in range(21, 33): months.append(xbmc.getLocalizedString(month)) + except: # per i test, xbmc.getLocalizedString non è supportato + for month in range(21, 33): months.append('dummy') + itemlist = [] res = requests.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-programs-v2?byCustomValue={subBrandId}{' + item.subbrand +'}&sort=:publishInfo_lastPublished|asc,tvSeasonEpisodeNumber').json()['entries'] for it in res: thumb = '' - title = '' - season = it.get('tvSeasonNumber','') - episode = it.get('tvSeasonEpisodeNumber','') - - ep_title = it['title'] - if season and episode: - title = '{}x{:02d} - {}'.format(season, episode, ep_title) - elif episode: - title = '{:02d} - {}'.format(episode, ep_title) - else: - title = ep_title + titleDate = '' + if 'mediasetprogram$publishInfo_lastPublished' in it: + date = datetime.date.fromtimestamp(it['mediasetprogram$publishInfo_lastPublished'] / 1000) + titleDate =' [{} {}]'.format(date.day, months[date.month]) + title = '[B]{}[/B]{}'.format(it['title'], titleDate) for k, v in it['thumbnails'].items(): if 'image_keyframe' in k and not thumb: thumb = v['url'].replace('.jpg', '@3.jpg') @@ -205,16 +213,12 @@ def episodios(item): if not thumb: thumb = item.thumbnail itemlist.append(item.clone(title=title, - contentSeason = season, - contentEpisodeNumber = episode, thumbnail=thumb, forcethumb=True, contentType='episode', action='play', video_id=it['guid'])) - itemlist.sort(key=lambda it: (it.contentSeson, it.contentEpisodeNumber)) - return itemlist @@ -222,37 +226,43 @@ def play(item): logger.debug() item.no_return=True mpd = config.get_setting('mpd', item.channel) - post = {format} + lic_url = 'https://widevine.entitlement.theplatform.eu/wv/web/ModularDrm/getRawWidevineLicense?releasePid={pid}&account=http://access.auth.theplatform.com/data/Account/2702976343&schema=1.0&token={token}|Accept=*/*&Content-Type=&User-Agent={ua}|R{{SSM}}|' url = '' - if item.video_id: + if item.urls: + url = '' + pid = '' + Format = 'dash+xml' if mpd else 'x-mpegURL' + for it in item.urls: + if Format in it['format']: + item.url = requests.head(it['publicUrls'][0]).headers['Location'] + pid = it['releasePids'][0] + + if mpd: + item.manifest = 'mpd' + item.drm = 'com.widevine.alpha' + item.license = lic_url.format(pid=pid, token=Token, ua=support.httptools.get_user_agent()) + + else: + item.manifest = 'hls' + return[item] + + elif item.video_id: payload = '{"contentId":"' + item.video_id + ' ","streamType":"VOD","delivery":"Streaming","createDevice":true}' res = session.post('https://api-ott-prod-fe.mediaset.net/PROD/play/playback/check/v2.0?sid=' + sid, data=payload).json()['response']['mediaSelector'] - url = res['url'] - Formats = res['formats'] - Format = res['format'] - mpd = True if 'dash' in Formats else False + else: - for it in item.urls: - if (mpd and it['format'] == 'application/dash+xml') or (not mpd and it['format'] == 'application/x-mpegURL'): - try: - url = it['publicUrls'][0] - break - except: - logger.debug('No url find for', 'mpd' if mpd else 'hls') - pass + payload = '{"channelCode":"' + item.callSign + '","streamType":"LIVE","delivery":"Streaming","createDevice":true}' + res = session.post('https://api-ott-prod-fe.mediaset.net/PROD/play/playback/check/v2.0?sid=' + sid, data=payload).json()['response']['mediaSelector'] + + url = res['url'] + mpd = True if 'dash' in res['formats'].lower() else False if url: - post = {} - post['format'] = Format - post['assetTypes'] = 'HD,browser,widevine,geoIT|geoNo:HD,browser,geoIT|geoNo:HD,geoIT|geoNo:SD,browser,widevine,geoIT|geoNo:SD,browser,geoIT|geoNo:SD,geoIT|geoNo' - if Format == 'SMIL': - post['auth'] = Token - post['formats'] = Formats - sec_data = support.match(url + '?' + urlencode(post)).data + sec_data = support.match(url + '?' + urlencode(res)).data item.url = support.match(sec_data, patron=r'<video src="([^"]+)').match pid = support.match(sec_data, patron=r'pid=([^|]+)').match @@ -304,7 +314,6 @@ def get_programs(item, ret={}, args={}): res = session.get(url).json() - if res: res = res.get('response', res) if 'entries' in res: From 23bc83cd1b798826ff02dbff99ca25b02381b668 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Thu, 29 Jul 2021 18:16:26 +0200 Subject: [PATCH 098/139] Mediaset Play: - aggiunta Sezione Film - disabilitati Download e Videoteca --- channels/mediasetplay.py | 26 +++++++++++--------------- platformcode/platformtools.py | 4 ++-- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/channels/mediasetplay.py b/channels/mediasetplay.py index 530776ba..0fdaa84a 100644 --- a/channels/mediasetplay.py +++ b/channels/mediasetplay.py @@ -43,7 +43,8 @@ session.headers.update({'x-session': sessionKey}) def mainlist(item): top = [('Dirette {bold}', ['', 'live'])] - menu = [('Fiction / Serie TV {bullet bold}', ['/fiction', 'menu', '5acfcb3c23eec6000d64a6a4', 'tvshow']), + menu = [('Film {bullet bold}', ['/cinema', 'peliculas', {'uxReference':'filmUltimiArrivi'}, 'movie']), + ('Fiction / Serie TV {bullet bold}', ['/fiction', 'menu', '5acfcb3c23eec6000d64a6a4', 'tvshow']), ('Programmi TV{ bullet bold}', ['/programmitv', 'menu', '5acfc8011de1c4000b6ec953', 'tvshow']), ('Documentari {bullet bold}', ['/documentari', 'menu', '5bfd17c423eec6001aec49f9', 'undefined']), ('Kids {bullet bold}', ['/kids', 'menu', '5acfcb8323eec6000d64a6b3', 'undefined'])] @@ -59,10 +60,7 @@ def menu(item): if 'uxReference' in it: itemlist.append(item.clone(title=support.typo(it['title'], 'bullet bold'), url= it['landingUrl'], - feed = it.get('feedurlV2',''), - ref=it.get('uxReferenceV2', ''), - params=it.get('uxReferenceV2Params', ''), - args='', + args={'uxReference':it.get('uxReferenceV2', ''), 'params':it.get('uxReferenceV2Params', ''), 'feed':it.get('feedurlV2','')}, action='peliculas')) return itemlist @@ -95,9 +93,7 @@ def live(item): def search(item, text): - item.ref = 'main' - item.query = text - item.params = 'channel≈' + item.args = {'uxReference':'main', 'params':'channel≈', 'query':text} try: return peliculas(item) @@ -154,6 +150,7 @@ def peliculas(item): url=url, video_id=video_id, seriesid = it.get('seriesTvSeasons', it.get('id','')), + disable_videolibrary = True, forcethumb=True)) if res['next']: item.page = res['next'] @@ -288,25 +285,24 @@ def get_from_id(item): return res['entries'] return {} -def get_programs(item, ret={}, args={}): +def get_programs(item): url = '' pag = item.page if item.page else 1 + ret = {} - if item.feed: + if item.args.get('feed'): pag = item.page if item.page else 1 - url='{}&range={}-{}'.format(item.feed, pag, pag + 20 - 1) + url='{}&range={}-{}'.format(item.args.get('feed'), pag, pag + 20 - 1) ret['next'] = pag + 20 res = requests.get(url).json() else: - args['uxReference'] = item.ref - args['params'] = item.params - args['query'] = item.query + args = {key:value for key, value in item.args.items()} args['context'] = 'platform≈web' args['sid'] = sid args['sessionId'] = sid args['hitsPerPage'] = 20 - args['property'] = 'search' if item.query else 'play' + args['property'] = 'search' if args.get('query') else 'play' args['tenant'] = 'play-prod-v2' args['page'] = pag args['deviceId'] = '017ac511182d008322c989f3aac803083002507b00bd0' diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 81f7c69c..915e55ed 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -614,7 +614,7 @@ def set_context_commands(item, item_url, parent_item, **kwargs): context_commands.append((config.get_localized_string(60350), "Container.Refresh (%s?%s&%s)" % (sys.argv[0], item_url, urllib.urlencode({'channel': 'search', 'action': "from_context", 'from_channel': item.channel, 'contextual': True, 'text': item.wanted})))) context_commands.append( (config.get_localized_string(70561), "Container.Update (%s?%s&%s)" % (sys.argv[0], item_url, 'channel=search&action=from_context&search_type=list&page=1&list_type=%s/%s/similar' % (mediatype, item.infoLabels['tmdb_id'])))) - if item.channel != "videolibrary" and item.videolibrary != False: + if item.channel != "videolibrary" and item.videolibrary != False and not item.disable_videolibrary: # Add Series to the video library if item.action in ["episodios", "get_episodios", "get_seasons"] and item.contentSerieName: context_commands.append((config.get_localized_string(60352), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_serie_to_library&from_action=' + item.action))) @@ -625,7 +625,7 @@ def set_context_commands(item, item_url, parent_item, **kwargs): elif item.action in ['check'] and item.contentTitle: context_commands.append((config.get_localized_string(30161), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_to_library&from_action=' + item.action))) - if not item.local and item.channel not in ["downloads", "filmontv", "search"] and item.server != 'torrent' and parent_item.action != 'mainlist' and config.get_setting('downloadenabled'): + if not item.local and item.channel not in ["downloads", "filmontv", "search"] and item.server != 'torrent' and parent_item.action != 'mainlist' and config.get_setting('downloadenabled') and not item.disable_videolibrary: # Download movie if item.contentType == "movie": context_commands.append((config.get_localized_string(60354), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'channel=downloads&action=save_download&from_channel=' + item.channel + '&from_action=' + item.action))) From 46f06dea2d6b5246b4c2aba84daf6f43186b6912 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Thu, 29 Jul 2021 17:45:03 +0000 Subject: [PATCH 099/139] {Aggiornamento domini} --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index ebb2b4b6..a1058fef 100644 --- a/channels.json +++ b/channels.json @@ -21,7 +21,7 @@ "eurostreaming": "https://eurostreaming.bar", "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", - "guardaserieclick": "https://www.guardaserie.services", + "guardaserieclick": "https://www.guardaserie.builders", "guardaserieicu": "https://guardaserie.blog", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", From 12525d5791e3cd67625f565fa56349b167104754 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 30 Jul 2021 17:49:09 +0200 Subject: [PATCH 100/139] Mediaset Play: gestione paginazione da impostazioni canale --- channels/mediasetplay.json | 11 ++++++++++- channels/mediasetplay.py | 8 +++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/channels/mediasetplay.json b/channels/mediasetplay.json index c482bf94..e92fc4e5 100644 --- a/channels/mediasetplay.json +++ b/channels/mediasetplay.json @@ -16,6 +16,15 @@ "default": true, "enabled": true, "visible": true - } + }, + { + "id": "pagination", + "type": "list", + "label": "Pagination", + "default": 1, + "enabled": true, + "visible": true, + "lvalues": ["10", "20", "30", "40", "50", "60", "70", "80", "90", "100"] + } ] } diff --git a/channels/mediasetplay.py b/channels/mediasetplay.py index 0fdaa84a..485d3acf 100644 --- a/channels/mediasetplay.py +++ b/channels/mediasetplay.py @@ -38,6 +38,8 @@ session.headers.update({'authorization': 'Bearer ' + Token}) sessionKey = session.get(sessionUrl.format(uuid=str(uuid.uuid4())), verify=False).json()['sessionKey'] session.headers.update({'x-session': sessionKey}) +pagination = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100][config.get_setting('pagination', 'mediasetplay')] + @support.menu def mainlist(item): @@ -292,8 +294,8 @@ def get_programs(item): if item.args.get('feed'): pag = item.page if item.page else 1 - url='{}&range={}-{}'.format(item.args.get('feed'), pag, pag + 20 - 1) - ret['next'] = pag + 20 + url='{}&range={}-{}'.format(item.args.get('feed'), pag, pag + pagination - 1) + ret['next'] = pag + pagination res = requests.get(url).json() else: @@ -301,7 +303,7 @@ def get_programs(item): args['context'] = 'platform≈web' args['sid'] = sid args['sessionId'] = sid - args['hitsPerPage'] = 20 + args['hitsPerPage'] = pagination args['property'] = 'search' if args.get('query') else 'play' args['tenant'] = 'play-prod-v2' args['page'] = pag From 24cdd4793c86f272528d2ceb67544fc14cfcb8d8 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 30 Jul 2021 17:49:23 +0200 Subject: [PATCH 101/139] Riscritto Rai Play --- channels/raiplay.py | 569 +++++++++++++++++--------------------------- 1 file changed, 213 insertions(+), 356 deletions(-) diff --git a/channels/raiplay.py b/channels/raiplay.py index 14340edc..e9a9f374 100644 --- a/channels/raiplay.py +++ b/channels/raiplay.py @@ -3,35 +3,35 @@ # Canale per Rai Play # ------------------------------------------------------------ -import requests, sys, inspect -from core import support, channeltools -from platformcode import autorenumber, logger, platformtools -from collections import OrderedDict +from core.item import Item +import datetime, xbmc +import requests, sys + +from core import jsontools, support +from platformcode import logger + if sys.version_info[0] >= 3: from concurrent import futures else: from concurrent_py2 import futures -current_session = requests.Session() host = support.config.get_channel_url() -onair = host + '/palinsesto/onAir.json' - @support.menu def mainlist(item): - top = [('Dirette {bold}', ['', 'live']), - ('Replay {bold}', ['/dl/RaiPlay/2016/PublishingBlock-9a2ff311-fcf0-4539-8f8f-c4fee2a71d58.html?json', 'replay_menu'])] + top = [('Dirette {bold}', ['/dirette', 'live', '/palinsesto/onAir.json']), + ('Replay {bold}', ['/guidatv', 'replayMenu', '/guidatv.json'])] - menu = [('Film {bullet bold}', ['/tipologia/film/index.json', 'menu']), - ('Serie TV {bullet bold}', ['/tipologia/serietv/index.json', 'menu']), - ('Fiction {bullet bold}', ['/tipologia/fiction/index.json', 'menu']), - ('Documentari {bullet bold}', ['/tipologia/documentari/index.json', 'menu']), - ('Programmi TV{bullet bold}', ['/tipologia/programmi/index.json', 'menu']), - ('Programmi per Bambini {bullet bold}', ['/tipologia/bambini/index.json', 'menu']), - ('Teen {bullet bold}', ['/tipologia/teen/index.json', 'learning']), - ('Learning {bullet bold}', ['/tipologia/learning/index.json', 'learning']), - ('Teche Rai {bullet bold storia}', ['/tipologia/techerai/index.json', 'menu']), - ('Musica e Teatro {bullet bold}', ['/tipologia/musica-e-teatro/index.json', 'menu']) + menu = [('Film {bullet bold}', ['/film', 'menu', '/tipologia/film/index.json']), + ('Serie TV {bullet bold}', ['/serietv', 'menu', '/tipologia/serietv/index.json']), + ('Fiction {bullet bold}', ['/fiction', 'menu', '/tipologia/fiction/index.json']), + ('Documentari {bullet bold}', ['/documentari', 'menu', '/tipologia/documentari/index.json']), + ('Programmi TV{bullet bold}', ['/programmi', 'menu', '/tipologia/programmi/index.json']), + ('Programmi per Bambini {bullet bold}', ['/bambini', 'menu', '/tipologia/bambini/index.json']), + ('Teen {bullet bold}', ['/teen', 'menu', '/tipologia/teen/index.json']), + ('Learning {bullet bold}', ['/learning', 'menu', '/tipologia/learning/index.json']), + ('Teche Rai {bullet bold storia}', ['/techerai', 'menu', '/tipologia/techerai/index.json']), + ('Musica e Teatro {bullet bold}', ['/musica-e-teatro', 'menu', '/tipologia/musica-e-teatro/index.json']) ] search = '' @@ -40,46 +40,107 @@ def mainlist(item): def menu(item): - support.info() - itemlist = [item.clone(title = support.typo('Tutti','bullet bold'), action = 'peliculas'), - item.clone(title = support.typo('Generi','submenu'), args = 'genre', action = 'submenu'), - item.clone(title = support.typo('A-Z','submenu'), args = 'az', action = 'submenu'), - item.clone(title = support.typo('Cerca','submenu'), action = 'search')] + logger.debug() + itemlist = [] + item.disable_videolibrary = True + action = 'peliculas' - return support.thumb(itemlist) + if item.data: + for it in item.data: + if 'sets' in it: + action = 'episodios' + itemlist.append(item.clone(title=support.typo(it['name'], 'bold'), data=[it], action=action)) + support.thumb(itemlist, genre=True) + else: + items = item.data if item.data else requests.get(host + item.args).json()['contents'] + for it in items: + if 'RaiPlay Slider Block' in it['type']: + thumb = item.thumbnail + if 'Generi' in it['name']: + action = 'menu' + thumb = support.thumb('genres') + itemlist.append(item.clone(title=support.typo(it['name'], 'bold'), data=it.get('contents', item.data), thumbnail=thumb, action=action)) - -def learning(item): - support.info() - itemlist =[] - json = current_session.get(item.url).json()['contents'] - for key in json: - itemlist.append(item.clone(title = support.typo(key['name'],'bold'), fulltitle = key['name'], - show = key['name'], data = key['contents'], action = 'peliculas')) return itemlist -def submenu(item): - support.info() +def search(item, text): + logger.debug(text) + post = {'page':0, 'pagesize': 1000, 'param':text} + + try: + item.data = requests.post(host + '/atomatic/raiplay-search-service/api/v3/search', json=post).json()['agg']['titoli']['cards'] + return peliculas(item) + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.logger.error("%s" % line) + return [] + + +def peliculas(item): + logger.debug() + return addinfo(item.data, item) + + +def episodios(item): + logger.debug() itemlist = [] - json = current_session.get(item.url).json()['contents'][-1]['contents'] - if item.args == 'az': - json_url = getUrl(json[-1]['path_id']) - json = current_session.get(json_url).json()['contents'] - for key in json: - itemlist.append(item.clone(title = support.typo(key,'bold'), fulltitle = key, - show = key, data = json[key], action = 'peliculas')) - else: - for key in json: - itemlist.append(item.clone(title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'], - thumbnail = getUrl(key['image']), url = getUrl(key['path_id']), action = 'peliculas')) - itemlist.pop(-1) - return support.thumb(itemlist) + + if item.data: + items = item.data + elif item.season_url: + items = requests.get(item.season_url).json()['items'] + elif item.video_url: + items = requests.get(item.video_url).json()['blocks'] + + if 'sets' in items[0]: + if len(items) > 1: + itemlist = epMenu(item.clone(data=items)) + else: + if len(items[0]['sets']) > 1: + itemlist = epMenu(item.clone(data=items[0]['sets'])) + else: + items = requests.get(getUrl(items[0]['sets'][0]['path_id'])).json()['items'] + + if not itemlist: + itemlist = addinfo(items, item) + + return itemlist -def replay_menu(item): - support.info() - import datetime, xbmc +def epMenu(item): + video_url = '' + itemlist = [] + for it in item.data: + if 'sets' in it: + itemlist.append(item.clone(title=support.typo(it['name'], 'bold'), data=[it])) + else: + itemlist.append(item.clone(title=support.typo(it['name'], 'bold'), season_url=getUrl(it['path_id']), data='')) + return itemlist + + +def live(item): + logger.debug() + itemlist = [] + item.forcethumb = True + items = requests.get(getUrl(item.args)).json()['on_air'] + for it in items: + title = it['channel'] + url = '{}/dirette/{}'.format(host, title.lower().replace(' ','')) + fanart = getUrl(it['currentItem']['image']) + current = it['currentItem'] + next = it['nextItem'] + plot = '[B]{}[/B]\n{}\n\nA Seguire: [B]{}[/B]\n{}'.format(current['name'], current['description'], next['name'], next['description']) + itemlist.append(item.clone(title=title, fulltitle=title, fanart=fanart, plot=plot, url=url, video_url=url + '.json', action='play')) + itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999)) + support.thumb(itemlist, live=True) + return itemlist + + +def replayMenu(item): + logger.debug() # create day and month list days = [] @@ -98,337 +159,133 @@ def replay_menu(item): today = datetime.date.today() for d in range(7): day = today - datetime.timedelta(days=d) - support.info(day) - itemlist.append(item.clone(action = 'replay_channels', date = day.strftime("%d-%m-%Y"), - title = support.typo(days[int(day.strftime("%w"))] + " " + day.strftime("%d") + " " + months[int(day.strftime("%m"))-1], 'bold'))) + dayName = days[int(day.strftime("%w"))] + dayNumber = day.strftime("%d") + monthName = months[int(day.strftime("%m"))-1] + title = '{} {} {}'.format(dayName, dayNumber, monthName) + itemlist.append(item.clone(title = support.typo(title, 'bold'), + action='replayChannels', + date=day.strftime("%d-%m-%Y"))) return itemlist -def replay_channels(item): - support.info() +def replayChannels(item): + logger.debug() itemlist = [] - json = current_session.get(item.url).json()['dirette'] - for key in json: - itemlist.append(item.clone(title = support.typo(key['channel'], 'bold'), fulltitle = key['channel'], show = key['channel'], plot = item.title, action = 'replay', - thumbnail = key['transparent-icon'].replace("[RESOLUTION]", "256x-"), url = '%s/palinsesto/app/old/%s/%s.json' % (host, key['channel'].lower().replace(' ','-'), item.date))) - return itemlist + items = requests.get(getUrl(item.args)).json()['channels'] - -def replay(item): - support.info() - itemlist = [] - json = current_session.get(item.url).json()[item.fulltitle][0]['palinsesto'][0]['programmi'] - for key in json: - support.info('KEY=',key) - if key and key['pathID']: itemlist.append(item.clone(thumbnail = getUrl(key['images']['landscape']), fanart = getUrl(key['images']['landscape']), url = getUrl(key['pathID']), fulltitle = key['name'], show = key['name'], - title = support.typo(key['timePublished'], 'color kod bold') + support.typo(' | ' + key['name'], ' bold'), plot = key['testoBreve'], action = 'findvideos')) - return itemlist - -def search(item, text): - support.info() - itemlist =[] - try: - if item.url != host: - item.search = text - itemlist = peliculas(item) - else: - json = current_session.get(host + '/dl/RaiTV/RaiPlayMobile/Prod/Config/programmiAZ-elenco.json').json() - for key in json: - for key in json[key]: - if 'PathID' in key and (text.lower() in key['name'].lower()): - itemlist.append(item.clone(title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'], url = key['PathID'].replace('/?json', '.json'), action = 'Type', - thumbnail = getUrl(key['images']['portrait'] if 'portrait' in key['images'] else key['images']['portrait43'] if 'portrait43' in key['images'] else key['images']['landscape']), - fanart = getUrl(key['images']['landscape'] if 'landscape' in key['images'] else key['images']['landscape43']))) - except: - import sys - for line in sys.exc_info(): - support.logger.error("%s" % line) - return [] - return itemlist - - -def Type(item): - logger.debug(item.url) - json = current_session.get(item.url).json() - if json['program_info']['layout'] == 'single': - item.contentTitle = item.fulltitle - item.contentType = 'movie' - return findvideos(item) - else: - item.contentType = 'tvshow' - return select(item) - - -def liveDict(): - livedict = OrderedDict({}) - info = {} - url = host + '/dirette.json' - json = current_session.get(url).json()['contents'] - onAir = current_session.get(onair).json()['on_air'] - for key in onAir: - channel = key['channel'] - info[channel] = {} - info[channel]['fanart'] = getUrl(key['currentItem']['image']) - info[channel]['plot'] = support.typo(key['currentItem']['name'],'bold')+ '\n\n' + key['currentItem']['description'] - for key in json: - channel = key['channel'] - livedict[channel] = {} - livedict[channel]['url'] = key['video']['content_url'] - livedict[channel]['plot'] = info[channel]['plot'] - livedict[channel]['fanart'] = info[channel]['fanart'] - - return livedict - - -def live(item): - support.info() - itemlist =[] - for channel, value in liveDict().items(): - itemlist.append(item.clone(title = support.typo(channel, 'bold'), fulltitle = channel, show = channel, url = value['url'], - plot = value['plot'], action = 'play', fanart = value['fanart'], manifest='hls', forcethumb=True, no_return=True)) + for it in items: + if 'RaiPlay' in it['name']: continue + url = '{}?channel={}&date={}'.format(item.url, it['absolute_path'], item.date) + channel_url = '{}/palinsesto/app/{}/{}.json'.format(host, it['absolute_path'], item.date) + itemlist.append(item.clone(title=support.typo(it['label'], 'bold'), + fulltitle=it['label'], + url=url, + channel_url=channel_url, + action='replay')) + itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999)) support.thumb(itemlist, live=True) return itemlist +def replay(item): + logger.debug() + + def itInfo(it): + info = requests.get(getUrl(it['program']['info_url'])).json() + image = getUrl(info['images']['landscape']) + return item.clone(title = '{} - {}'.format(it['hour'], it['name']), + thumbnail = image, + fanart = image, + plot = info['description'], + url = getUrl(it['weblink']), + video_url = getUrl(it['path_id']), + action = 'play', + forcethumb = True) + -def peliculas(item): - support.info() itemlist = [] - keys = [] - key_list = [] - - # pagination options - pag = item.page if item.page else 1 - pagination = 40 if not item.search else '' - - # load json - if item.data: - json = item.data - for key in json: - if item.search.lower() in key['name'].lower(): - keys.append(key) - else: - json = current_session.get(item.url).json() - - # load json for main menu item - if not item.args: - json_url = getUrl(json['contents'][-1]['contents'][-1]['path_id']) - json = current_session.get(json_url).json()['contents'] - else: - json = json['contents'] - for key in json: - if len(json[key]) > 0: - for key in json[key]: - if item.search.lower() in key['name'].lower(): - keys.append(key) - - # load titles - for i, key in enumerate(keys): - if pagination and (pag - 1) * pagination > i: continue # pagination - if pagination and i >= pag * pagination: break - key_list.append(key) + items = requests.get(item.channel_url).json().get('events', {}) + now = datetime.datetime.now() + h = int('{}{:02d}'.format(now.hour, now.minute)) with futures.ThreadPoolExecutor() as executor: - itlist = [executor.submit(addinfo, key, item) for key in key_list] + itlist = [executor.submit(itInfo, it) for it in items if it['has_video'] and int(it['hour'].replace(':','')) <= h] for res in futures.as_completed(itlist): if res.result(): itemlist.append(res.result()) - itemlist = sorted(itemlist, key=lambda it: it.title) - - if not item.search and len(keys) > pag * pagination: - itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), page=pag + 1, thumbnail=support.thumb())) + if not itemlist: + return [Item(title='Non ci sono Replay per questo Canale')] return itemlist +def play(item): + logger.debug() -def select(item): - support.info() - itemlist = [] - if type(item.data) in [list, dict]: - json = item.data - else: - json = current_session.get(item.url).json() - if 'blocks' in json: - json = json['blocks'] - season = '' - for key in json: - if item.fulltitle in key['name']: season = key['name'].replace(item.fulltitle, '').strip() - if not season.isdigit(): season = '' - itemlist.append(item.clone(title = support.typo(key['name'],'bold'), season = season, data = key['sets'], action = 'select')) - if len(itemlist) == 1: - return select(itemlist[0]) - else: - if item.data: - for key in item.data: - itemlist.append(item.clone(title = support.typo(key['name'], 'bold'), data = getUrl(key['path_id']), url = getUrl(key['path_id']), contentType = 'tvshow', action = 'episodios')) - if len(itemlist) == 1: - return episodios(itemlist[0]) - elif 'contents' in json: - for letter in json['contents'].keys(): - if json['contents'][letter]: - itemlist.extend(peliculas(item.clone(data=json['contents'][letter]))) - return itemlist + res = requests.get(item.video_url).json() + + if 'first_item_path' in res: + res = requests.get(getUrl(res['first_item_path'])).json() + + url, lic = support.match(res['video']['content_url'] + '&output=56', patron=r'content"><!\[CDATA\[([^\]]+)(?:.*?"WIDEVINE","licenceUrl":"([^"]+))?').match + + if lic: + item.drm = 'com.widevine.alpha' + item.license = lic + '|' + host + '|R{SSM}|' + + item = item.clone(server='directo', url=url, no_return=True, manifest='hls') + + return [item] -def episodios(item): - support.info() - itemlist = [] - if type(item.data) in [list, dict] and len(item.data) > 1 and ('name' in item.data[0] and 'stagione' not in item.data[0]['name'].lower()): - for key in item.data: - itemlist.append(item.clone(title = support.typo(key['name'], 'bold'), url = getUrl(key['path_id']), contentType = 'tvshow', action = 'episodios')) +def getUrl(url): + logger.debug() - elif type(item.data) in [list, dict]: - for key in item.data: - load_episodes(key, item) - with futures.ThreadPoolExecutor() as executor: - itlist = [executor.submit(load_episodes, key, item) for key in item.data] - for res in futures.as_completed(itlist): - if res.result(): - itemlist += res.result() - if itemlist and itemlist[0].VL: - # itemlist.reverse() - itemlist = sorted(itemlist, key=lambda it: it.order) - item.action = 'episodios' - support.videolibrary(itemlist, item) - else: - itemlist = sorted(itemlist, key=lambda it: it.title) + if url.startswith("/raiplay/"): url = url.replace("/raiplay/", host +'/') + elif url.startswith("//"): url = "https:" + url + elif url.startswith("/"): url = host + url - else: - date = '' - if type(item.data) in [list, dict]: item.data = getUrl(item.url[0]['path_id']) - json = current_session.get(item.url).json()['items'] - for key in json: - ep = support.match(key['subtitle'], patron=r'(?:St\s*(\d+))?\s*Ep\s*(\d+)').match - if ep: - season = '1' if not ep[0] else ep[0] - episode = ep[1].zfill(2) - title = support.re.sub(r'(?:St\s*\d+)?\s*Ep\s*\d+','',key['subtitle']) - title = season + 'x' + episode + (' - ' + title if not title.startswith(' ') else title if title else '') - elif item.season and support.match(item.title.lower(), patron =r'(puntate)').match: - title = key['subtitle'].strip() - if not title: title = key['name'] - date = support.match(title, patron=r'(\d+/\d+/\d+)').match - if date: - date = title.split('/') - date = date[2][-2] + '/' + date[1] + '/' + date[0] - - else: - title = key['subtitle'].strip() - if not title: - title = key['name'] - itemlist.append(item.clone(title = support.typo(title, 'bold'), action = 'findvideos', VL=True if ep else False, plot = key['description'], - fanart = getUrl(key['images']['landscape']), url = key['video_url'], contentType = 'episode', date=date)) - - if item.season and support.match(item.title.lower(), patron =r'(puntate)').match: - itemlist = sorted(itemlist, key=lambda it: it.date) - for i, it in enumerate(itemlist): - episode = str(i + 1) - it.title = support.typo(item.season + 'x' + episode, 'bold') + (' - ' + it.title) - - if itemlist and itemlist[0].VL: support.videolibrary(itemlist, item) - - if itemlist and not support.match(itemlist[0].title, patron=r'[Ss]?(\d+)(?:x|_|\.|\s+)[Ee]?[Pp]?(\d+)').match and inspect.stack()[1][3] not in ['find_episodes']: - autorenumber.start(itemlist, item) - return itemlist - - -def findvideos(item): - support.info() - itemlist = [] - if item.url.endswith('json'): - json = current_session.get(item.url).json() - - if 'first_item_path' in json: - url = current_session.get(getUrl(json['first_item_path'])).json()['video']['content_url'] - else: - url = json['video']['content_url'] - else: - url = item.url - - itemlist.append(item.clone(server = 'directo', title = 'Rai Play', url = getUrl(url) + '&output=56', action = 'play')) - return support.server(item, itemlist=itemlist, Download=False) - - -def getUrl(pathId): - support.info() - url = pathId.replace(" ", "%20") - if url.startswith("/raiplay/"): - url = url.replace("/raiplay/",host +'/') - - if url.startswith("//"): - url = "https:" + url - elif url.startswith("/"): - url = host + url - - # fix format of url for json - if url.endswith(".html?json"): - url = url.replace(".html?json", ".json") - elif url.endswith("/?json"): - url = url.replace("/?json",".json") - elif url.endswith("?json"): - url = url.replace("?json",".json") + url = url.replace(".html?json", ".json").replace("/?json",".json").replace("?json",".json").replace(" ", "%20") return url -def addinfo(key, item): - support.info() - info = current_session.get(getUrl(key['info_url'])).json() if 'info_url' in key else {} - if 'images' in key: - fanart = key['images']['landscape'] - if key['images']['portrait_logo']: - thumb = key['images']['portrait_logo'] +def addinfo(items, item): + def itInfo(key, item): + logger.debug(jsontools.dump(key)) + item.forcethumb = True + if key.get('titolo', ''): + key = requests.get(getUrl(key['path_id'])).json()['program_info'] + + + info = requests.get(getUrl(key['info_url'])).json() if 'info_url' in key else {} + + images = info.get('images', {}) + fanart = images.get('landscape', '') + thumb = images.get('portrait_logo', '') + if not thumb: thumb = fanart + title = key.get('name', '') + + it = item.clone(title=support.typo(title, 'bold'), + data='', + fulltitle=title, + show=title, + thumbnail= getUrl(thumb), + fanart=getUrl(fanart), + url=getUrl(key.get('weblink', '')), + video_url=getUrl(key['path_id']), + plot=info.get('description', '')) + + if 'Genere' not in key.get('sub_type', '') and ('layout' not in key or key['layout'] == 'single'): + it.action = 'play' + it.contentTitle = it.fulltitle else: - thumb = key['images']['landscape'] - else: - thumb = '' - fanart = '' - it = item.clone(title=support.typo(key.get('name', ''), 'bold'), fulltitle=key.get('name', ''), - show=key.get('name', ''), data='', thumbnail=getUrl(thumb), - fanart=getUrl(fanart), url=getUrl(key['path_id']), plot=info.get('description', '')) + it.action = 'episodios' + it.contentSerieName = it.fulltitle + return it - if 'Genere' not in key.get('sub_type', '') and ('layout' not in key or key['layout'] == 'single'): - it.action = 'findvideos' - it.contentType = 'movie' - it.contentTitle = it.fulltitle - else: - it.action = 'select' - it.contentType = 'tvshow' - it.contentSerieName = it.fulltitle - return it - - -def load_episodes(key, item): - support.info() itemlist = [] - json = current_session.get(getUrl(key['path_id'])).json()['items'] - order = 0 - for key in json: - ep = support.match(key['subtitle'], patron=r'(?:St\s*(\d+))?\s*Ep\s*(\d+)').match - if ep: - season = '1' if not ep[0] else ep[0] - episode = ep[1].zfill(2) - title = season + 'x' + episode + support.re.sub(r'(?:St\s*\d+)?\s*Ep\s*\d+','',key['subtitle']) - order = int(season + episode) - else: - title = key['subtitle'].strip() - if not title: - title = key['name'] - - itemlist.append(item.clone(title = support.typo(title, 'bold'), url = key['video_url'], contentType = 'episode', - fanart = getUrl(key['images']['landscape']), plot = key['description'], - action = 'findvideos', VL=True if ep else False, order=order)) - return itemlist - - -def play(item): - if item.livefilter: - d = liveDict() - item = item.clone(server='directo', fulltitle=item.livefilter, url=d[item.livefilter]['url'], plot=d[item.livefilter]['plot'], forcethumb=True, no_return=True) - support.thumb(item, live=True) - if '&output=56' in item.url: - match = support.match(item, patron=r'content"><!\[CDATA\[([^\]]+)(?:.*?"WIDEVINE","licenceUrl":"([^"]+))?').match - item.url = match[0] - if len(match) == 2: - item.drm = 'com.widevine.alpha' - item.license = match[1] + '|' + host + '|R{SSM}|' - logger.debug('PLAY URL', item.url) - return [item] \ No newline at end of file + with futures.ThreadPoolExecutor() as executor: + itlist = [executor.submit(itInfo, it, item) for it in items] + for res in futures.as_completed(itlist): + if res.result(): + itemlist.append(res.result()) + return itemlist \ No newline at end of file From 4647f2f1d6839a496619ba595c352ee00785d9c7 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 30 Jul 2021 19:09:20 +0200 Subject: [PATCH 102/139] - La 7: Rimossi aggiungi alla videoteca e download - Raiplay: Aggiunta sezione Generi --- channels/la7.py | 5 +- channels/mediasetplay.py.old | 369 +++++++++++++++++++++++++++++++++++ channels/raiplay.py | 18 +- core/support.py | 3 +- 4 files changed, 388 insertions(+), 7 deletions(-) create mode 100644 channels/mediasetplay.py.old diff --git a/channels/la7.py b/channels/la7.py index 857159a4..efdd2df8 100644 --- a/channels/la7.py +++ b/channels/la7.py @@ -84,6 +84,8 @@ def search(item, text): def peliculas(item): search = item.search disabletmdb = True + addVideolibrary = False + downloadEnabled = False action = 'episodios' patron = r'<a href="(?P<url>[^"]+)"[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]+)"></div><div class="titolo">\s*(?P<title>[^<]+)<' def itemHook(item): @@ -96,7 +98,7 @@ def peliculas(item): @support.scrape def episodios(item): data = support.match(item).data - debug = True + # debug = True action = 'play' if '>puntate<' in data: patronBlock = r'>puntate<(?P<block>.*?)home-block-outbrain' @@ -109,6 +111,7 @@ def episodios(item): patron = r'(?:<a href="(?P<url>[^"]+)">[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]*)">[^>]+>[^>]+>[^>]+>(?:[^>]+>)?(?:[^>]+>){6}?)\s*(?P<title>[^<]+)<(?:[^>]+>[^>]+>[^>]+><div class="data">(?P<date>[^<]+))?|class="heading">[^>]+>(?P<Title>[^<]+).*?window.shareUrl = "(?P<Url>[^"]+)".*?poster:\s*"(?P<Thumb>[^"]+)", title: "(?P<desc>[^"]+)"' patronNext = r'<a href="([^"]+)">›' addVideolibrary = False + downloadEnabled = False def itemHook(item): if item.Thumb: item.t = item.Thumb diff --git a/channels/mediasetplay.py.old b/channels/mediasetplay.py.old new file mode 100644 index 00000000..dd41d490 --- /dev/null +++ b/channels/mediasetplay.py.old @@ -0,0 +1,369 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Canale per Mediaset Play +# ------------------------------------------------------------ +from platformcode import logger, config +import uuid + +import requests, sys +from core import support, jsontools +if sys.version_info[0] >= 3: from urllib.parse import urlencode, quote +else: from urllib import urlencode, quote +if sys.version_info[0] >= 3: from concurrent import futures +else: from concurrent_py2 import futures +from collections import OrderedDict + +PAGINATION = 4 + +host = config.get_channel_url() +post_url = '?assetTypes=HD,browser,widevine,geoIT|geoNo:HD,browser,geoIT|geoNo:HD,geoIT|geoNo:SD,browser,widevine,geoIT|geoNo:SD,browser,geoIT|geoNo:SD,geoIT|geoNo&auto=true&balance=true&format=smil&formats=MPEG-DASH,MPEG4,M3U&tracking=true' +deviceid = '61d27df7-5cbf-4419-ba06-cfd27ecd4588' +loginUrl = 'https://api-ott-prod-fe.mediaset.net/PROD/play/idm/anonymous/login/v2.0' +loginData = {"cid": deviceid, "platform": "pc", "appName": "web/mediasetplay-web/d667681"} +lic_url = 'https://widevine.entitlement.theplatform.eu/wv/web/ModularDrm/getRawWidevineLicense?releasePid=%s&account=http://access.auth.theplatform.com/data/Account/2702976343&schema=1.0&token={token}|Accept=*/*&Content-Type=&User-Agent=' + support.httptools.get_user_agent() + '|R{{SSM}}|' +entry = 'https://api.one.accedo.tv/content/entry/{id}?locale=it' +entries = 'https://api.one.accedo.tv/content/entries?id={id}&locale=it' +sessionUrl = "https://api.one.accedo.tv/session?appKey=59ad346f1de1c4000dfd09c5&uuid={uuid}&gid=default" + +current_session = requests.Session() +current_session.headers.update({'Content-Type': 'application/json', 'User-Agent': support.httptools.get_user_agent(), 'Referer': support.config.get_channel_url()}) + +# login anonimo +res = current_session.post(loginUrl, json=loginData, verify=False) +support.dbg() +Token = res.json['response']['beToken'] +sid = res.json['response']['sid'] +current_session.headers.update({'authorization': 'Bearer' + Token}) +lic_url = lic_url.format(token=Token) +tracecid = res.json()['response']['traceCid'] +cwid = res.json()['response']['cwId'] + +# sessione +res = current_session.get(sessionUrl.format(uuid=str(uuid.uuid4())), verify=False) +current_session.headers.update({'x-session': res.json()['sessionKey']}) + +cdict = {'CVFILM':'filmUltimiArrivi', + 'CWFILMTOPVIEWED':'filmPiuVisti24H', + 'CWFILMCOMEDY':'filmCommedia', + 'CWFILMACTION':'filmAzioneThrillerAvventura', + 'CWFILMDRAMATIC':'filmDrammatico', + 'CWFILMSENTIMENTAL':'filmSentimentale', + 'CWFILMCLASSIC':'filmClassici', + 'personToContentFilm':'personToContentFilm', + 'CWHOMEFICTIONNOWELITE':'stagioniFictionSerieTvSezione', + 'CWFICTIONSOAP':'mostRecentSoapOpera', + 'CWFICTIONDRAMATIC':'stagioniFictionDrammatico', + 'CWFICTIONPOLICE':'stagioniFictionPoliziesco', + 'CWFICTIONCOMEDY':'stagioniFictionCommedia', + 'CWFICTIONSITCOM':'stagioniFictionSitCom', + 'CWFICTIONSENTIMENTAL':'stagioniFictionSentimentale', + 'CWFICTIONBIOGRAPHICAL':'stagioniFictionBiografico', + 'CWPROGTVPRIME':'stagioniPrimaSerata', + 'CWPROGTVDAY':'stagioniDaytime', + 'CWPROGTVTOPVIEWED':'programmiTvClip24H', + 'CWPROGTVTALENT':'stagioniReality', + 'CWPROGTVVARIETY':'stagioniVarieta', + 'CWPROGTVTALK':'stagioniTalk', + 'CWPROGTVTG':'mostRecentTg', + 'CWPROGTVSPORT':'mostRecentSport', + 'CWPROGTVMAGAZINE':'stagioniCucinaLifestyle', + 'CWDOCUMOSTRECENT':'mostRecentDocumentariFep', + 'CWDOCUTOPVIEWED':'stagioniDocumentari', + 'CWDOCUSPAZIO':'documentariSpazio', + 'CWDOCUNATURANIMALI':'documentariNatura', + 'CWDOCUSCIENZATECH':'documentariScienza', + 'CWDOCUBIOSTORIE':'documentariBioStoria', + 'CWDOCUINCHIESTE':'documentariInchiesta', + 'CWFILMDOCU':'filmDocumentario', + 'CWKIDSBOINGFORYOU':'kidsBoing', + 'CWKIDSCARTOONITO':'kidsCartoonito', + 'CWKIDSMEDIASETBRAND':'kidsMediaset', + 'CWENABLERKIDS':'stagioniKids'} + + +@support.menu +def mainlist(item): + top = [('Dirette {bold}', ['https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-stations?sort=ShortTitle', 'live'])] + + menu = [('Fiction / Serie TV {bullet bold}', ['/fiction', 'menu', ['Tutte','all','searchStagioni', '5acfcb3c23eec6000d64a6a4'], 'tvshow']), + ('Programmi TV{ bullet bold}', ['/programmitv', 'menu', ['Tutti','all','searchStagioni', '5acfc8011de1c4000b6ec953'], 'tvshow']), + ('Documentari {bullet bold}', ['/documentari', 'menu', ['Tutti','all','', '5bfd17c423eec6001aec49f9'], 'undefined']), + ('Kids {bullet bold}', ['/kids', 'menu',['Tutti','all','', '5acfcb8323eec6000d64a6b3'], 'undefined'])] + + search = '' + return locals() + + +def search(item, text): + itemlist = [] + logger.debug(text) + item.search = text + + try: + itemlist = peliculas(item) + except: + import sys + for line in sys.exc_info(): + support.logger.error("%s" % line) + + return itemlist + + +def menu(item): + logger.debug() + itemlist = [] + if item.url: + json = get_from_id(item) + for it in json: + logger.debug(jsontools.dump(it)) + if 'uxReference' in it: itemlist.append( + item.clone(title=support.typo(it['title'], 'bullet bold'), url= it['landingUrl'], feed = it.get('feedurlV2',''), ref=it['uxReference'], args='', action='peliculas')) + return itemlist + + +def liveDict(): + livedict = OrderedDict({}) + json = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-stations?sort=ShortTitle').json()['entries'] + for it in json: + urls = [] + if it.get('tuningInstruction') and not it.get('mediasetstation$digitalOnly'): + guide=current_session.get('https://static3.mediasetplay.mediaset.it/apigw/nownext/' + it['callSign'] + '.json').json()['response'] + for key in it['tuningInstruction']['urn:theplatform:tv:location:any']: + urls += key['publicUrls'] + title = it['title'] + livedict[title] = {} + livedict[title]['urls'] = urls + livedict[title]['plot'] = support.typo(guide['currentListing']['mediasetlisting$epgTitle'],'bold') + '\n' + guide['currentListing']['mediasetlisting$shortDescription'] + '\n' + guide['currentListing']['description'] + '\n\n' + support.typo('A Seguire:' + guide['nextListing']['mediasetlisting$epgTitle'], 'bold') + return livedict + + +def live(item): + logger.debug() + itemlist = [] + for key, value in liveDict().items(): + itemlist.append(item.clone(title=support.typo(key, 'bold'), + fulltitle=key, + show=key, + contentTitle=key, + forcethumb=True, + urls=value['urls'], + plot=value['plot'], + action='play', + no_return=True)) + return support.thumb(itemlist, live=True) + + +def peliculas(item): + logger.debug() + itemlist = [] + titlelist = [] + contentType = '' + if item.text: + json = [] + itlist = [] + with futures.ThreadPoolExecutor() as executor: + for arg in ['searchMovie', 'searchStagioni', 'searchClip']: + item.args = ['', 'search', arg] + itlist += [executor.submit(get_programs, item)] + for res in futures.as_completed(itlist): + json += res.result() + else: + json = get_programs(item) + + for it in json: + if item.search.lower() in it['title'].lower() and it['title'] not in titlelist: + titlelist.append(it['title']) + if 'media' in it: + action = 'findvideos' + contentType = 'movie' + urls = [] + for key in it['media']: + urls.append(key['publicUrl']) + + else: + action = 'epmenu' + contentType = 'tvshow' + urls = it['mediasetprogram$brandId'] + if urls: + title = it['mediasetprogram$brandTitle'] + ' - ' if 'mediasetprogram$brandTitle' in it and it['mediasetprogram$brandTitle'] != it['title'] else '' + itemlist.append( + item.clone(channel=item.channel, + action=action, + title=support.typo(title + it['title'], 'bold'), + fulltitle=it['title'], + show=it['title'], + contentType=contentType if contentType else item.contentType, + contentTitle=it['title'] if 'movie' in [contentType, item.contentType] else '', + contentSerieName=it['title'] if 'tvshow' in [contentType, item.contentType] else '', + thumbnail=it['thumbnails']['image_vertical-264x396']['url'] if 'image_vertical-264x396' in it['thumbnails'] else '', + fanart=it['thumbnails']['image_keyframe_poster-1280x720']['url'] if 'image_keyframe_poster-1280x720' in it['thumbnails'] else '', + plot=it['longDescription'] if 'longDescription' in it else it['description'] if 'description' in it else '', + urls=urls, + seriesid = it.get('seriesId',''), + url=it['mediasetprogram$pageUrl'], + forcethumb=True, + no_return=True)) + if item.feed: + item.page = item.page + 100 if item.page else 101 + support.nextPage(itemlist, item) + return itemlist + + +def epmenu(item): + logger.debug() + itemlist = [] + + if item.seriesid: + seasons = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-tv-seasons?bySeriesId=' + item.seriesid).json()['entries'] + for season in seasons: + if 'mediasettvseason$brandId' in season and 'mediasettvseason$displaySeason' in season: + itemlist.append( + item.clone(seriesid = '', + title=support.typo(season['mediasettvseason$displaySeason'], 'bold'), + urls=season['mediasettvseason$brandId'])) + itemlist = sorted(itemlist, key=lambda it: it.title, reverse=True) + if len(itemlist) == 1: return epmenu(itemlist[0]) + if not itemlist: + entries = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-brands?byCustomValue={brandId}{' + item.urls + '}').json()['entries'] + for entry in entries: + if 'mediasetprogram$subBrandId' in entry: + itemlist.append( + item.clone(action='episodios', + title=support.typo(entry['description'], 'bold'), + url=entry['mediasetprogram$subBrandId'], + order=entry.get('mediasetprogram$order',0))) + if len(itemlist) == 1: return episodios(itemlist[0]) + itemlist = sorted(itemlist, key=lambda it: it.order) + return itemlist + + +def episodios(item): + logger.debug() + itemlist = [] + if not item.nextIndex: item.nextIndex = 1 + + url = 'https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-programs?byCustomValue={subBrandId}{'+ item.url + '}&range=' + str(item.nextIndex) + '-' + str(item.nextIndex + PAGINATION) + json = current_session.get(url).json()['entries'] + + for it in json: + urls = [] + if 'media' in it: + for key in it['media']: + urls.append(key['publicUrl']) + if urls: + title = it['title'] + itemlist.append( + item.clone(action='findvideos', + title=support.typo(title, 'bold'), + contentType='episode', + thumbnail=it['thumbnails']['image_vertical-264x396']['url'] if 'image_vertical-264x396' in it['thumbnails'] else '', + fanart=it['thumbnails']['image_keyframe_poster-1280x720']['url'] if 'image_keyframe_poster-1280x720' in it['thumbnails'] else '', + plot=it['longDescription'] if 'longDescription' in it else it['description'], + urls=urls, + url=it['mediasetprogram$pageUrl'], + year=it.get('year',''), + ep= it.get('tvSeasonEpisodeNumber', 0) if it.get('tvSeasonEpisodeNumber', 0) else 0, + forcethumb=True, + no_return=True)) + + if len(itemlist) == 1: return findvideos(itemlist[0]) + + if (len(json) >= PAGINATION): + item.nextIndex += PAGINATION + 1 + support.nextPage(itemlist, item) + + return itemlist + + +def findvideos(item): + logger.debug() + itemlist = [item.clone(server='directo', title='Mediaset Play', urls=item.urls, action='play')] + return support.server(item, itemlist=itemlist, Download=False) + + +def play(item): + logger.debug() + for url in item.urls: + sec_data = support.match(url + post_url).data + item.url = support.match(sec_data, patron=r'<video src="([^"]+)').match + pid = support.match(sec_data, patron=r'pid=([^|]+)').match + item.manifest = 'mpd' + + if pid: + item.drm = 'com.widevine.alpha' + item.license = lic_url % pid + break + + return [item] + + +def subBrand(json): + logger.debug() + subBrandId = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-brands?byCustomValue={brandId}{' + json + '}').json()['entries'][-1]['mediasetprogram$subBrandId'] + json = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-programs?byCustomValue={subBrandId}{' + subBrandId + '}').json()['entries'] + return json + + +def get_from_id(item): + logger.debug() + json = current_session.get(entry.format(id=item.args[3])).json() + if 'components' in json: + id = quote(",".join(json["components"])) + json = current_session.get(entries.format(id=id)).json() + if 'entries' in json: + return json['entries'] + return {} + + +def get_programs(item, ret=[], args={}): + hasMore = False + url = '' + # support.dbg() + + if 'search' in item.args: + args['uxReference'] = item.args[2] + args["query"] = item.text + args['traceCid'] = tracecid + args['cwId'] = cwid + args['page'] = 1 + args['platform'] = 'pc' + args['hitsPerPage'] = 500 + url = 'https://api-ott-prod-fe.mediaset.net/PROD/play/rec2/search/v1.0?' + urlencode(args) + elif item.feed: + pag = item.page if item.page else 1 + url='{}&range={}-{}'.format(item.feed, pag, pag + 99) + elif not args: + if item.ref in cdict: + args['uxReference'] = cdict[item.ref] + args['platform'] = 'pc' + else: + args = {"query": "*:*"} + if item.args[2]: + args['categories'] = item.args[2] + + args['cwId'] = cwid + args['traceCid'] = tracecid + args['hitsPerPage'] = 500 + args['page'] = '0' + args['deviceId'] = deviceid + url="https://api-ott-prod-fe.mediaset.net/PROD/play/rec2/cataloguelisting/v1.0?" + urlencode(args) + + + if url: + json = current_session.get(url).json() + if 'response' in json: + json = json['response'] + if 'hasMore' in json: + hasMore = json['hasMore'] + if 'components' in json: + id = quote(",".join(json["components"])) + json = current_session.get(entries.format(id=id)).json() + if 'entries' in json: + ret += json['entries'] + if hasMore: + args['page'] = str(int(args['page']) + 1) + return get_programs(item, ret, args) + else: + return ret + else: + return ret diff --git a/channels/raiplay.py b/channels/raiplay.py index e9a9f374..1cfff90d 100644 --- a/channels/raiplay.py +++ b/channels/raiplay.py @@ -47,16 +47,16 @@ def menu(item): if item.data: for it in item.data: - if 'sets' in it: - action = 'episodios' - itemlist.append(item.clone(title=support.typo(it['name'], 'bold'), data=[it], action=action)) + url = getUrl(it['path_id']) + action = 'genres' + itemlist.append(item.clone(title=support.typo(it['name'], 'bold'), url=url.replace('.json','.html'), genre_url=url, data='', action=action)) support.thumb(itemlist, genre=True) else: items = item.data if item.data else requests.get(host + item.args).json()['contents'] for it in items: - if 'RaiPlay Slider Block' in it['type']: + if 'RaiPlay Slider Block' in it['type'] or 'RaiPlay Slider Generi Block' in it['type']: thumb = item.thumbnail - if 'Generi' in it['name']: + if 'RaiPlay Slider Generi Block' in it['type']: action = 'menu' thumb = support.thumb('genres') itemlist.append(item.clone(title=support.typo(it['name'], 'bold'), data=it.get('contents', item.data), thumbnail=thumb, action=action)) @@ -64,6 +64,14 @@ def menu(item): return itemlist +def genres(item): + itemlist = [] + items = requests.get(getUrl(item.genre_url)).json()['contents'] + for title, it in items.items(): + if it: itemlist.append(item.clone(title=support.typo(title, 'bold'), data=it, action='peliculas', thumbnail=support.thumb('az'))) + return itemlist + + def search(item, text): logger.debug(text) post = {'page':0, 'pagesize': 1000, 'param':text} diff --git a/core/support.py b/core/support.py index ee532e4f..4e372d62 100755 --- a/core/support.py +++ b/core/support.py @@ -448,7 +448,8 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t contentEpisodeNumber=infolabels.get('episode', ''), news= item.news if item.news else '', other = scraped['other'] if scraped['other'] else '', - grouped=group + grouped=group, + disable_videolibrary = True if not args.get('addVideolibrary') else False ) if scraped['episode'] and group and not item.grouped: # some adjustment for grouping feature it.action = function From 789ab9990a1a24b15230db5f21c2b552bb71cce4 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 30 Jul 2021 19:35:28 +0200 Subject: [PATCH 103/139] ops --- core/support.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/support.py b/core/support.py index 4e372d62..a494bc20 100755 --- a/core/support.py +++ b/core/support.py @@ -449,7 +449,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t news= item.news if item.news else '', other = scraped['other'] if scraped['other'] else '', grouped=group, - disable_videolibrary = True if not args.get('addVideolibrary') else False + disable_videolibrary = not args.get('addVideolibrary', True) ) if scraped['episode'] and group and not item.grouped: # some adjustment for grouping feature it.action = function From 28fbc4ed82bf13a673a53074ecbe66716f7ef191 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Mon, 2 Aug 2021 19:05:58 +0200 Subject: [PATCH 104/139] Fix AniPlay (Riaggiungere le serie in Videoteca) --- channels/aniplay.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/channels/aniplay.py b/channels/aniplay.py index 9215f738..8d522504 100644 --- a/channels/aniplay.py +++ b/channels/aniplay.py @@ -178,7 +178,7 @@ def peliculas(item): action ='findvideos' if it['type'] == 'Movie' else 'episodios',# '' if not active else 'findvideos' if it['type'] == 'Movie' else 'episodios', plot = it['storyline'], year = it['startDate'].split('-')[0], - id= it['id'], + url = '{}/api/anime/{}'.format(host, it['id']), thumbnail = get_thumbnail(it), fanart = get_thumbnail(it, 'horizontalImages'))) @@ -194,8 +194,8 @@ def episodios(item): logger.debug() itemlist = [] - url = '{}/api/anime/{}'.format(host, item.id) - json = httptools.downloadpage(url, CF=False ).json + # url = '{}/api/anime/{}'.format(host, item.id) + json = httptools.downloadpage(item.url, CF=False ).json if type(json) == list: item.show_renumber = False From 1f354e359e77b4d40cc71c82bd272db86dc0dfa6 Mon Sep 17 00:00:00 2001 From: Enrico Da Rodda <enricodarodda@hotmail.it> Date: Mon, 2 Aug 2021 20:17:10 +0200 Subject: [PATCH 105/139] Fix regex Casacinema --- channels/casacinema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/casacinema.py b/channels/casacinema.py index 73aa5576..90bb2376 100644 --- a/channels/casacinema.py +++ b/channels/casacinema.py @@ -107,7 +107,7 @@ def peliculas(item): patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?:\[(?P<quality1>HD)\])?[ ]?(?:\(|\[)?(?P<lang>[sS]ub-[iI][tT][aA])?(?:\)|\])?[ ]?(?:\[(?P<quality>.+?)\])?[ ]?(?:\((?P<year>\d+)\))?<(?:[^>]+>.+?(?:title="Nuovi episodi">(?P<episode>\d+x\d+)[ ]?(?P<lang2>Sub-Ita)?|title="IMDb">(?P<rating>[^<]+)))?' else: # patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?:\[(?P<quality1>HD)\])?\s?(?:[\(\[])?(?P<lang>[sS]ub-[iI][tT][aA])?(?:[\)\]])?\s?(?:\[(?P<quality>.+?)\])?\s?(?:\((?P<year>\d+)\))?<' - patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?P<title2>\([\D*]+\))?(?:\[(?P<quality1>HD)\])?\s?(?:[\(\[])?(?P<lang>[sS]ub-[iI][tT][aA])?(?:[\)\]])?\s?(?:\[(?P<quality>.+?)\])?\s?(?:\((?P<year>\d+)\))?<' + patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?P<title2>\([\D*]+\))?(?:\[(?P<quality1>HD)\])?\s?(?:[\(\[])?(?P<lang>[sS]ub-[iI][tT][aA])?(?:[\)\]])?\s?(?:\[(?P<quality>.+?)\])?\s?(?:\((?P<year>\d+)\))?(?:\(\D{2}\s\d{4}\))?<' patronNext = r'<a href="([^"]+)"\s*>Pagina' # debug = True From 9465608423bbe66618dcbfb669e9e61c18d99173 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Tue, 3 Aug 2021 17:52:12 +0000 Subject: [PATCH 106/139] Aggiornamento domini --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index a1058fef..7a91b817 100644 --- a/channels.json +++ b/channels.json @@ -34,7 +34,7 @@ "piratestreaming": "https://www.piratestreaming.design", "polpotv": "https://roma.polpo.tv", "raiplay": "https://www.raiplay.it", - "seriehd": "https://seriehd.cam", + "seriehd": "https://altadefinizionecommunity.me", "serietvonline": "https://serietvonline.art", "serietvsubita": "http://serietvsubita.xyz", "serietvu": "https://www.serietvu.live", From cc58111668f933ffa9a2437a10181d5b68bb28bc Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Tue, 3 Aug 2021 20:21:45 +0200 Subject: [PATCH 107/139] Fix Login Altadefinizione Community --- channels/altadefinizionecommunity.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index 79247c9b..f8477b87 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -42,16 +42,17 @@ def mainlist(item): def login(): r = httptools.downloadpage(host) + Token = support.match(r.data, patron=r'name=\s*"_token"\s*value=\s*"([^"]+)').match if 'id="logged"' in r.data: logger.info('Già loggato') else: logger.info('Login in corso') - r = httptools.downloadpage(host + '/login', post={'email': config.get_setting('username', channel='altadefinizionecommunity'), - 'password': config.get_setting('password', channel='altadefinizionecommunity')}) + post = '_token={}&form_action=login&email={}&password={}'.format(Token, config.get_setting('username', channel='altadefinizionecommunity'),config.get_setting('password', channel='altadefinizionecommunity')) + r = httptools.downloadpage(host + '/login', post=post) if not r.success or 'Email o Password non validi' in r.data: platformtools.dialog_ok('AltadefinizioneCommunity', 'Username/password non validi') return False - + logger.debug(r.data) return 'id="logged"' in r.data From 453cbe4cb57112e5e64138ce963f0aec2b2da93d Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Tue, 3 Aug 2021 20:52:07 +0200 Subject: [PATCH 108/139] Fix aggiungi videoteca su altadefinizionecommunity->ricerca, tmdb e rimosso URL shortner per "apri nel browser" in mancanza di browser --- channels/altadefinizionecommunity.py | 2 ++ core/support.py | 1 - core/tmdb.py | 9 +++------ platformcode/launcher.py | 14 +++++++------- .../language/resource.language.en_gb/strings.po | 2 +- .../language/resource.language.it_it/strings.po | 4 ++-- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index 79247c9b..ac33dcbc 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -198,7 +198,9 @@ def findvideos(item): video_url = playWindow.match if '/tvshow' in video_url: item.data = playWindow.data + item.contentType = 'tvshow' return episodios(item) + item.contentType = 'movie' itemlist.append(item.clone(action='play', url=support.match(video_url.replace('/watch-unsubscribed', '/watch-external'), patron='src="([^"]+)').match, quality='')) itemlist.append(item.clone(action='play', server='directo', title=support.config.get_localized_string(30137), diff --git a/core/support.py b/core/support.py index a494bc20..9ac8ab52 100755 --- a/core/support.py +++ b/core/support.py @@ -627,7 +627,6 @@ def scrape(func): thumbnail=thumb(), prevthumb=item.prevthumb if item.prevthumb else item.thumbnail)) - if inspect.stack()[1][3] not in ['find_episodes']: if addVideolibrary and (item.infoLabels["title"] or item.fulltitle): # item.fulltitle = item.infoLabels["title"] diff --git a/core/tmdb.py b/core/tmdb.py index bddacd2b..6813dca1 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -210,11 +210,8 @@ def set_infoLabels_itemlist(item_list, seekTmdb=False, search_language=def_lang, def sub_thread(_item, _i, _seekTmdb): # semaphore.acquire() ret = 0 - try: - ret = set_infoLabels_item(_item, _seekTmdb, search_language, lock) - except: - import traceback - logger.error(traceback.format_exc(1)) + ret = set_infoLabels_item(_item, _seekTmdb, search_language, lock) + if lock and lock.locked(): lock.release() # logger.debug(str(ret) + "item: " + _item.tostring()) @@ -968,7 +965,7 @@ class Tmdb(object): # http://api.themoviedb.org/3/tv/1407?api_key=a1ab8b8669da03637a4b98fa39c39228&language=es # &append_to_response=images,videos,external_ids,credits&include_image_language=es,null url = ('{}/{}/{}?api_key={}&language={}&append_to_response=images,videos,external_ids,credits&include_image_language={},null'.format(host, self.search_type, self.search_id, api, self.search_language, self.search_language)) - searching = "id_Tmdb: " + self.search_id + searching = "id_Tmdb: " + str(self.search_id) else: # http://api.themoviedb.org/3/find/%s?external_source=imdb_id&api_key=a1ab8b8669da03637a4b98fa39c39228 url = ('{}/find/{}?external_source={}&api_key={}8&language={}'.format(host, self.search_id, source, api, self.search_language)) diff --git a/platformcode/launcher.py b/platformcode/launcher.py index d11216fc..94439077 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -2,7 +2,12 @@ # ------------------------------------------------------------ # XBMC Launcher (xbmc / kodi) # ------------------------------------------------------------ +import datetime +import json import sys, os + +import requests + PY3 = False if sys.version_info[0] >= 3:PY3 = True; unicode = str; unichr = chr; long = int @@ -142,14 +147,9 @@ def run(item=None): if not webbrowser.open(item.url): import xbmc if xbmc.getCondVisibility('system.platform.linux') and xbmc.getCondVisibility('system.platform.android'): # android - xbmc.executebuiltin('StartAndroidActivity("", "android.intent.action.VIEW", "", "%s")' % (item.url)) + xbmc.executebuiltin('StartAndroidActivity("", "android.intent.action.VIEW", "", "%s")' % item.url) else: - try: - import urllib.request as urllib - except ImportError: - import urllib - short = urllib.urlopen('https://u.nu/api.php?action=shorturl&format=simple&url=' + item.url).read().decode('utf-8') - platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(70740) % short) + platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(70740) % "\n".join((item.url[j:j+57] for j in range(0, len(item.url), 57)))) elif item.action == "gotopage": page = platformtools.dialog_numeric(0, config.get_localized_string(70513)) if page: diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index da5a632b..7a276cd0 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -5760,7 +5760,7 @@ msgid "Open in browser" msgstr "" msgctxt "#70740" -msgid "Your system does not have a web browser, so here's the short link you can open in another device:\n%s" +msgid "Your system does not have a web browser, so here's the link you can open in another device:\n%s" msgstr "" msgctxt "#70741" diff --git a/resources/language/resource.language.it_it/strings.po b/resources/language/resource.language.it_it/strings.po index 8c0632da..e5e3e7c2 100644 --- a/resources/language/resource.language.it_it/strings.po +++ b/resources/language/resource.language.it_it/strings.po @@ -5760,8 +5760,8 @@ msgid "Open in browser" msgstr "Apri nel browser" msgctxt "#70740" -msgid "Your system does not have a web browser, so here's the short link you can open in another device:\n%s" -msgstr "Il tuo sistema non ha un browser, quindi ecco un link corto che puoi aprire in un altro dispositivo\n%s" +msgid "Your system does not have a web browser, so here's the link you can open in another device:\n%s" +msgstr "Il tuo sistema non ha un browser, quindi ecco il link che puoi aprire in un altro dispositivo:\n%s" msgctxt "#70741" msgid "Search %s" From 803c374da8f73e7538ed327b328e7be5ed36670c Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Tue, 3 Aug 2021 22:26:35 +0200 Subject: [PATCH 109/139] Fix Avvio KoD --- platformcode/launcher.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platformcode/launcher.py b/platformcode/launcher.py index 94439077..1d2ef530 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -175,10 +175,10 @@ def run(item=None): channel = None if os.path.exists(channel_file): - try: - channel = __import__('%s.%s' % (CHANNELS, item.channel), None, None, ['%s.%s' % (CHANNELS, item.channel)]) - except ImportError: - exec("import " + CHANNELS + "." + item.channel + " as channel") + # try: + channel = __import__('%s.%s' % (CHANNELS, item.channel), None, None, ['%s.%s' % (CHANNELS, item.channel)]) + # except ImportError: + # exec("import " + CHANNELS + "." + item.channel + " as channel") logger.info("Running channel %s | %s" % (channel.__name__, channel.__file__)) From b8e75f2dec699af67e3a112637dc946c87104979 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Wed, 4 Aug 2021 11:26:45 +0200 Subject: [PATCH 110/139] Fix Open with browser for Kodi 18 --- platformcode/launcher.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platformcode/launcher.py b/platformcode/launcher.py index 1d2ef530..26a8c4db 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -149,7 +149,7 @@ def run(item=None): if xbmc.getCondVisibility('system.platform.linux') and xbmc.getCondVisibility('system.platform.android'): # android xbmc.executebuiltin('StartAndroidActivity("", "android.intent.action.VIEW", "", "%s")' % item.url) else: - platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(70740) % "\n".join((item.url[j:j+57] for j in range(0, len(item.url), 57)))) + platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(70740) % "\n".join([item.url[j:j+57] for j in range(0, len(item.url), 57)])) elif item.action == "gotopage": page = platformtools.dialog_numeric(0, config.get_localized_string(70513)) if page: @@ -175,10 +175,10 @@ def run(item=None): channel = None if os.path.exists(channel_file): - # try: - channel = __import__('%s.%s' % (CHANNELS, item.channel), None, None, ['%s.%s' % (CHANNELS, item.channel)]) - # except ImportError: - # exec("import " + CHANNELS + "." + item.channel + " as channel") + try: + channel = __import__('%s.%s' % (CHANNELS, item.channel), None, None, ['%s.%s' % (CHANNELS, item.channel)]) + except ImportError: + exec("import " + CHANNELS + "." + item.channel + " as channel") logger.info("Running channel %s | %s" % (channel.__name__, channel.__file__)) From f9a5010785f94259bb116df2656c7336a1274752 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Wed, 4 Aug 2021 17:48:30 +0000 Subject: [PATCH 111/139] Aggiornamento domini --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index 7a91b817..79672359 100644 --- a/channels.json +++ b/channels.json @@ -34,7 +34,7 @@ "piratestreaming": "https://www.piratestreaming.design", "polpotv": "https://roma.polpo.tv", "raiplay": "https://www.raiplay.it", - "seriehd": "https://altadefinizionecommunity.me", + "seriehd": "https://altadefinizionecommunity.casa", "serietvonline": "https://serietvonline.art", "serietvsubita": "http://serietvsubita.xyz", "serietvu": "https://www.serietvu.live", From 958038667ec5cf209d74e928e561f8722e19c900 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 6 Aug 2021 09:49:18 +0200 Subject: [PATCH 112/139] Fix Login Altadefinizione Community --- channels/altadefinizionecommunity.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index f1ed990d..08f598f5 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -6,6 +6,8 @@ from lib.fakeMail import Gmailnator from platformcode import config, platformtools, logger from core import scrapertools, httptools +from lib import cloudscraper + def findhost(url): return support.match(url, patron=r'<a href="([^"]+)/\w+">Accedi').match @@ -15,6 +17,7 @@ host = config.get_channel_url(findhost) register_url = 'https://altaregistrazione.com' headers = [['Referer', host], ['x-requested-with', 'XMLHttpRequest']] +cf = cloudscraper.create_scraper() @support.menu def mainlist(item): @@ -41,19 +44,23 @@ def mainlist(item): def login(): - r = httptools.downloadpage(host) - Token = support.match(r.data, patron=r'name=\s*"_token"\s*value=\s*"([^"]+)').match - if 'id="logged"' in r.data: + r = cf.get(host) + Token = support.match(r.text, patron=r'name=\s*"_token"\s*value=\s*"([^"]+)').match + if 'id="logged"' in r.text: logger.info('Già loggato') else: logger.info('Login in corso') - post = '_token={}&form_action=login&email={}&password={}'.format(Token, config.get_setting('username', channel='altadefinizionecommunity'),config.get_setting('password', channel='altadefinizionecommunity')) - r = httptools.downloadpage(host + '/login', post=post) - if not r.success or 'Email o Password non validi' in r.data: + post = {'_token': '', + 'form_action':'login', + 'email': config.get_setting('username', channel='altadefinizionecommunity'), + 'password':config.get_setting('password', channel='altadefinizionecommunity')} + + r = cf.post(host + '/login', json=post, headers={'referer': host}) + if not r.status_code in [200, 302] or 'Email o Password non validi' in r.text: platformtools.dialog_ok('AltadefinizioneCommunity', 'Username/password non validi') return False - logger.debug(r.data) - return 'id="logged"' in r.data + + return 'id="logged"' in r.text def registerOrLogin(): @@ -195,7 +202,7 @@ def findvideos(item): itemlist = [] video_url = item.url if '/watch-unsubscribed' not in video_url: - playWindow = support.match(item.url, patron='playWindow" href="([^"]+)') + playWindow = support.match(cf.get(item.url).text, patron='playWindow" href="([^"]+)') video_url = playWindow.match if '/tvshow' in video_url: item.data = playWindow.data @@ -212,7 +219,7 @@ def findvideos(item): def play(item): if host in item.url: # intercetto il server proprietario if registerOrLogin(): - return support.get_jwplayer_mediaurl(httptools.downloadpage(item.url).data, 'Diretto') + return support.get_jwplayer_mediaurl(cf.get(item.url).text, 'Diretto') else: platformtools.play_canceled = True return [] From 4d6d447cba363b574a1104f7c5c0c197d5671937 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 6 Aug 2021 11:40:38 +0200 Subject: [PATCH 113/139] =?UTF-8?q?Altadefinizione=20Community:=20=20-=20F?= =?UTF-8?q?ix=20Ricerca=20=20-=20Fix=20Generi=20/=20Qualit=C3=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- channels/altadefinizionecommunity.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index 08f598f5..aed08925 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -15,7 +15,7 @@ def findhost(url): host = config.get_channel_url(findhost) register_url = 'https://altaregistrazione.com' -headers = [['Referer', host], ['x-requested-with', 'XMLHttpRequest']] +headers = {'Referer': host, 'x-requested-with': 'XMLHttpRequest'} cf = cloudscraper.create_scraper() @@ -132,13 +132,17 @@ def registerOrLogin(): @support.scrape def peliculas(item): # debug = True + json = {} support.info(item) if '/load-more-film' not in item.url and '/search' not in item.url: # generi o altri menu, converto import ast - ajax = support.match(item.url, patron="ajax_data\s*=\s*([^;]+)").match + ajax = support.match(item.url, patron='ajax_data\s*=\s*"?\s*([^;]+)').match item.url = host + '/load-more-film?' + support.urlencode(ast.literal_eval(ajax)) + '&page=1' - json = support.httptools.downloadpage(item.url, headers=headers).json - data = "\n".join(json['data']) + if not '/search' in item.url: + json = support.httptools.downloadpage(item.url, headers=headers).json + data = "\n".join(json['data']) + else: + data = support.httptools.downloadpage(item.url, headers=headers).data patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*<span[^>]+>[^<]+</span>\s*<span class="qual">(?P<quality>[^<]+).*?<img src="(?P<thumbnail>[^"]+)[^>]+>\s*<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?' # paginazione @@ -149,14 +153,16 @@ def peliculas(item): page = str(int(spl[-1])+1) support.nextPage(itemlist, item, next_page='='.join((url, page)), function_or_level='peliculas') return itemlist + return locals() def search(item, texto): support.info("search ", texto) + # support.dbg() item.args = 'search' - item.url = host + "/search?s={0}&page=1".format(texto) + item.url = host + "/search?s={}&page=1".format(texto) try: return peliculas(item) # Continua la ricerca in caso di errore @@ -170,6 +176,7 @@ def search(item, texto): @support.scrape def genres(item): support.info(item) + data = cf.get(item.url).text patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)' if item.args == 'quality': From 96b9886660e423274b5fc6dea3731b8abdf1330a Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 6 Aug 2021 12:36:58 +0200 Subject: [PATCH 114/139] Fix Ordine Server --- core/servertools.py | 10 +++++----- platformcode/platformtools.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/servertools.py b/core/servertools.py index d2bc7bf1..94654f87 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -17,7 +17,7 @@ from past.utils import old_div import re -from core import filetools, httptools, jsontools +from core import filetools, httptools, jsontools, support from core.item import Item from platformcode import config, logger, platformtools from lib import unshortenit @@ -696,7 +696,7 @@ def sort_servers(servers_list): sorted_list = [] url_list_valid = [] - favorite_quality = [quality_list.reverse() if config.get_setting('default_action') == 1 else quality_list] + favorite_quality = quality_list.reverse() if config.get_setting('default_action') == 1 else quality_list # Priorities when ordering itemlist: # 0: Servers and Qualities @@ -705,9 +705,9 @@ def sort_servers(servers_list): # 3: Only qualities # 4: Do not order - if config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and not config.get_setting('quality_priority'): + if config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and not config.get_setting('quality_priority', 'servers'): priority = 0 # 0: Servers and Qualities - elif config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and config.get_setting('quality_priority'): + elif config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and config.get_setting('quality_priority', 'servers'): priority = 1 # 0: Qualities and Servers elif config.get_setting('favorites_servers') and favorite_servers: priority = 2 # Servers only @@ -758,7 +758,7 @@ def sort_servers(servers_list): elif priority == 1: sorted_list.sort(key=lambda row: (row['indice_language'], row['indice_quality'], row['indice_server'])) # Qualities and Servers elif priority == 2: sorted_list.sort(key=lambda row: (row['indice_language'], row['indice_server'])) # Servers only elif priority == 3: sorted_list.sort(key=lambda row: (row['indice_language'], row['indice_quality'])) # Only qualities - else: sorted_list.sort(key=lambda row: row['indice_language']) + else: sorted_list.sort(key=lambda row: (row['indice_language'], row['indice_quality'])) return [v['videoitem'] for v in sorted_list if v] diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 915e55ed..37e68a4e 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -364,7 +364,7 @@ def render_items(itemlist, parent_item): xbmcplugin.addDirectoryItems(_handle, dirItems) if parent_item.list_type == '': - breadcrumb = parent_item.category.capitalize() + breadcrumb = parent_item.category #.capitalize() else: if 'similar' in parent_item.list_type: if parent_item.contentTitle != '': From be8cfc19483d300b6f21004b6c3cbe685545fe97 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 6 Aug 2021 12:47:49 +0200 Subject: [PATCH 115/139] ops --- core/servertools.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/servertools.py b/core/servertools.py index 94654f87..e145d203 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -17,7 +17,7 @@ from past.utils import old_div import re -from core import filetools, httptools, jsontools, support +from core import filetools, httptools, jsontools from core.item import Item from platformcode import config, logger, platformtools from lib import unshortenit @@ -705,9 +705,9 @@ def sort_servers(servers_list): # 3: Only qualities # 4: Do not order - if config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and not config.get_setting('quality_priority', 'servers'): + if config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and not config.get_setting('quality_priority'): priority = 0 # 0: Servers and Qualities - elif config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and config.get_setting('quality_priority', 'servers'): + elif config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and config.get_setting('quality_priority'): priority = 1 # 0: Qualities and Servers elif config.get_setting('favorites_servers') and favorite_servers: priority = 2 # Servers only From dbb44fbbd17067cc12712b0aa56efc39036c51ae Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 6 Aug 2021 13:01:55 +0200 Subject: [PATCH 116/139] Fix Altadefinizione Click --- channels/altadefinizioneclick.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/channels/altadefinizioneclick.py b/channels/altadefinizioneclick.py index 6115f687..a0aaced3 100644 --- a/channels/altadefinizioneclick.py +++ b/channels/altadefinizioneclick.py @@ -138,6 +138,7 @@ def newest(categoria): def check(item): + item.contentType = 'tvshow' def get_season(pageData, seas_url, season): data = '' episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches @@ -155,7 +156,7 @@ def check(item): url = support.match(item, patron=r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen').match seasons = support.match(url, patronBlock=patron_season, patron=patron_option) if not seasons.match: - item.contentType = 'tvshow' + item.contentType = 'movie' return findvideos(item) data = '' From 4ca25679ebdc139d86e727295c95089a4a4c8d3b Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sat, 7 Aug 2021 17:32:12 +0200 Subject: [PATCH 117/139] Fix vidmoly, aniplay(A-Z), rimossi serieHD e DSDA, rimosso player premium altacommunity --- channels/altadefinizionecommunity.py | 6 +++--- channels/aniplay.py | 13 ++++++------- channels/dsda.json | 2 +- channels/seriehd.json | 2 +- channels/tantifilm.py | 2 +- servers/vidmoly.py | 2 +- tests/test_generic.py | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index aed08925..70fed68c 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -217,9 +217,9 @@ def findvideos(item): return episodios(item) item.contentType = 'movie' itemlist.append(item.clone(action='play', url=support.match(video_url.replace('/watch-unsubscribed', '/watch-external'), - patron='src="([^"]+)').match, quality='')) - itemlist.append(item.clone(action='play', server='directo', title=support.config.get_localized_string(30137), - url=video_url.replace('/watch-unsubscribed', '/watch'))) + patron='allowfullscreen[^<]+src="([^"]+)"').match, quality='')) + # itemlist.append(item.clone(action='play', server='directo', title=support.config.get_localized_string(30137), + # url=video_url.replace('/watch-unsubscribed', '/watch'))) return support.server(item, itemlist=itemlist) diff --git a/channels/aniplay.py b/channels/aniplay.py index 8d522504..dd43e9dc 100644 --- a/channels/aniplay.py +++ b/channels/aniplay.py @@ -26,13 +26,12 @@ def mainlist(item): def submenu_az(item): itemlist = [] - if item.args == 'az': - for letter in ['0-9'] + list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'): - itemlist.append(item.clone(title = support.typo(letter, 'bold'), - url= host + '/api/anime/find-by-char', - action= 'peliculas', - variable= '&character=' + letter, - thumbnail=support.thumb('az'))) + for letter in ['0-9'] + list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'): + itemlist.append(item.clone(title = support.typo(letter, 'bold'), + url= host + '/api/anime/find-by-char', + action= 'peliculas', + variable= '&character=' + letter, + thumbnail=support.thumb('az'))) return itemlist def submenu_year(item): diff --git a/channels/dsda.json b/channels/dsda.json index 4ec18a80..9ae3060f 100644 --- a/channels/dsda.json +++ b/channels/dsda.json @@ -2,7 +2,7 @@ "id": "dsda", "name": "D.S.D.A", "language": ["ita"], - "active": true, + "active": false, "thumbnail": "dsda.png", "banner": "dsda.png", "categories": ["documentary"], diff --git a/channels/seriehd.json b/channels/seriehd.json index eda29eb2..9c7ade33 100644 --- a/channels/seriehd.json +++ b/channels/seriehd.json @@ -1,7 +1,7 @@ { "id": "seriehd", "name": "SerieHD", - "active": true, + "active": false, "language": ["ita"], "thumbnail": "seriehd.png", "banner": "seriehd.png", diff --git a/channels/tantifilm.py b/channels/tantifilm.py index 70b531ad..f39abca1 100644 --- a/channels/tantifilm.py +++ b/channels/tantifilm.py @@ -133,7 +133,7 @@ def search(item, texto): @support.scrape def newest(categoria): if categoria == 'series': - item = Item(url=host + '/aggiornamenti-giornalieri-serie-tv') + item = Item(url=host + '/aggiornamenti-serie-tv') data = support.match(item).data.replace('<u>','').replace('</u>','') item.contentType = 'episode' patronBlock = r'Aggiornamenti Giornalieri Serie TV.*?<div class="sp-body folded">(?P<block>.*?)</div>' diff --git a/servers/vidmoly.py b/servers/vidmoly.py index 14d775a3..29b12330 100644 --- a/servers/vidmoly.py +++ b/servers/vidmoly.py @@ -20,6 +20,6 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= video_urls = support.get_jwplayer_mediaurl(data, 'Vidmoly') for url in video_urls: logger.debug(url) - url[-1] = url[-1].replace(',','').replace('.urlset','').replace('/hls','') + url[-1] = url[-1].replace(',','').replace('.urlset','').replace('/hls','') + '|Referer=' + page_url return video_urls diff --git a/tests/test_generic.py b/tests/test_generic.py index e89b677e..6d02caf4 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -76,7 +76,7 @@ chNumRis = { }, 'altadefinizioneclick': { 'Film': 36, - 'Serie TV': 12, + 'Serie TV': 36, }, 'casacinema': { 'Film': 10, From 1747d75f92435980a38c24ba35ae5841b0af5465 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:50:21 +0000 Subject: [PATCH 118/139] Aggiornamento domini --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index 79672359..3721c466 100644 --- a/channels.json +++ b/channels.json @@ -22,7 +22,7 @@ "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", "guardaserieclick": "https://www.guardaserie.builders", - "guardaserieicu": "https://guardaserie.blog", + "guardaserieicu": "https://guardaserie.boutique", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", "ilgeniodellostreaming": "https://ilgeniodellostreaming.wtf", From 6d2760278c18e91ef4f501153c228bcc6368852e Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sat, 14 Aug 2021 19:19:31 +0200 Subject: [PATCH 119/139] Fix streamtape, filmpertutti->aggiornamenti --- channels/filmpertutti.py | 2 +- servers/streamtape.py | 10 ++++------ tests/test_generic.py | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/channels/filmpertutti.py b/channels/filmpertutti.py index 87929750..e00961f5 100644 --- a/channels/filmpertutti.py +++ b/channels/filmpertutti.py @@ -45,7 +45,7 @@ def peliculas(item): patronNext = r'<a href="([^"]+)[^>]+>Pagina' else: patronBlock = r'<ul class="posts">(?P<block>.*)<div class="clear[^"]*">' - patron = r'<li>\s?<a href="(?P<url>[^"]+)" data-thumbnail="(?P<thumb>[^"]+)">.*?<div class="title[^"]*">(?P<title>.+?)(?:\s\[(?P<quality>HD)\])?<\/div><div class="episode[^"]*"[^>]+>(?P<episode>[^<(]+)(?:\((?P<lang>[a-zA-Z\-]+)\))?' + patron = r'<li>\s?<a href="(?P<url>[^"]+)" data-thumbnail="(?P<thumb>[^"]+)">.*?<div class="title[^"]*">(?P<title>.+?)(?:\s\[(?P<quality>HD)\])?<\/div>\s*<div class="episode[^"]*"[^>]+>(?P<episode>[^<(]+)(?:\((?P<lang>[a-zA-Z\-]+)\))?' if item.args == 'search': action = 'select' diff --git a/servers/streamtape.py b/servers/streamtape.py index e1311620..6656d0aa 100644 --- a/servers/streamtape.py +++ b/servers/streamtape.py @@ -27,17 +27,15 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.debug("url=" + page_url) - # from core .support import dbg;dbg() video_urls = [] - possible_url = '' - find_url = match(data, patron=r'''innerHTML = ["']([^"]+)["'](?:\s*\+\s*['"]([^"']+))?''').match - for m in find_url: - possible_url += m + find_url = match(data, patron=r'''innerHTML = ["']([^"]+)["'](?:\s*\+\s*['"(]+([^"']+))?''').match + possible_url = find_url[0] + possible_url += find_url[1][2:] if not possible_url: possible_url = match(data, patron=r"innerHTML\\'\]=\\'([^']+)").match url = "https:" + possible_url url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "") video_urls.append(['MP4 [Streamtape]', url]) - return video_urls \ No newline at end of file + return video_urls diff --git a/tests/test_generic.py b/tests/test_generic.py index 6d02caf4..3b2ebd1f 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -64,7 +64,7 @@ validUrlRegex = re.compile( r'(?::\d+)?' # optional port r'(?:/?|[/?]\S+)$', re.IGNORECASE) -chBlackList = ['url', 'mediasetplay'] +chBlackList = ['url', 'mediasetplay', 'metalvideo'] srvBlacklist = ['mega', 'hdmario', 'torrent', 'youtube'] chNumRis = { 'altadefinizione01': { From b29aaea5f8710ad847f0ade13ac6adf8c8425337 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Mon, 16 Aug 2021 18:19:30 +0200 Subject: [PATCH 120/139] DNS cache: rinnovo dopo 7 giorni --- core/resolverdns.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/core/resolverdns.py b/core/resolverdns.py index e6f57c08..7f22ddef 100644 --- a/core/resolverdns.py +++ b/core/resolverdns.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -import os, sys, ssl +import datetime, sys, ssl PY3 = False if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int if PY3: @@ -24,6 +24,8 @@ elif 'PROTOCOL_SSLv23' in ssl.__dict__: else: protocol = ssl.PROTOCOL_SSLv3 +current_date = datetime.datetime.now() + class CustomContext(ssl.SSLContext): def __init__(self, protocol, hostname, *args, **kwargs): @@ -54,10 +56,13 @@ class CipherSuiteAdapter(host_header_ssl.HostHeaderSSLAdapter): return self.send(request, flushedDns=True, **kwargs) def getIp(self, domain): - ip = db['dnscache'].get(domain, None) - logger.info('Cache DNS: ' + domain + ' = ' + str(ip)) + cache = db['dnscache'].get(domain, {}) + ip = None + if type(cache) != dict or (cache.get('datetime') and + current_date - cache.get('datetime') > datetime.timedelta(days=7)): + cache = None - if not ip: # not cached + if not cache: # not cached try: ip = doh.query(domain)[0] logger.info('Query DoH: ' + domain + ' = ' + str(ip)) @@ -65,11 +70,14 @@ class CipherSuiteAdapter(host_header_ssl.HostHeaderSSLAdapter): except Exception: logger.error('Failed to resolve hostname, fallback to normal dns') import traceback - logger.error(traceback.print_exc()) + logger.error(traceback.format_exc()) + else: + ip = cache.get('ip') + logger.info('Cache DNS: ' + domain + ' = ' + str(ip)) return ip def writeToCache(self, domain, ip): - db['dnscache'][domain] = ip + db['dnscache'][domain] = {'ip': ip, 'datetime': current_date} def init_poolmanager(self, *args, **kwargs): kwargs['ssl_context'] = self.ssl_context From 673147646c631939922edbde601b9454fba5d1f3 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Mon, 16 Aug 2021 19:01:29 +0200 Subject: [PATCH 121/139] casacinema: fix per alcuni contenuti --- lib/unshortenit.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/unshortenit.py b/lib/unshortenit.py index ba8f3479..ccc92ac1 100644 --- a/lib/unshortenit.py +++ b/lib/unshortenit.py @@ -59,6 +59,7 @@ class UnshortenIt(object): def unshorten(self, uri, type=None): code = 0 while True: + uri = uri.strip() oldUri = uri domain = urlsplit(uri).netloc if not domain: From e38ec3527ca2fe340d467e324b5b714097cd63df Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Aug 2021 17:49:19 +0000 Subject: [PATCH 122/139] Aggiornamento domini --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index 3721c466..7ab67f6c 100644 --- a/channels.json +++ b/channels.json @@ -22,7 +22,7 @@ "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", "guardaserieclick": "https://www.guardaserie.builders", - "guardaserieicu": "https://guardaserie.boutique", + "guardaserieicu": "https://guardaserie.clothing", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", "ilgeniodellostreaming": "https://ilgeniodellostreaming.wtf", From 664d1da7b78962129c38afcd1fe12cdd32344edf Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Tue, 17 Aug 2021 12:56:06 +0200 Subject: [PATCH 123/139] Fix altadefinizionecommunity --- channels/altadefinizionecommunity.py | 27 ++++++++++++--------------- core/httptools.py | 14 +++++++++----- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index 70fed68c..b4d4e92f 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -6,8 +6,6 @@ from lib.fakeMail import Gmailnator from platformcode import config, platformtools, logger from core import scrapertools, httptools -from lib import cloudscraper - def findhost(url): return support.match(url, patron=r'<a href="([^"]+)/\w+">Accedi').match @@ -17,7 +15,6 @@ host = config.get_channel_url(findhost) register_url = 'https://altaregistrazione.com' headers = {'Referer': host, 'x-requested-with': 'XMLHttpRequest'} -cf = cloudscraper.create_scraper() @support.menu def mainlist(item): @@ -44,8 +41,8 @@ def mainlist(item): def login(): - r = cf.get(host) - Token = support.match(r.text, patron=r'name=\s*"_token"\s*value=\s*"([^"]+)').match + r = support.httptools.downloadpage(host, cloudscraper=True) + Token = support.match(r.data, patron=r'name=\s*"_token"\s*value=\s*"([^"]+)', cloudscraper=True).match if 'id="logged"' in r.text: logger.info('Già loggato') else: @@ -55,7 +52,7 @@ def login(): 'email': config.get_setting('username', channel='altadefinizionecommunity'), 'password':config.get_setting('password', channel='altadefinizionecommunity')} - r = cf.post(host + '/login', json=post, headers={'referer': host}) + r = support.httptools.downloadpage(host + '/login', post=post, headers={'referer': host}, cloudscraper=True) if not r.status_code in [200, 302] or 'Email o Password non validi' in r.text: platformtools.dialog_ok('AltadefinizioneCommunity', 'Username/password non validi') return False @@ -95,7 +92,7 @@ def registerOrLogin(): reg = platformtools.dialog_register(register_url, email=True, password=True, email_default=mailbox.address, password_default=randPsw) if not reg: return False - regPost = httptools.downloadpage(register_url, post={'email': reg['email'], 'password': reg['password']}) + regPost = httptools.downloadpage(register_url, post={'email': reg['email'], 'password': reg['password']}, cloudscraper=True) if regPost.url == register_url: error = scrapertools.htmlclean(scrapertools.find_single_match(regPost.data, 'Impossibile proseguire.*?</div>')) @@ -111,7 +108,7 @@ def registerOrLogin(): if mail: checkUrl = scrapertools.find_single_match(mail.body, '<a href="([^"]+)[^>]+>Verifica').replace(r'\/', '/') logger.debug('CheckURL: ' + checkUrl) - httptools.downloadpage(checkUrl) + httptools.downloadpage(checkUrl, cloudscraper=True) config.set_setting('username', mailbox.address, channel='altadefinizionecommunity') config.set_setting('password', randPsw, channel='altadefinizionecommunity') platformtools.dialog_ok('AltadefinizioneCommunity', @@ -136,13 +133,13 @@ def peliculas(item): support.info(item) if '/load-more-film' not in item.url and '/search' not in item.url: # generi o altri menu, converto import ast - ajax = support.match(item.url, patron='ajax_data\s*=\s*"?\s*([^;]+)').match + ajax = support.match(item.url, patron='ajax_data\s*=\s*"?\s*([^;]+)', cloudscraper=True).match item.url = host + '/load-more-film?' + support.urlencode(ast.literal_eval(ajax)) + '&page=1' if not '/search' in item.url: - json = support.httptools.downloadpage(item.url, headers=headers).json + json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json data = "\n".join(json['data']) else: - data = support.httptools.downloadpage(item.url, headers=headers).data + data = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).data patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*<span[^>]+>[^<]+</span>\s*<span class="qual">(?P<quality>[^<]+).*?<img src="(?P<thumbnail>[^"]+)[^>]+>\s*<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?' # paginazione @@ -176,7 +173,7 @@ def search(item, texto): @support.scrape def genres(item): support.info(item) - data = cf.get(item.url).text + data = support.httptools.downloadpage(item.url, cloudscraper=True).data patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)' if item.args == 'quality': @@ -209,7 +206,7 @@ def findvideos(item): itemlist = [] video_url = item.url if '/watch-unsubscribed' not in video_url: - playWindow = support.match(cf.get(item.url).text, patron='playWindow" href="([^"]+)') + playWindow = support.match(support.httptools.downloadpage(item.url, cloudscraper=True).data, patron='playWindow" href="([^"]+)') video_url = playWindow.match if '/tvshow' in video_url: item.data = playWindow.data @@ -217,7 +214,7 @@ def findvideos(item): return episodios(item) item.contentType = 'movie' itemlist.append(item.clone(action='play', url=support.match(video_url.replace('/watch-unsubscribed', '/watch-external'), - patron='allowfullscreen[^<]+src="([^"]+)"').match, quality='')) + patron='allowfullscreen[^<]+src="([^"]+)"', cloudscraper=True).match, quality='')) # itemlist.append(item.clone(action='play', server='directo', title=support.config.get_localized_string(30137), # url=video_url.replace('/watch-unsubscribed', '/watch'))) return support.server(item, itemlist=itemlist) @@ -226,7 +223,7 @@ def findvideos(item): def play(item): if host in item.url: # intercetto il server proprietario if registerOrLogin(): - return support.get_jwplayer_mediaurl(cf.get(item.url).text, 'Diretto') + return support.get_jwplayer_mediaurl(support.httptools.downloadpage(item.url, cloudscraper=True).data, 'Diretto') else: platformtools.play_canceled = True return [] diff --git a/core/httptools.py b/core/httptools.py index 33ea85a3..5359cef8 100755 --- a/core/httptools.py +++ b/core/httptools.py @@ -285,12 +285,16 @@ def downloadpage(url, **opt): parse = urlparse.urlparse(url) domain = parse.netloc - from lib import requests - session = requests.session() + if opt.get('cloudscraper'): + from lib import cloudscraper + session = cloudscraper.create_scraper() + else: + from lib import requests + session = requests.session() - if config.get_setting('resolver_dns') and not opt.get('use_requests', False): - from core import resolverdns - session.mount('https://', resolverdns.CipherSuiteAdapter(domain)) + if config.get_setting('resolver_dns') and not opt.get('use_requests', False): + from core import resolverdns + session.mount('https://', resolverdns.CipherSuiteAdapter(domain)) req_headers = default_headers.copy() From 917c9f4c847ef143ed17ed216dca312d30c40138 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Tue, 17 Aug 2021 17:08:03 +0200 Subject: [PATCH 124/139] Fix altadefinizionecommunity -> ricerca --- channels/altadefinizionecommunity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index b4d4e92f..5fb3fb84 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -139,7 +139,8 @@ def peliculas(item): json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json data = "\n".join(json['data']) else: - data = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).data + json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json + data = "\n".join(json['data']) patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*<span[^>]+>[^<]+</span>\s*<span class="qual">(?P<quality>[^<]+).*?<img src="(?P<thumbnail>[^"]+)[^>]+>\s*<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?' # paginazione @@ -156,7 +157,6 @@ def peliculas(item): def search(item, texto): support.info("search ", texto) - # support.dbg() item.args = 'search' item.url = host + "/search?s={}&page=1".format(texto) From daae4589525ac5a5a47c9c55e0eb5253a7fc94ff Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Thu, 19 Aug 2021 11:56:41 +0200 Subject: [PATCH 125/139] Fix streamtape --- servers/streamtape.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/servers/streamtape.py b/servers/streamtape.py index 6656d0aa..0aaba9c1 100644 --- a/servers/streamtape.py +++ b/servers/streamtape.py @@ -2,10 +2,11 @@ # -------------------------------------------------------- # Conector streamtape By Alfa development Group # -------------------------------------------------------- -from core import httptools, scrapertools +from core import httptools from platformcode import logger, config from core.support import match import sys +from lib import js2py PY3 = False if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int @@ -27,14 +28,9 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.debug("url=" + page_url) - video_urls = [] - find_url = match(data, patron=r'''innerHTML = ["']([^"]+)["'](?:\s*\+\s*['"(]+([^"']+))?''').match - possible_url = find_url[0] - possible_url += find_url[1][2:] - - if not possible_url: - possible_url = match(data, patron=r"innerHTML\\'\]=\\'([^']+)").match + find_url = match(data, patron=r'innerHTML = ([^;]+)').match + possible_url = js2py.eval_js(find_url) url = "https:" + possible_url url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "") video_urls.append(['MP4 [Streamtape]', url]) From 1bdbc18926ce3a40d04d4be0c0274312c288d78a Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sat, 21 Aug 2021 16:55:18 +0200 Subject: [PATCH 126/139] Test per freeze kodi da videoteca --- platformcode/platformtools.py | 5 +++++ platformcode/xbmc_videolibrary.py | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 37e68a4e..91e49d20 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1780,7 +1780,12 @@ def prevent_busy(item): if not item.autoplay and not item.window: if item.globalsearch: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) else: xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) + # first wait the fake video to start + while not is_playing(): + xbmc.sleep(10) + # then wait a little more xbmc.sleep(200) + # and then stop it xbmc.Player().stop() # xbmc.executebuiltin('Action(Stop)') # xbmc.sleep(500) diff --git a/platformcode/xbmc_videolibrary.py b/platformcode/xbmc_videolibrary.py index 1e77e02b..43222a83 100644 --- a/platformcode/xbmc_videolibrary.py +++ b/platformcode/xbmc_videolibrary.py @@ -74,7 +74,6 @@ def mark_auto_as_watched(item): # check for next Episode if next_episode and sync and time_from_end >= difference: - support.dbg() nextdialog = NextDialog(ND, config.get_runtime_path()) while platformtools.is_playing() and not nextdialog.is_exit(): xbmc.sleep(100) From ffd69d90671aaf859b36ee77a7648e987388d36f Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sat, 21 Aug 2021 19:57:56 +0200 Subject: [PATCH 127/139] ops --- specials/globalsearch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specials/globalsearch.py b/specials/globalsearch.py index fce4723b..7d2692c4 100644 --- a/specials/globalsearch.py +++ b/specials/globalsearch.py @@ -789,7 +789,7 @@ class SearchWindow(xbmcgui.WindowXML): def play(self, server=None): + server.globalsearch = True platformtools.prevent_busy(server) server.window = True - server.globalsearch = True return run(server) From 2d6a4abc1c67cdc445a3e0df19e597e133f585e0 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Mon, 23 Aug 2021 18:23:31 +0200 Subject: [PATCH 128/139] Fix Riproduzione da Videoteca --- platformcode/platformtools.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 91e49d20..4bacfdeb 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1778,8 +1778,8 @@ def set_played_time(item): def prevent_busy(item): logger.debug() if not item.autoplay and not item.window: - if item.globalsearch: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) - else: xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) + if item.action == 'play_from_library': xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) + else: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) # first wait the fake video to start while not is_playing(): xbmc.sleep(10) @@ -1787,7 +1787,3 @@ def prevent_busy(item): xbmc.sleep(200) # and then stop it xbmc.Player().stop() - # xbmc.executebuiltin('Action(Stop)') - # xbmc.sleep(500) - # xbmc.Player().stop() - # xbmc.sleep(500) \ No newline at end of file From 55dfc1b2e47456c78b4e50eb2ad3a40b554b6f26 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Mon, 23 Aug 2021 18:29:15 +0200 Subject: [PATCH 129/139] Fix Ordine Server --- core/servertools.py | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/core/servertools.py b/core/servertools.py index e145d203..75d0c058 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -689,14 +689,15 @@ def sort_servers(servers_list): servers_list = sorted(servers_list, key=lambda x: favorite_servers.index(x) if x in favorite_servers else 999) return servers_list - quality_list = ['4k', '2160p', '2160', '4k2160p', '4k2160', '4k 2160p', '4k 2160', '2k', + favorite_quality = ['4k', '2160p', '2160', '4k2160p', '4k2160', '4k 2160p', '4k 2160', '2k', 'fullhd', 'fullhd 1080', 'fullhd 1080p', 'full hd', 'full hd 1080', 'full hd 1080p', 'hd1080', 'hd1080p', 'hd 1080', 'hd 1080p', '1080', '1080p', 'hd', 'hd720', 'hd720p', 'hd 720', 'hd 720p', '720', '720p', 'hdtv', 'sd', '480p', '480', '360p', '360', '240p', '240'] sorted_list = [] url_list_valid = [] - favorite_quality = quality_list.reverse() if config.get_setting('default_action') == 1 else quality_list + if config.get_setting('default_action') == 1: + favorite_quality.reverse() # Priorities when ordering itemlist: # 0: Servers and Qualities @@ -729,36 +730,22 @@ def sort_servers(servers_list): # if priority < 2: # 0: Servers and qualities or 1: Qualities and servers - element["indice_server"] = index(favorite_servers, item.server.lower()) - element["indice_quality"] = index(favorite_quality, item.quality.lower()) + element["index_server"] = index(favorite_servers, item.server.lower()) + element["index_quality"] = index(favorite_quality, item.quality.lower()) - # elif priority == 2: # Servers only - # element["indice_server"] = index(favorite_servers, item.server.lower()) - # elif priority == 3: # Only qualities - # element["indice_quality"] = index(favorite_quality, item.quality.lower()) - # else: # Do not order - # if item.url in url_list_valid: - # continue - - element['indice_language'] = 0 if item.contentLanguage == 'ITA' else 1 + element['index_language'] = 0 if item.contentLanguage == 'ITA' else 1 element['videoitem'] = item sorted_list.append(element) # We order according to priority - # if priority == 0: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_server'], orden['indice_quality'])) # Servers and Qualities - # elif priority == 1: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_quality'], orden['indice_server'])) # Qualities and Servers - # elif priority == 2: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_server'])) # Servers only - # elif priority == 3: sorted_list.sort(key=lambda orden: (orden['indice_language'], orden['indice_quality'])) # Only qualities - # else: sorted_list.sort(key=lambda orden: orden['indice_language']) - - if priority == 0: sorted_list.sort(key=lambda row: (row['indice_language'], row['indice_server'], row['indice_quality'])) # Servers and Qualities - elif priority == 1: sorted_list.sort(key=lambda row: (row['indice_language'], row['indice_quality'], row['indice_server'])) # Qualities and Servers - elif priority == 2: sorted_list.sort(key=lambda row: (row['indice_language'], row['indice_server'])) # Servers only - elif priority == 3: sorted_list.sort(key=lambda row: (row['indice_language'], row['indice_quality'])) # Only qualities - else: sorted_list.sort(key=lambda row: (row['indice_language'], row['indice_quality'])) + if priority == 0: sorted_list.sort(key=lambda row: (row['index_language'], row['index_server'], row['index_quality'])) # Servers and Qualities + elif priority == 1: sorted_list.sort(key=lambda row: (row['index_language'], row['index_quality'], row['index_server'])) # Qualities and Servers + elif priority == 2: sorted_list.sort(key=lambda row: (row['index_language'], row['index_server'])) # Servers only + elif priority == 3: sorted_list.sort(key=lambda row: (row['index_language'], row['index_quality'])) # Only qualities + else: sorted_list.sort(key=lambda row: (row['index_language'], row['index_quality'])) return [v['videoitem'] for v in sorted_list if v] From 0d30206ffd2c0d65d2a4cb948fd304a29886029c Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Tue, 24 Aug 2021 10:11:00 +0200 Subject: [PATCH 130/139] Test Busy --- platformcode/platformtools.py | 16 +++++++++------- platformcode/xbmc_videolibrary.py | 7 ++++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 4bacfdeb..bbde544d 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1348,7 +1348,7 @@ def set_player(item, xlistitem, mediaurl, view, strm): logger.info("mediaurl=" + mediaurl) if player_mode in [0,1]: - prevent_busy(item) + # prevent_busy(item) if player_mode in [1]: item.played_time = resume_playback(get_played_time(item)) @@ -1449,7 +1449,7 @@ def play_torrent(item, xlistitem, mediaurl): selection = 0 if selection >= 0: - prevent_busy(item) + # prevent_busy(item) mediaurl = urllib.quote_plus(item.url) torr_client = torrent_options[selection][0] @@ -1777,12 +1777,14 @@ def set_played_time(item): def prevent_busy(item): logger.debug() - if not item.autoplay and not item.window: - if item.action == 'play_from_library': xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) - else: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) + # from core.support import dbg;dbg() + if not item.autoplay and not item.window and item.action == 'play_from_library': + xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) + # else: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) # first wait the fake video to start - while not is_playing(): - xbmc.sleep(10) + # while not is_playing(): + # logger.debug('wait for play') + # pass # then wait a little more xbmc.sleep(200) # and then stop it diff --git a/platformcode/xbmc_videolibrary.py b/platformcode/xbmc_videolibrary.py index 43222a83..1f827cf5 100644 --- a/platformcode/xbmc_videolibrary.py +++ b/platformcode/xbmc_videolibrary.py @@ -26,11 +26,10 @@ def mark_auto_as_watched(item): actual_time = 0 total_time = 0 - time_limit = time.time() + 30 + time_limit = time.time() + 10 while not platformtools.is_playing() and time.time() < time_limit: time.sleep(1) - marked = False sync = False next_episode = None @@ -38,6 +37,7 @@ def mark_auto_as_watched(item): percentage = float(config.get_setting("watched_setting")) / 100 time_from_end = config.get_setting('next_ep_seconds') + if item.contentType != 'movie' and 0 < config.get_setting('next_ep') < 3: next_dialogs = ['NextDialog.xml', 'NextDialogExtended.xml', 'NextDialogCompact.xml'] next_ep_type = config.get_setting('next_ep_type') @@ -46,7 +46,8 @@ def mark_auto_as_watched(item): except: next_episode = False logger.debug(next_episode) - while platformtools.is_playing(): + while not xbmc.Monitor().abortRequested(): + if not platformtools.is_playing(): break try: actual_time = xbmc.Player().getTime() except: pass try: total_time = xbmc.Player().getTotalTime() From 1e7959439f018e800d42e86262cf2c3bd4271be6 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Tue, 24 Aug 2021 10:41:00 +0200 Subject: [PATCH 131/139] Test Busy 2 --- platformcode/platformtools.py | 21 +++++++++------------ specials/globalsearch.py | 2 +- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index bbde544d..37e68a4e 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1348,7 +1348,7 @@ def set_player(item, xlistitem, mediaurl, view, strm): logger.info("mediaurl=" + mediaurl) if player_mode in [0,1]: - # prevent_busy(item) + prevent_busy(item) if player_mode in [1]: item.played_time = resume_playback(get_played_time(item)) @@ -1449,7 +1449,7 @@ def play_torrent(item, xlistitem, mediaurl): selection = 0 if selection >= 0: - # prevent_busy(item) + prevent_busy(item) mediaurl = urllib.quote_plus(item.url) torr_client = torrent_options[selection][0] @@ -1777,15 +1777,12 @@ def set_played_time(item): def prevent_busy(item): logger.debug() - # from core.support import dbg;dbg() - if not item.autoplay and not item.window and item.action == 'play_from_library': - xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) - # else: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) - # first wait the fake video to start - # while not is_playing(): - # logger.debug('wait for play') - # pass - # then wait a little more + if not item.autoplay and not item.window: + if item.globalsearch: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) + else: xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) xbmc.sleep(200) - # and then stop it xbmc.Player().stop() + # xbmc.executebuiltin('Action(Stop)') + # xbmc.sleep(500) + # xbmc.Player().stop() + # xbmc.sleep(500) \ No newline at end of file diff --git a/specials/globalsearch.py b/specials/globalsearch.py index 7d2692c4..fce4723b 100644 --- a/specials/globalsearch.py +++ b/specials/globalsearch.py @@ -789,7 +789,7 @@ class SearchWindow(xbmcgui.WindowXML): def play(self, server=None): - server.globalsearch = True platformtools.prevent_busy(server) server.window = True + server.globalsearch = True return run(server) From 7bb4c5b790f54a4cae5d3e2b909e92495c626cb4 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Wed, 25 Aug 2021 19:34:49 +0200 Subject: [PATCH 132/139] Fix Altadefinizione Community --- channels/altadefinizionecommunity.py | 64 +++++++++++++++------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index 5fb3fb84..c9169444 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # ------------------------------------------------------------ # Canale per Altadefinizione Community + from core import support from lib.fakeMail import Gmailnator from platformcode import config, platformtools, logger @@ -18,22 +19,22 @@ headers = {'Referer': host, 'x-requested-with': 'XMLHttpRequest'} @support.menu def mainlist(item): - support.info(item) + logger.debug(item) film = ['/load-more-film?anno=&order=&support_webp=1&type=movie&page=1', - #Voce Menu,['url','action','args',contentType] - ('Generi', ['', 'genres', 'genres']), + # Voce Menu,['url','action','args',contentType] + ('Generi Film', ['', 'genres', 'genres']), ] tvshow = ['/load-more-film?type=tvshow&anno=&order=&support_webp=1&page=1', - #Voce Menu,['url','action','args',contentType] - ('Generi', ['', 'genres', 'genres']), + # Voce Menu,['url','action','args',contentType] + ('Generi Serie TV', ['', 'genres', 'genres']), ] altri = [ - # ('Per Lettera', ['/lista-film', 'genres', 'letters']), + # ('A-Z', ['/lista-film', 'genres', 'letters']), ('Qualità', ['', 'genres', 'quality']), - # ('Anni', ['/anno', 'genres', 'years']) + ('Anni', ['/anno', 'genres', 'years']) ] search = '' @@ -128,9 +129,8 @@ def registerOrLogin(): @support.scrape def peliculas(item): - # debug = True json = {} - support.info(item) + action = 'check' if '/load-more-film' not in item.url and '/search' not in item.url: # generi o altri menu, converto import ast ajax = support.match(item.url, patron='ajax_data\s*=\s*"?\s*([^;]+)', cloudscraper=True).match @@ -139,8 +139,8 @@ def peliculas(item): json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json data = "\n".join(json['data']) else: - json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json - data = "\n".join(json['data']) + disabletmdb = True + data = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).data patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*<span[^>]+>[^<]+</span>\s*<span class="qual">(?P<quality>[^<]+).*?<img src="(?P<thumbnail>[^"]+)[^>]+>\s*<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?' # paginazione @@ -156,7 +156,7 @@ def peliculas(item): def search(item, texto): - support.info("search ", texto) + logger.debug("search ", texto) item.args = 'search' item.url = host + "/search?s={}&page=1".format(texto) @@ -172,51 +172,55 @@ def search(item, texto): @support.scrape def genres(item): - support.info(item) + logger.debug(item) data = support.httptools.downloadpage(item.url, cloudscraper=True).data patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)' if item.args == 'quality': - patronBlock = 'Risoluzione(?P<block>.*?)</ul>' + patronBlock = r'Risoluzione(?P<block>.*?)</ul>' + elif item.args == 'years': + patronBlock = r'ANNO(?P<block>.*?</section>)' else: patronBlock = ('Film' if item.contentType == 'movie' else 'Serie TV') + r'<span></span></a>\s+<ul class="dropdown-menu(?P<block>.*?)active-parent-menu' action = 'peliculas' - - # debug = True return locals() @support.scrape def episodios(item): - support.info(item) + logger.debug(item) data = item.data patron = r'class="playtvshow " data-href="(?P<url>[^"]+)' - # debug = True def itemHook(it): spl = it.url.split('/')[-2:] - it.contentSeason = int(spl[0])+1 - it.contentEpisodeNumber = int(spl[1])+1 - it.title = str(it.contentSeason) + 'x' + str(it.contentEpisodeNumber) + it.infoLabels['season'] = int(spl[0])+1 + it.infoLabels['episode'] = int(spl[1])+1 + it.url = it.url.replace('/watch-unsubscribed', '/watch-external') + it.title = '{}x{:02d} - {}'.format(it.contentSeason, it.contentEpisodeNumber, it.contentTitle) return it + return locals() -def findvideos(item): - itemlist = [] - video_url = item.url - if '/watch-unsubscribed' not in video_url: +def check(item): + if '/watch-unsubscribed' not in item.url: playWindow = support.match(support.httptools.downloadpage(item.url, cloudscraper=True).data, patron='playWindow" href="([^"]+)') video_url = playWindow.match if '/tvshow' in video_url: item.data = playWindow.data item.contentType = 'tvshow' return episodios(item) - item.contentType = 'movie' - itemlist.append(item.clone(action='play', url=support.match(video_url.replace('/watch-unsubscribed', '/watch-external'), - patron='allowfullscreen[^<]+src="([^"]+)"', cloudscraper=True).match, quality='')) - # itemlist.append(item.clone(action='play', server='directo', title=support.config.get_localized_string(30137), - # url=video_url.replace('/watch-unsubscribed', '/watch'))) + else: + item.url = video_url.replace('/watch-unsubscribed', '/watch-external') + item.contentType = 'movie' + return findvideos(item) + +def findvideos(item): + itemlist = [] + + itemlist.append(item.clone(action='play', url=support.match(item.url, patron='allowfullscreen[^<]+src="([^"]+)"', cloudscraper=True).match, quality='')) + return support.server(item, itemlist=itemlist) From babe1870846388721cc4a8b26b7fd3b7e85eccb5 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Thu, 26 Aug 2021 12:40:41 +0200 Subject: [PATCH 133/139] Fix Altadefinizione Click --- channels/altadefinizionecommunity.py | 18 ++++++++++++++---- core/support.py | 5 +++-- core/videolibrarytools.py | 6 +++--- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index c9169444..3a75d587 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -130,7 +130,15 @@ def registerOrLogin(): @support.scrape def peliculas(item): json = {} - action = 'check' + + if item.contentType == 'undefined': + disabletmdb = True + action = 'check' + elif item.contentType == 'movie': + action = 'findvideos' + else: + action = 'episodios' + if '/load-more-film' not in item.url and '/search' not in item.url: # generi o altri menu, converto import ast ajax = support.match(item.url, patron='ajax_data\s*=\s*"?\s*([^;]+)', cloudscraper=True).match @@ -139,8 +147,8 @@ def peliculas(item): json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json data = "\n".join(json['data']) else: - disabletmdb = True - data = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).data + json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json + data = "\n".join(json['data']) patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*<span[^>]+>[^<]+</span>\s*<span class="qual">(?P<quality>[^<]+).*?<img src="(?P<thumbnail>[^"]+)[^>]+>\s*<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?' # paginazione @@ -177,8 +185,10 @@ def genres(item): patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)' if item.args == 'quality': + item.contentType = 'undefined' patronBlock = r'Risoluzione(?P<block>.*?)</ul>' elif item.args == 'years': + item.contentType = 'undefined' patronBlock = r'ANNO(?P<block>.*?</section>)' else: patronBlock = ('Film' if item.contentType == 'movie' else 'Serie TV') + r'<span></span></a>\s+<ul class="dropdown-menu(?P<block>.*?)active-parent-menu' @@ -197,7 +207,7 @@ def episodios(item): it.infoLabels['season'] = int(spl[0])+1 it.infoLabels['episode'] = int(spl[1])+1 it.url = it.url.replace('/watch-unsubscribed', '/watch-external') - it.title = '{}x{:02d} - {}'.format(it.contentSeason, it.contentEpisodeNumber, it.contentTitle) + it.title = '{}x{:02d} - {}'.format(it.contentSeason, it.contentEpisodeNumber, it.fulltitle) return it return locals() diff --git a/core/support.py b/core/support.py index 9ac8ab52..9e5e0f80 100755 --- a/core/support.py +++ b/core/support.py @@ -277,6 +277,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t scraped[kk] = val.strip() if type(val) == str else val # episode = re.sub(r'\s-\s|-|x|–|×', 'x', scraped['episode']) if scraped['episode'] else '' + title = cleantitle(scraped.get('title', '')) if group and scraped.get('title', '') in contents and not item.grouped: # same title and grouping enabled continue @@ -441,8 +442,8 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t infoLabels=infolabels, thumbnail=item.prevthumb if item.prevthumb else item.thumbnail if not scraped["thumb"] else scraped["thumb"], args=item.args, - contentSerieName= title if 'movie' not in [contentType] and function != 'episodios' else item.contentSerieName, - contentTitle= title if 'movie' in [contentType] and function == 'peliculas' else item.contentTitle, + contentSerieName= title if contentType not in ['movie'] and function != 'episodios' or contentType in ['undefined'] else item.contentSerieName, + contentTitle= title if contentType in ['movie', 'undefined'] and function == 'peliculas' else item.contentTitle, contentLanguage = lang1, contentSeason= infolabels.get('season', ''), contentEpisodeNumber=infolabels.get('episode', ''), diff --git a/core/videolibrarytools.py b/core/videolibrarytools.py index 2daf2093..c2446c29 100644 --- a/core/videolibrarytools.py +++ b/core/videolibrarytools.py @@ -952,7 +952,7 @@ def get_local_content(path): def add_to_videolibrary(item, channel): itemlist = getattr(channel, item.from_action)(item) if itemlist and itemlist[0].contentType == 'episode': - return add_tvshow(item, channel) + return add_tvshow(item, channel, itemlist) else: return add_movie(item) @@ -998,7 +998,7 @@ def add_movie(item): config.get_localized_string(60066) % new_item.contentTitle) # "ERROR, the movie has NOT been added to the video library") -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: - The series with all the chapters included in the episodelist. @@ -1060,7 +1060,7 @@ def add_tvshow(item, channel=None): # Get the episode list # from core.support import dbg;dbg() - itemlist = getattr(channel, item.action)(item) + if not itemlist: itemlist = getattr(channel, item.action)(item) if itemlist and not scrapertools.find_single_match(itemlist[0].title, r'[Ss]?(\d+)(?:x|_|\s+)[Ee]?[Pp]?(\d+)'): from platformcode.autorenumber import start, check if not check(item): From 48eac3643b5f9fb52cfb004ce54ec31211eab73c Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Thu, 26 Aug 2021 16:20:25 +0200 Subject: [PATCH 134/139] Test Semplificazione Ordine server e piccoli fix --- core/autoplay.py | 14 +++++------ core/servertools.py | 45 +++++++++++------------------------ core/tmdb.py | 2 ++ platformcode/platformtools.py | 32 ++++++++++++------------- 4 files changed, 39 insertions(+), 54 deletions(-) diff --git a/core/autoplay.py b/core/autoplay.py index d5eace64..9aae4d4b 100644 --- a/core/autoplay.py +++ b/core/autoplay.py @@ -39,14 +39,14 @@ def start(itemlist, item): if not config.is_xbmc(): return itemlist - # Save the current value of "Action and Player Mode" in preferences - user_config_setting_action = config.get_setting("default_action") - # user_config_setting_player = config.get_setting("player_mode") - - # Enable the "View in high quality" action (if the server returns more than one quality, eg gdrive) - if not user_config_setting_action: config.set_setting("default_action", 2) - if config.get_setting('autoplay'): + # Save the current value of "Action and Player Mode" in preferences + user_config_setting_action = config.get_setting("default_action") + # user_config_setting_player = config.get_setting("player_mode") + + # Enable the "View in high quality" action (if the server returns more than one quality, eg gdrive) + if not user_config_setting_action: config.set_setting("default_action", 2) + from core.servertools import sort_servers autoplay_list = sort_servers(itemlist) diff --git a/core/servertools.py b/core/servertools.py index 75d0c058..66d01c0b 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -695,28 +695,19 @@ def sort_servers(servers_list): 'sd', '480p', '480', '360p', '360', '240p', '240'] sorted_list = [] - url_list_valid = [] - if config.get_setting('default_action') == 1: - favorite_quality.reverse() + inverted = False + + if config.get_setting('default_action') == 2: + inverted = True # Priorities when ordering itemlist: - # 0: Servers and Qualities - # 1: Qualities and Servers - # 2: Servers only - # 3: Only qualities - # 4: Do not order - - if config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and not config.get_setting('quality_priority'): - priority = 0 # 0: Servers and Qualities - elif config.get_setting('favorites_servers') and favorite_servers and config.get_setting('default_action') and config.get_setting('quality_priority'): - priority = 1 # 0: Qualities and Servers - elif config.get_setting('favorites_servers') and favorite_servers: - priority = 2 # Servers only - elif config.get_setting('default_action'): - priority = 3 # Only qualities - else: - priority = 4 # Do not order + # 0: Only Qualities + # 1: Servers and Qualities + # 2: Qualities and Servers + priority = 0 + if config.get_setting('favorites_servers') and favorite_servers: priority = 1 + if config.get_setting('quality_priority'): priority = 2 for item in servers_list: element = dict() @@ -728,24 +719,16 @@ def sort_servers(servers_list): if item.server.lower() in blacklisted_servers: continue - - # if priority < 2: # 0: Servers and qualities or 1: Qualities and servers element["index_server"] = index(favorite_servers, item.server.lower()) - element["index_quality"] = index(favorite_quality, item.quality.lower()) - - - + element["index_quality"] = platformtools.calcResolution(item.quality) element['index_language'] = 0 if item.contentLanguage == 'ITA' else 1 - element['videoitem'] = item sorted_list.append(element) # We order according to priority - if priority == 0: sorted_list.sort(key=lambda row: (row['index_language'], row['index_server'], row['index_quality'])) # Servers and Qualities - elif priority == 1: sorted_list.sort(key=lambda row: (row['index_language'], row['index_quality'], row['index_server'])) # Qualities and Servers - elif priority == 2: sorted_list.sort(key=lambda row: (row['index_language'], row['index_server'])) # Servers only - elif priority == 3: sorted_list.sort(key=lambda row: (row['index_language'], row['index_quality'])) # Only qualities - else: sorted_list.sort(key=lambda row: (row['index_language'], row['index_quality'])) + if priority == 0: sorted_list.sort(key=lambda element: (element['index_language'], -element['index_quality'] if inverted else element['index_quality'] , element['videoitem'].server)) + elif priority == 1: sorted_list.sort(key=lambda element: (element['index_language'], element['index_server'], -element['index_quality'] if inverted else element['index_quality'])) # Servers and Qualities + elif priority == 2: sorted_list.sort(key=lambda element: (element['index_language'], -element['index_quality'] if inverted else element['index_quality'], element['index_server'])) # Qualities and Servers return [v['videoitem'] for v in sorted_list if v] diff --git a/core/tmdb.py b/core/tmdb.py index 6813dca1..20d49618 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -1564,10 +1564,12 @@ class Tmdb(object): :rtype: list of Dict """ ret = [] + if self.result['id']: if self.result['videos']: self.result["videos"] = self.result["videos"]['results'] else: + self.result["videos"] = [] # First video search in the search language url = "{}/{}/{}/videos?api_key={}&language={}".format(host, self.search_type, self.result['id'], api, self.search_language) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 37e68a4e..bbfc34d6 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1057,23 +1057,23 @@ def get_seleccion(default_action, opciones, seleccion, video_urls): def calcResolution(option): - match = scrapertools.find_single_match(option, '([0-9]{2,4})x([0-9]{2,4})') - resolution = False + match = scrapertools.find_single_match(option, '([0-9]{2,4})(?:p|i|x[0-9]{2,4}|)') + resolution = 0 + if match: - resolution = int(match[0]) * int(match[1]) - else: - if '240p' in option: - resolution = 320 * 240 - elif '360p' in option: - resolution = 480 * 360 - elif ('480p' in option) or ('480i' in option): - resolution = 720 * 480 - elif ('576p' in option) or ('576p' in option): - resolution = 720 * 576 - elif ('720p' in option) or ('HD' in option): - resolution = 1280 * 720 - elif ('1080p' in option) or ('1080i' in option) or ('Full HD' in option): - resolution = 1920 * 1080 + resolution = int(match) + elif 'sd' in option.lower(): + resolution = 480 + elif 'hd' in option.lower(): + resolution = 720 + if 'full' in option.lower(): + resolution = 1080 + elif '2k' in option.lower(): + resolution = 1440 + elif '4k' in option.lower(): + resolution = 2160 + elif 'auto' in option.lower(): + resolution = 10000 return resolution From 4f83b6f8be52cf4df6c232690afd82afe19104c3 Mon Sep 17 00:00:00 2001 From: 4l3x87 <50104109+4l3x87@users.noreply.github.com> Date: Thu, 26 Aug 2021 18:19:35 +0200 Subject: [PATCH 135/139] Recupero url su community channel + varie (#329) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Aggiunto recupero da url + varie * Autoplay da community channel * small fix * cambiato patter server "directo" per escludere gli spazi vuoti e trovare url di file m3u8, mp4, mpeg, mpd, flv m3u Aggiunta funzionalità sul canale community per filtrare i risultati trovati tramite patterns * fix consigliati * fix se l'url inserito è un server conosciuto da kod * creata chiave apposita "find_links" per differenziare il funzionamento standard aggiunto il controllo sugli short link (per poterli utilizzare nel canale), aggiunto is.gd come servizio di short link su unshortenit Co-authored-by: Alex Pettiti <alex.pettiti@axterisko.it> Co-authored-by: mac12m99 <10120390+mac12m99@users.noreply.github.com> --- core/autoplay.py | 4 +- lib/unshortenit.py | 2 +- servers/directo.json | 7 +- specials/community.py | 359 +++++++++++++++++++++++++----------------- 4 files changed, 215 insertions(+), 157 deletions(-) diff --git a/core/autoplay.py b/core/autoplay.py index 9aae4d4b..1894c15a 100644 --- a/core/autoplay.py +++ b/core/autoplay.py @@ -39,7 +39,7 @@ def start(itemlist, item): if not config.is_xbmc(): return itemlist - if config.get_setting('autoplay'): + if config.get_setting('autoplay') or (item.channel == 'community' and item.autoplay): # Save the current value of "Action and Player Mode" in preferences user_config_setting_action = config.get_setting("default_action") # user_config_setting_player = config.get_setting("player_mode") @@ -142,4 +142,4 @@ def servername(server): path = filetools.join(config.get_runtime_path(), 'servers', server.lower() + '.json') name = jsontools.load(open(path, "rb").read())['name'] if name.startswith('@'): name = config.get_localized_string(int(name.replace('@',''))) - return translate_server_name(name) \ No newline at end of file + return translate_server_name(name) diff --git a/lib/unshortenit.py b/lib/unshortenit.py index ccc92ac1..b9f78684 100644 --- a/lib/unshortenit.py +++ b/lib/unshortenit.py @@ -45,7 +45,7 @@ class UnshortenIt(object): # for services that only include real link inside iframe _simple_iframe_regex = r'cryptmango|xshield\.net|vcrypt\.club' # for services that only do redirects - _simple_redirect = r'streamcrypt\.net/[^/]+|uprot\.net' + _simple_redirect = r'streamcrypt\.net/[^/]+|uprot\.net|is\.gd' listRegex = [_adfly_regex, _linkbucks_regex, _adfocus_regex, _lnxlu_regex, _shst_regex, _hrefli_regex, _anonymz_regex, _shrink_service_regex, _rapidcrypt_regex, _simple_iframe_regex, _linkup_regex, _linkhub_regex, diff --git a/servers/directo.json b/servers/directo.json index 185c7952..a1b0a9fd 100644 --- a/servers/directo.json +++ b/servers/directo.json @@ -4,12 +4,7 @@ "ignore_urls": [], "patterns": [ { - "pattern": "((?:http://|https://).*?m3u8[^\"'\n]*)", - "url": "\\1" - - }, - { - "pattern": "((?:http://|https://).*?.mpd[^\"'\n]*)", + "pattern": "((?:https?://).\\S+.(m3u8|mp4|mpeg|mpd|flv)[^\"'\n]*)", "url": "\\1" }, { diff --git a/specials/community.py b/specials/community.py index 68a18b74..0856b142 100644 --- a/specials/community.py +++ b/specials/community.py @@ -2,25 +2,30 @@ # -*- Channel Community -*- -import re, inspect, xbmcgui +import re, inspect, mimetypes, xbmcgui from core import httptools, jsontools, tmdb, support, filetools from core.item import Item +from lib import unshortenit from platformcode import config, platformtools, logger from channelselector import get_thumb from collections import OrderedDict +from core import servertools -info_language = ["de", "en", "es", "fr", "it", "pt"] # from videolibrary.json -try: lang = info_language[config.get_setting("info_language", "videolibrary")] -except: lang = 'it' +info_language = ["de", "en", "es", "fr", "it", "pt"] # from videolibrary.json +try: + lang = info_language[config.get_setting("info_language", "videolibrary")] +except: + lang = 'it' defpage = ["", "20", "40", "60", "80", "100"] -defp = defpage[config.get_setting('pagination','community')] +defp = defpage[config.get_setting('pagination', 'community')] disable_pagination = False -show_seasons = config.get_setting('show_seasons','community') +show_seasons = config.get_setting('show_seasons', 'community') tmdb_api = 'a1ab8b8669da03637a4b98fa39c39228' + def mainlist(item): logger.debug() @@ -38,19 +43,19 @@ def show_channels(item): itemlist = [] # add context menu - context = [{"title": config.get_localized_string(50005), "action": "remove_channel", "channel": "community"}] + context = [{"title": config.get_localized_string(50005), "action": "remove_channel", "channel": "community"}] # read json json = load_and_check(item) itemlist.append(Item(channel=item.channel, - title=support.typo(config.get_localized_string(70676),'bold color kod'), + title=support.typo(config.get_localized_string(70676), 'bold color kod'), action='add_channel', thumbnail=get_thumb('add.png'))) for key, channel in json['channels'].items(): - path = filetools.dirname(channel['path']) # relative path - channel_json = load_json(channel) # read channel json + path = filetools.dirname(channel['path']) # relative path + channel_json = load_json(channel) # read channel json # retrieve information from json thumbnail = relative('thumbnail', channel_json, path) @@ -59,13 +64,13 @@ def show_channels(item): plot = channel_json['plot'] if 'plot' in channel_json else '' itemlist.append(Item(channel=item.channel, - title=support.typo(channel['channel_name'],'bold'), + title=support.typo(channel['channel_name'], 'bold'), url=channel['url'] if 'url' in channel else path, thumbnail=thumbnail, fanart=fanart, plot=plot, action='show_menu', - channel_id = key, + channel_id=key, context=context, path=path)) @@ -77,8 +82,7 @@ def show_menu(item): logger.debug() itemlist = [] - - if item.menu: # if second level menu + if item.menu: # if second level menu get_sub_menu(item, item.menu, 'level2', itemlist) else: if type(item.url) == dict: @@ -103,14 +107,12 @@ def show_menu(item): itemlist += get_seasons(item) elif key in ['episodes_list']: itemlist += episodios(item, json, key) - elif key in ['links']: + elif key in ['links', 'find_links']: itemlist += findvideos(item) elif key in ['search'] and 'url' in json['search']: search_json = json['search'] itemlist += get_search_menu(item, search_json) - - if 'channel_name' in json and not 'disable_search' in json and 'search' not in json: itemlist += get_search_menu(item, json, channel_name=json['channel_name']) logger.debug('PAGINATION:', disable_pagination) @@ -118,7 +120,7 @@ def show_menu(item): def search(item, text): - logger.info('search',text) + logger.info('search', text) itemlist = [] if item.custom_search: @@ -142,6 +144,7 @@ def search(item, text): return itemlist + def global_search(item, text): itemlist = [] json = load_json(item) @@ -149,7 +152,8 @@ def global_search(item, text): if 'menu' in json: for option in json['menu']: - if option in ['submenu', 'level2'] and 'seach' in json['menu'][option] and 'url' in json['menu'][option]['search']: + if option in ['submenu', 'level2'] and 'seach' in json['menu'][option] and 'url' in json['menu'][option][ + 'search']: item.custom_search = json['menu'][option]['search']['url'] itemlist += search(item, text) else: @@ -158,15 +162,13 @@ def global_search(item, text): if item.url: itemlist += global_search(item, text) - if any(key in json for key in ['movies_list','tvshows_list', 'generic_list']): + if any(key in json for key in ['movies_list', 'tvshows_list', 'generic_list']): itemlist += search(item, text) return itemlist - - def peliculas(item, json='', key='', itemlist=[]): - item.plot = item.thumb = item.fanart ='' + item.plot = item.thumb = item.fanart = '' logger.debug('PAGINATION:', item.disable_pagination) if not json: key = item.key @@ -174,25 +176,28 @@ def peliculas(item, json='', key='', itemlist=[]): else: json = json[key] + # logger.debug('DEBUG:', json) + infoLabels = item.infoLabels if item.infoLabels else {} contentType = 'tvshow' if 'tvshow' in key else 'movie' itlist = filterkey = [] action = 'findvideos' - if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'search'] and not item.filterkey and not item.disable_pagination: + if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', + 'search'] and not item.filterkey and not item.disable_pagination: Pagination = int(defp) if defp.isdigit() else '' - else: Pagination = '' + else: + Pagination = '' pag = item.page if item.page else 1 for i, option in enumerate(json): if Pagination and (pag - 1) * Pagination > i: continue # pagination if Pagination and i >= pag * Pagination: break if item.filterkey and item.filterkey in option: - filterkey = [it.lower() for it in option[item.filterkey]] if type(option[item.filterkey]) == list else [option[item.filterkey].lower()] + filterkey = [it.lower() for it in option[item.filterkey]] if type(option[item.filterkey]) == list else [ + option[item.filterkey].lower()] else: filterkey = [] - - title = option['title'] if 'title' in option else '' if 'tvshows_list' in key and 'links' not in option: @@ -200,26 +205,32 @@ def peliculas(item, json='', key='', itemlist=[]): # filter elements if (not item.filter or item.filter.lower() in filterkey) and item.search.lower() in title.lower() and title: + + if 'generic_list' in key and 'links' not in option and 'url' in option: + option['links'] = [] + option['links'].append({'url': option['url']}) + option['url'] = '' + extra = set_extra_values(item, option, item.path) infoLabels['year'] = option['year'] if 'year' in option else '' infoLabels['tmdb_id'] = option['tmdb_id'] if 'tmdb_id' in option else '' - it = Item(channel = item.channel, - title = set_title(title, extra.language, extra.quality), - fulltitle = title, - show = title, - contentTitle = title if contentType == 'movie' else '', - contentSerieName = title if contentType != 'movie' else '', - contentType = contentType, - infoLabels = infoLabels, - url = extra.url, - path = item.path, - thumbnail = extra.thumb, - fanart = extra.fanart, - plot = extra.plot, - personal_plot = extra.plot, - action = action) + it = Item(channel=item.channel, + title=set_title(title, extra.language, extra.quality), + fulltitle=title, + show=title, + contentTitle=title if contentType == 'movie' else '', + contentSerieName=title if contentType != 'movie' else '', + contentType=contentType, + infoLabels=infoLabels, + url=extra.url, + path=item.path, + thumbnail=extra.thumb, + fanart=extra.fanart, + plot=extra.plot, + personal_plot=extra.plot, + action=action) itlist.append(it) if not 'generic_list' in key: @@ -242,8 +253,10 @@ def get_seasons(item): itemlist = [] infoLabels = item.infoLabels json = item.url if type(item.url) == dict else item.url - if 'seasons_list' in json: json = json['seasons_list'] - elif 'tvshows_list' in json: return show_menu(item) + if 'seasons_list' in json: + json = json['seasons_list'] + elif 'tvshows_list' in json: + return show_menu(item) for option in json: infoLabels['season'] = option['season'] title = config.get_localized_string(60027) % option['season'] @@ -263,12 +276,14 @@ def get_seasons(item): contentType='season' if show_seasons else 'tvshow', path=extra.path)) - if inspect.stack()[2][3] in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'get_newest'] or show_seasons == False: + if inspect.stack()[2][3] in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', + 'get_newest'] or show_seasons == False: itlist = [] for item in itemlist: itlist = episodios(item) itemlist = itlist - if inspect.stack()[2][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'get_newest'] and defp and not item.disable_pagination: + if inspect.stack()[2][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', + 'get_newest'] and defp and not item.disable_pagination: itemlist = pagination(item, itemlist) if show_seasons: @@ -277,10 +292,10 @@ def get_seasons(item): return itemlist -def episodios(item, json ='', key='', itemlist =[]): +def episodios(item, json='', key='', itemlist=[]): logger.debug() infoLabels = item.infoLabels - itm=item + itm = item if type(item.url) == dict: if 'seasons_list' in item.url: @@ -304,9 +319,11 @@ def episodios(item, json ='', key='', itemlist =[]): ep = 1 season = infoLabels['season'] if 'season' in infoLabels else item.contentSeason if item.contentSeason else 1 - if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'search'] and not show_seasons: + if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', + 'search'] and not show_seasons: Pagination = int(defp) if defp.isdigit() else '' - else: Pagination = '' + else: + Pagination = '' pag = item.page if item.page else 1 # make items @@ -315,7 +332,7 @@ def episodios(item, json ='', key='', itemlist =[]): if Pagination and i >= pag * Pagination: break # build numeration of episodes numeration = option['number'] if 'number' in option else option['title'] - match = support.match(numeration , patron=r'(?P<season>\d+)x(?P<episode>\d+)').match + match = support.match(numeration, patron=r'(?P<season>\d+)x(?P<episode>\d+)').match if match: episode_number = match[1] ep = int(match[1]) + 1 @@ -338,25 +355,25 @@ def episodios(item, json ='', key='', itemlist =[]): title = '%sx%s%s' % (season_number, episode_number, title) extra = set_extra_values(item, option, item.path) if not item.filterseason or season_number == int(item.filterseason): - itemlist.append(Item(channel = item.channel, - title = set_title(title, extra.language, extra.quality), - fulltitle = item.fulltitle, - show = item.show, - url = option, - action = 'findvideos', - plot = extra.plot, - thumbnail= extra.thumb if extra.thumb else item.thumbnail, - fanart = extra.fanart, - contentSeason = season_number, - contentEpisode = episode_number, - infoLabels = infoLabels, - contentType = 'episode', - path = item.path)) + itemlist.append(Item(channel=item.channel, + title=set_title(title, extra.language, extra.quality), + fulltitle=item.fulltitle, + show=item.show, + url=option, + action='findvideos', + plot=extra.plot, + thumbnail=extra.thumb if extra.thumb else item.thumbnail, + fanart=extra.fanart, + contentSeason=season_number, + contentEpisode=episode_number, + infoLabels=infoLabels, + contentType='episode', + path=item.path)) # if showseason if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'get_newest', 'search']: if show_seasons and not item.filterseason: - itm.contentType='season' + itm.contentType = 'season' season_list = [] for item in itemlist: if item.contentSeason not in season_list: @@ -371,7 +388,7 @@ def episodios(item, json ='', key='', itemlist =[]): url=itm.url, action='episodios', contentSeason=season, - contentType = 'episode', + contentType='episode', infoLabels=infoLabels, filterseason=str(season), path=item.path)) @@ -391,17 +408,46 @@ def episodios(item, json ='', key='', itemlist =[]): # Find Servers def findvideos(item): - logger.debug() + # logger.debug('DEBUG', item) item.contentTitle = item.fulltitle itemlist = [] + json = [] if 'links' in item.url: json = item.url['links'] + elif 'find_links' in item.url: + for link in item.url['find_links']: + link['url'] = unshortenit.findlinks(link['url']) + mimetype = findS = None + mimetype = mimetypes.MimeTypes().guess_type(link['url'])[0] + if mimetype is None: + findS = servertools.get_server_from_url(link['url']) + if mimetype is None and findS is None: + data = support.match(link['url']).data + itemlist_url = servertools.find_video_items(data=data) + if len(itemlist_url): + for item_url in itemlist_url: + valid = True + patterns = link.get('patterns', False) + if patterns: + valid = False + for pattern in patterns: + match = re.search(pattern, item_url.url) + if match: + valid = True + break + if valid: + json.append({"url": item_url.url}) + else: + json.append(link) + else: - json = item.url + url = item.url + item.url = {} + json.append({"url": url}) + # support.dbg() for option in json: extra = set_extra_values(item, option, item.path) - itemlist.append( item.clone(url=option['url'], action='play', @@ -409,32 +455,34 @@ def findvideos(item): contentLanguage=extra.language, extraInfo=extra.info)) + videolibrary = item.url.get('videolibrary', True) + item.autoplay = item.url.get('autoplay', False) + item.url = '' # do not pass referer - return support.server(item, itemlist=itemlist) + return support.server(item, itemlist=itemlist, Videolibrary=videolibrary) ################################ Menu ################################ def get_menu(item, json, key, itemlist=[]): - logger.debug() json = json[key] for option in json: title = option['title'] if 'title' in option else json[option] if 'search' not in option else '' extra = set_extra_values(item, option, item.path) - level2 = option if 'level2' in option else [] - it = Item(channel = item.channel, - title = support.typo(title, 'bullet bold'), - fulltitle = title, - show = title, - url = extra.url, - path = item.path, - thumbnail = extra.thumb, - fanart = extra.fanart, - plot = extra.plot, - action = 'show_menu', - menu = level2 if not item.menu else None, - filterkey = extra.filterkey, - filter = extra.filter) + level2 = option if 'level2' in option else [] + it = Item(channel=item.channel, + title=support.typo(title, 'bullet bold'), + fulltitle=title, + show=title, + url=extra.url, + path=item.path, + thumbnail=extra.thumb, + fanart=extra.fanart, + plot=extra.plot, + action='show_menu', + menu=level2 if not item.menu else None, + filterkey=extra.filterkey, + filter=extra.filter) if title: itemlist.append(it) @@ -442,7 +490,7 @@ def get_menu(item, json, key, itemlist=[]): get_search_menu(it, json, itemlist) elif 'submenu' in option: - get_sub_menu(it, option, 'submenu' ,itemlist) + get_sub_menu(it, option, 'submenu', itemlist) for item in itemlist: if not item.thumbnail: support.thumb(item) @@ -463,20 +511,20 @@ def get_sub_menu(item, json, key, itemlist=[]): extra = set_extra_values(item, json[option], item.path) if not extra.url: extra.url = item.url filterkey = option - level2 = option if 'level2' in option else [] - it = Item(channel = item.channel, - title = support.typo(title,'submenu'), - fulltitle = title, - show = title, - url = extra.url, - path = item.path, - thumbnail = extra.thumb, - fanart = extra.fanart, - plot = extra.plot, - action = 'show_menu', - menu = level2 if not item.menu else None, - filterkey = filterkey, - description = extra.description) + level2 = option if 'level2' in option else [] + it = Item(channel=item.channel, + title=support.typo(title, 'submenu'), + fulltitle=title, + show=title, + url=extra.url, + path=item.path, + thumbnail=extra.thumb, + fanart=extra.fanart, + plot=extra.plot, + action='show_menu', + menu=level2 if not item.menu else None, + filterkey=filterkey, + description=extra.description) itemlist.append(it) if 'search' in option: @@ -500,7 +548,7 @@ def get_search_menu(item, json='', itemlist=[], channel_name=''): extra = set_extra_values(item, json, item.path) itemlist.append(Item(channel=item.channel, - title=support.typo(title,'submenu bold'), + title=support.typo(title, 'submenu bold'), fulltitle=title, show=title, thumbnail=extra.thumb, @@ -515,7 +563,7 @@ def get_search_menu(item, json='', itemlist=[], channel_name=''): return itemlist -def submenu(item, json, key, itemlist = [], filter_list = []): +def submenu(item, json, key, itemlist=[], filter_list=[]): logger.debug(item) import sys if sys.version_info[0] >= 3: @@ -527,8 +575,10 @@ def submenu(item, json, key, itemlist = [], filter_list = []): if type(item.description) == dict: description = item.description else: - if ':/' in item.description: url = item.description - else: url = filetools.join(item.path, item.description) + if ':/' in item.description: + url = item.description + else: + url = filetools.join(item.path, item.description) description = load_json(url, no_order=True) else: description = None @@ -585,8 +635,11 @@ def filter_thread(filter, key, item, description): results = tmdb_inf.results[0] id = results['id'] if id: - thumbnail = 'https://image.tmdb.org/t/p/original' + results['profile_path'] if results['profile_path'] else item.thumbnail - json_file = httptools.downloadpage('http://api.themoviedb.org/3/person/'+ str(id) + '?api_key=' + tmdb_api + '&language=en', use_requests=True).data + thumbnail = 'https://image.tmdb.org/t/p/original' + results['profile_path'] if results[ + 'profile_path'] else item.thumbnail + json_file = httptools.downloadpage( + 'http://api.themoviedb.org/3/person/' + str(id) + '?api_key=' + tmdb_api + '&language=en', + use_requests=True).data plot += jsontools.load(json_file)['biography'] if description: @@ -596,7 +649,6 @@ def filter_thread(filter, key, item, description): fanart = extra.fanart if extra.fanart else item.fanart plot = extra.plot if extra.plot else item.plot - item = Item(channel=item.channel, title=support.typo(filter, 'bold'), url=item.url, @@ -674,25 +726,28 @@ def set_extra_values(item, json, path): if key == 'quality': ret.quality = json[key] if ret.quality and not ret.quality[0].isdigit(): ret.quality = ret.quality.upper() - elif key == 'language': + elif key == 'language': ret.language = json[key].upper() - elif key == 'plot': + elif key == 'plot': ret.plot = json[key] elif key in ['poster', 'thumbnail']: - ret.thumb = json[key] if ':/' in json[key] else filetools.join(path,json[key]) if '/' in json[key] else get_thumb(json[key]) - elif key == 'fanart': - ret.fanart = json[key] if ':/' in json[key] else filetools.join(path,json[key]) + ret.thumb = json[key] if ':/' in json[key] else filetools.join(path, json[key]) if '/' in json[ + key] else get_thumb(json[key]) + elif key == 'fanart': + ret.fanart = json[key] if ':/' in json[key] else filetools.join(path, json[key]) elif key in ['url', 'link']: - ret.url = json[key] if ':/' in json[key] or type(json[key]) == dict else filetools.join(path,json[key]) - elif key == 'seasons_list': + ret.url = json[key] if ':/' in json[key] or type(json[key]) == dict else filetools.join(path, json[key]) + elif key == 'seasons_list': ret.url = {} ret.url['seasons_list'] = json['seasons_list'] - elif key == 'episodes_list': + elif key == 'episodes_list': ret.url = {} ret.url['episodes_list'] = json['episodes_list'] - elif key == 'links': - ret.url={} - ret.url['links'] = json[key] + elif key in ['links', 'find_links']: + ret.url = {} + ret.url[key] = json[key] + ret.url['videolibrary'] = json.get('videolibrary', True) + ret.url['autoplay'] = json.get('autoplay', False) elif key == 'filter': filterkey = json[key].keys()[0] ret.filter = json[key][filterkey] @@ -712,6 +767,7 @@ def set_extra_values(item, json, path): if not ret.plot: ret.plot = item.plot + logger.debug(ret.url) return ret @@ -721,8 +777,8 @@ def set_title(title, language='', quality='', info=''): t = support.match(title, patron=r'\{([^\}]+)\}').match if 'bold' not in t: t += ' bold' - title = re.sub(r'(\{[^\}]+\})','',title) - title = support.typo(title,t) + title = re.sub(r'(\{[^\}]+\})', '', title) + title = support.typo(title, t) if quality: title += support.typo(quality, '_ [] color kod bold') @@ -744,14 +800,15 @@ def relative(key, json, path): ret = '' if key in json: if key in ['thumbnail', 'poster']: - ret = json[key] if ':/' in json[key] else filetools.join(path,json[key]) if '/' in json[key] else get_thumb(json[key]) if json[key] else '' + ret = json[key] if ':/' in json[key] else filetools.join(path, json[key]) if '/' in json[ + key] else get_thumb(json[key]) if json[key] else '' else: - ret = json[key] if ':/' in json[key] else filetools.join(path,json[key]) if '/' in json[key] else '' + ret = json[key] if ':/' in json[key] else filetools.join(path, json[key]) if '/' in json[key] else '' return ret -def pagination(item, itemlist = []): +def pagination(item, itemlist=[]): logger.debug() itlist = [] @@ -764,12 +821,13 @@ def pagination(item, itemlist = []): encoded_itemlist.append(it.tourl()) if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'search']: Pagination = int(defp) if defp.isdigit() else '' - else: Pagination = '' + else: + Pagination = '' pag = item.page if item.page else 1 for i, item in enumerate(itemlist): if Pagination and (pag - 1) * Pagination > i: continue # pagination - if Pagination and i >= pag * Pagination: break # pagination + if Pagination and i >= pag * Pagination: break # pagination itlist.append(item) @@ -777,28 +835,30 @@ def pagination(item, itemlist = []): if inspect.stack()[1][3] != 'get_newest': itlist.append( Item(channel=item.channel, - action = 'pagination', - contentType=item.contentType, - title=support.typo(config.get_localized_string(30992), 'color kod bold'), - fulltitle= item.fulltitle, - show= item.show, - url=item.url, - args=item.args, - page=pag + 1, - path=item.path, - media_type=item.media_type, - thumbnail=support.thumb(), - itemlist= encoded_itemlist)) + action='pagination', + contentType=item.contentType, + title=support.typo(config.get_localized_string(30992), 'color kod bold'), + fulltitle=item.fulltitle, + show=item.show, + url=item.url, + args=item.args, + page=pag + 1, + path=item.path, + media_type=item.media_type, + thumbnail=support.thumb(), + itemlist=encoded_itemlist)) return itlist + def add_channel(item): logger.debug() channel_to_add = {} json_file = '' - result = platformtools.dialog_select(config.get_localized_string(70676), [config.get_localized_string(70678), config.get_localized_string(70679)]) + result = platformtools.dialog_select(config.get_localized_string(70676), + [config.get_localized_string(70678), config.get_localized_string(70679)]) if result == -1: return - if result==0: + if result == 0: file_path = xbmcgui.Dialog().browseSingle(1, config.get_localized_string(70680), 'files') try: channel_to_add['path'] = file_path @@ -808,7 +868,7 @@ def add_channel(item): except: pass - elif result==1: + elif result == 1: url = platformtools.dialog_input("", config.get_localized_string(70681), False) try: if url[:4] != 'http': @@ -832,19 +892,21 @@ def add_channel(item): community_json = jsontools.load(community_json.read()) id = 1 while str(id) in community_json['channels']: - id +=1 - community_json['channels'][str(id)]=(channel_to_add) + id += 1 + community_json['channels'][str(id)] = (channel_to_add) with open(path, "w") as file: - file.write(jsontools.dump(community_json)) + file.write(jsontools.dump(community_json)) file.close() - platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(70683) % json_file['channel_name']) + platformtools.dialog_notification(config.get_localized_string(20000), + config.get_localized_string(70683) % json_file['channel_name']) import xbmc xbmc.sleep(1000) platformtools.itemlist_refresh() return + def remove_channel(item): logger.debug() @@ -857,9 +919,10 @@ def remove_channel(item): to_delete = community_json['channels'][id]['channel_name'] del community_json['channels'][id] with open(path, "w") as file: - file.write(jsontools.dump(community_json)) + file.write(jsontools.dump(community_json)) file.close() - platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(70684) % to_delete) + platformtools.dialog_notification(config.get_localized_string(20000), + config.get_localized_string(70684) % to_delete) platformtools.itemlist_refresh() return From 12446fc1b7916ec48c40759198fc1f9622244a8c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Thu, 26 Aug 2021 17:46:19 +0000 Subject: [PATCH 136/139] Aggiornamento domini --- channels.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels.json b/channels.json index 7ab67f6c..5ae7e2d9 100644 --- a/channels.json +++ b/channels.json @@ -22,7 +22,7 @@ "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", "guardaserieclick": "https://www.guardaserie.builders", - "guardaserieicu": "https://guardaserie.clothing", + "guardaserieicu": "https://guardaserie.cfd", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", "ilgeniodellostreaming": "https://ilgeniodellostreaming.wtf", From f0132c00a31dd2dfc704942f82dd72aef49fc96b Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 27 Aug 2021 16:13:44 +0200 Subject: [PATCH 137/139] Fix Altadefinizione Community --- channels/altadefinizionecommunity.py | 29 +++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index 3a75d587..1c635286 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -214,20 +214,18 @@ def episodios(item): def check(item): - if '/watch-unsubscribed' not in item.url: - playWindow = support.match(support.httptools.downloadpage(item.url, cloudscraper=True).data, patron='playWindow" href="([^"]+)') - video_url = playWindow.match - if '/tvshow' in video_url: - item.data = playWindow.data - item.contentType = 'tvshow' - return episodios(item) - else: - item.url = video_url.replace('/watch-unsubscribed', '/watch-external') - item.contentType = 'movie' - return findvideos(item) + resolve_url(item) + if '/tvshow' in item.url: + item.contentType = 'tvshow' + return episodios(item) + else: + item.contentType = 'movie' + return findvideos(item) + def findvideos(item): itemlist = [] + resolve_url(item) itemlist.append(item.clone(action='play', url=support.match(item.url, patron='allowfullscreen[^<]+src="([^"]+)"', cloudscraper=True).match, quality='')) @@ -243,3 +241,12 @@ def play(item): return [] else: return [item] + + +def resolve_url(item): + if '/watch-unsubscribed' not in item.url and '/watch-external' not in item.url: + playWindow = support.match(support.httptools.downloadpage(item.url, cloudscraper=True).data, patron='playWindow" href="([^"]+)') + video_url = playWindow.match + item.data = playWindow.data + item.url = video_url.replace('/watch-unsubscribed', '/watch-external') + return item \ No newline at end of file From d89d2d2ebba20c884017dc9a133dcadc885ba101 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 27 Aug 2021 16:16:57 +0200 Subject: [PATCH 138/139] Fix directo (regex) --- servers/directo.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/servers/directo.json b/servers/directo.json index a1b0a9fd..185c7952 100644 --- a/servers/directo.json +++ b/servers/directo.json @@ -4,7 +4,12 @@ "ignore_urls": [], "patterns": [ { - "pattern": "((?:https?://).\\S+.(m3u8|mp4|mpeg|mpd|flv)[^\"'\n]*)", + "pattern": "((?:http://|https://).*?m3u8[^\"'\n]*)", + "url": "\\1" + + }, + { + "pattern": "((?:http://|https://).*?.mpd[^\"'\n]*)", "url": "\\1" }, { From 6b12a2c893e8366aa2641265a050d89588a7791d Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 27 Aug 2021 17:41:41 +0200 Subject: [PATCH 139/139] Menu Rapido: Piccole Correzioni --- platformcode/keymaptools.py | 12 ++- resources/skins/Default/720p/ShortCutMenu.xml | 93 ++++++++++-------- resources/skins/Default/media/dd.png | Bin 0 -> 2526 bytes resources/skins/Default/media/uu.png | Bin 0 -> 2487 bytes 4 files changed, 62 insertions(+), 43 deletions(-) create mode 100644 resources/skins/Default/media/dd.png create mode 100644 resources/skins/Default/media/uu.png diff --git a/platformcode/keymaptools.py b/platformcode/keymaptools.py index 88f2cd15..ac98cfac 100644 --- a/platformcode/keymaptools.py +++ b/platformcode/keymaptools.py @@ -10,12 +10,14 @@ import channelselector addon_icon = filetools.join( config.__settings__.getAddonInfo( "path" ),'resources', 'media', 'logo.png' ) background = 'FF232323' +overlay = '77232323' text = 'FFFFFFFF' select = 'FF0082C2' if config.get_setting('icon_set') == 'dark': background = 'FFDCDCDC' + overlay = '77DCDCDC' text = 'FF232323' - select = '880082C2' + select = 'FF78BDDF' class KeyListener(xbmcgui.WindowXMLDialog): TIMEOUT = 10 @@ -122,13 +124,15 @@ class Main(xbmcgui.WindowXMLDialog): def menulist(self, menu): itemlist = [] + self.getControl(200).setLabel(background) + self.getControl(201).setLabel(overlay) + self.getControl(202).setLabel(select) + self.getControl(203).setLabel(text) for menuentry in menu: # if not menuentry.channel: menuentry.channel = 'news' + title = re.sub(r'(\[[/]?COLOR[^\]]*\])','',menuentry.title) item = xbmcgui.ListItem(title) - item.setProperty('background', background) - item.setProperty('text', text) - item.setProperty('select', select) item.setProperty('channel', menuentry.channel) item.setProperty('focus', '0') item.setProperty('thumbnail', menuentry.thumbnail) diff --git a/resources/skins/Default/720p/ShortCutMenu.xml b/resources/skins/Default/720p/ShortCutMenu.xml index c7b53108..5df800e4 100644 --- a/resources/skins/Default/720p/ShortCutMenu.xml +++ b/resources/skins/Default/720p/ShortCutMenu.xml @@ -6,14 +6,31 @@ <top>0</top> </coordinates> <controls> + <control type='label' id='200'> + <description>Background Color</description> + <visible>False</visible> + </control> + <control type='label' id='201'> + <description>Overlay Color</description> + <visible>False</visible> + </control> + <control type='label' id='202'> + <description>Selection Color</description> + <visible>False</visible> + </control> + <control type='label' id='203'> + <description>Text Color</description> + <visible>False</visible> + </control> + <control type="button"> <description>Close Button</description> <left>0</left> <top>0</top> <width>100%</width> <height>100%</height> - <texturefocus colordiffuse="77232323">white.png</texturefocus> - <texturenofocus colordiffuse="77232323">white.png</texturenofocus> + <texturefocus colordiffuse="Control.GetLabel(201)">white.png</texturefocus> + <texturenofocus colordiffuse="Control.GetLabel(201)">white.png</texturenofocus> <animation effect="fade" time="200">WindowOpen</animation> <animation effect="fade" time="200">WindowClose</animation> <onclick>Action(close)</onclick> @@ -44,7 +61,7 @@ <left>0</left> <width>100%</width> <height>100%</height> - <texture colordiffuse="Container(1).ListItem.Property(background)">white.png</texture> + <texture colordiffuse="Control.GetLabel(200)">white.png</texture> </control> <control type="grouplist"> @@ -52,7 +69,7 @@ <top>0</top> <left>0</left> <width>100%</width> - <height>220</height> + <height>100%</height> <orientation>vertical</orientation> <control type="list" id="1"> @@ -68,6 +85,7 @@ <pagecontrol>61</pagecontrol> <itemlayout height="220" width="220"> <control type="image"> + <description>Icon</description> <width>220</width> <height>220</height> <texture>$INFO[ListItem.Property(thumbnail)]</texture> @@ -77,12 +95,15 @@ </itemlayout> <focusedlayout height="220" width="220"> <control type="image"> - <top>1</top> - <width>220</width> - <height>218</height> - <texture colordiffuse="Container(1).ListItem.Property(select)">white.png</texture> + <description>Selection</description> + <top>0</top> + <left>0</left> + <width>100%</width> + <height>100%</height> + <texture colordiffuse="Control.GetLabel(202)">white.png</texture> </control> <control type="image"> + <description>Icon</description> <width>220</width> <height>220</height> <texture>$INFO[ListItem.Property(thumbnail)]</texture> @@ -90,13 +111,13 @@ <align>center</align> </control> <control type="textbox"> - <description>Selected Item</description> + <description>Item Title</description> <left>0</left> <top>180</top> <width>100%</width> <height>40</height> <font>font13</font> - <textcolor>FFFFFFFF</textcolor> + <textcolor>Control.GetLabel(203)</textcolor> <label>$INFO[ListItem.Label]</label> <align>center</align> <aligny>center</aligny> @@ -117,6 +138,7 @@ <pagecontrol>61</pagecontrol> <itemlayout height="220" width="220"> <control type="image"> + <description>Icon</description> <width>220</width> <height>220</height> <texture>$INFO[ListItem.Property(thumbnail)]</texture> @@ -126,12 +148,15 @@ </itemlayout> <focusedlayout height="220" width="220"> <control type="image"> - <top>1</top> - <width>220</width> - <height>218</height> - <texture colordiffuse="Container(1).ListItem.Property(select)">white.png</texture> + <description>Selection</description> + <top>0</top> + <left>0</left> + <width>100%</width> + <height>100%</height> + <texture colordiffuse="Control.GetLabel(202)">white.png</texture> </control> <control type="image"> + <description>Icon</description> <width>220</width> <height>220</height> <texture>$INFO[ListItem.Property(thumbnail)]</texture> @@ -139,13 +164,13 @@ <align>center</align> </control> <control type="textbox"> - <description>Selected Item</description> + <description>Item Title</description> <left>0</left> <top>180</top> <width>100%</width> <height>40</height> <font>font13</font> - <textcolor>FFFFFFFF</textcolor> + <textcolor>Control.GetLabel(203)</textcolor> <label>$INFO[ListItem.Label]</label> <align>center</align> <aligny>center</aligny> @@ -155,38 +180,28 @@ </control> <control type="button" id='101'> + <description>Row Down</description> <visible>!String.IsEmpty(Container(1).ListItem.Property(sub)) + !Control.HasFocus(2) + !Control.HasFocus(102)</visible> <animation effect="fade" start="0" end="100" time="200" reversible="true" condition="Control.IsVisible(101)">Conditional</animation> - <!-- <animation effect="slide" end="220,0" condition="Integer.IsGreater(Container(1).Position,0)">Conditional</animation> - <animation effect="slide" end="220,0" condition="Integer.IsGreater(Container(1).Position,1)">Conditional</animation> - <animation effect="slide" end="220,0" condition="Integer.IsGreater(Container(1).Position,2)">Conditional</animation> - <animation effect="slide" end="220,0" condition="Integer.IsGreater(Container(1).Position,3)">Conditional</animation> - <animation effect="slide" end="220,0" condition="Integer.IsGreater(Container(1).Position,4)">Conditional</animation> - <animation effect="slide" end="220,0" condition="Integer.IsGreater(Container(1).Position,5)">Conditional</animation> --> - <left>520</left> - <top>240</top> - <width>60</width> - <height>60</height> - <texturefocus colordiffuse="Container(1).ListItem.Property(text)">down.png</texturefocus> - <texturenofocus colordiffuse="Container(1).ListItem.Property(text)">down.png</texturenofocus> + <left>540</left> + <top>260</top> + <width>20</width> + <height>20</height> + <texturefocus colordiffuse="Control.GetLabel(203)">dd.png</texturefocus> + <texturenofocus colordiffuse="Control.GetLabel(203)">dd.png</texturenofocus> <aspectratio>keep</aspectratio> </control> <control type="button" id='102'> + <description>Row Up</description> <visible>!Control.HasFocus(1) + !Control.HasFocus(101)</visible> <animation effect="fade" start="0" end="100" time="200" reversible="true" condition="Control.IsVisible(102)">Conditional</animation> - <!-- <animation effect="slide" end="220,0" condition="Integer.IsGreater(Container(2).Position,0)">Conditional</animation> - <animation effect="slide" end="220,0" condition="Integer.IsGreater(Container(2).Position,1)">Conditional</animation> - <animation effect="slide" end="220,0" condition="Integer.IsGreater(Container(2).Position,2)">Conditional</animation> - <animation effect="slide" end="220,0" condition="Integer.IsGreater(Container(2).Position,3)">Conditional</animation> - <animation effect="slide" end="220,0" condition="Integer.IsGreater(Container(2).Position,4)">Conditional</animation> - <animation effect="slide" end="220,0" condition="Integer.IsGreater(Container(2).Position,5)">Conditional</animation> --> - <left>520</left> + <left>540</left> <top>-80</top> - <width>60</width> - <height>60</height> - <texturefocus colordiffuse="Container(1).ListItem.Property(text)">up.png</texturefocus> - <texturenofocus colordiffuse="Container(1).ListItem.Property(text)">up.png</texturenofocus> + <width>20</width> + <height>20</height> + <texturefocus colordiffuse="Control.GetLabel(203)">uu.png</texturefocus> + <texturenofocus colordiffuse="Control.GetLabel(203)">uu.png</texturenofocus> <aspectratio>keep</aspectratio> </control> </control> <!-- GROUP CONTROLS END --> diff --git a/resources/skins/Default/media/dd.png b/resources/skins/Default/media/dd.png new file mode 100644 index 0000000000000000000000000000000000000000..8fff328842bc382cae1ad23505afb80f52728263 GIT binary patch literal 2526 zcmb_eeOOcH6%QgGi{qhM>=dhJw^F5;dvAh)a3x|SAbB7(g@B>XYDjL93nVur7ZL~$ zirQLqXn9<%SSlY<M4&a<lu?4hgh{ueKvgQ134^WX!BK4ISN))SZ$hCKUH8ZSxHoyv z?|067&hI_%Ns6V38~vDpOa_DDCyo;(fzL?#@%098?9qUc!SL!PWO7O_Nx+n(4pykh zbR4$m3;+kbD2qX%%)}{HI<6t~0%*d~2C)d00NTWppb|qgt|j8~jd*f?qD+~esf<uT zQR|qI77PT?;go`9(PimPm_-1&;$q-CZAKuLi$Y}zAh|@!iYARXiwE;y6k5k*MH*FV zEJ+kQ<qTE=NJ~)$3_;9hGi(lpNuvhgL_|a&C>P;!*?_?|<>@Jfg{?QeM2B$45aA}J zkuXpMsb|qK73pLSC4eA+v!;UM7Gfs4-ZWJ{5CWkQgaf0<kLd<2Ns%TkX_(IF37=_r zmLo-|pRo^(%%TJNp1y-cVR#x@BKhxho$iS;OjJxR5MoNyCrbEX1CuPzfFnt`iOex7 z@t9m(Prc+)g4P9#CbLLmGH4B40C8r_Qo@2~$wh<?*PDRo0w@gq379q;oEFU;RYIyj z&`_7(3?z<@mKsSlkp(bQ(#8!eaZGd=Cn7A2&4t|w&^lsbokD{r;Cc<Eo!)!~*hHv) zYNrd#%Aq?XMNa@pxUPL&F7g>n0EKfwZ_<6^g3_J}fkVS2pu1HHN+D8EAX6^N<*-pc zn;S0UgkvZl<8VVzE{3{8x%i}tQ0M&|o9<{<B;ZRVSR7%ZNMoMM<Zkn1Jlnl;FS7_& zf72aK^A$?EIss%blBygfu5wl3>VFzFk!s4UFycZDIA8%JRI3S~LmmrU9YUkWjVun# zhj~x>n6)^F2Wmsv9F)ynL)W&3k8#nd+K~TyHd6Z9{ah+Q=};Mmhk<OkybzQ_%l!0I zT<!l%Vch8dAPfhc>ItBx+i6;vXPo*}I*|xHjea<`NMzQ*x(PoTUqDf}4U9!FUy<nn z3l`HO8rOrlYy<<ipmpaUgW*v`fJ-y$vM?B{N^?qkLPW0xbVaE@{l~^*@>MS&3cPcb z-M)wu@WN<tTUcn%BWdX9o$K$f*o?1@DK6PMZ*or4UtbS~g4W`atiwnD9mzY`{mBQ` zb@!|j5r4D7mdmFOaYC%DgQtHR$FJ$Wcp>CU&wcHm4!n1^PCa(;(y>?Y@zMRvmDlH% zzy8mj$C;<&vy*o*D{j40yX4TV!?!x?KU~|&9<2GWI{w`8b6ei}jr4whpAv54ms8(; zrid>2<*wsGx%iNwarf!pmCir(-le1B8>faI@{tq!G@9C=rs6-QFZgwW@0;1Ni)t(0 z@W#Jhx&9q}+G{Vj-B`JO@4~-aQT3;FY%5z4yt+knL42pVbGI{lG0|T>`Tcl9nR8yt zm75!+cT``JOQmPL-fY!vUv@3`@4l@E45jR^PQKXQ?r?rr-GA19(vR<0onc?fAKLwu zk03*|eZ|S<m8Cnrc)qS;*ZIu4G=uf7qvsnz-OX=PHrX6L9~iH<-S^9F)QqPc-2;PP z(q9<j(o77-yyxl1gK?yM5rZ)&L@W}@v_<0s@rg2Fz@BeRnh{T7=Z*u#4x`uV4&!3D zqsm)}YDED7z8M9L9rG)8oqf0bxvGg1n{yfxZ-!4`-)}uv8NKgqUz=Asr&TaqD`Q$1 zkGTI5cs5;(8kyra=u^1=Tz%J(SkHSqmZ#aq`d;p9-!g1XZOm^CrVcz#o!hW~O_6t4 z(a9M5m^@{T&7+_Um{NtF<{g*B_Obgl&SlmluZGx!o!<RLqxEuL?W(|LzZZE$DaZC! z7V(Bn$#NbX64>ljkg=d4RxR{wXcu0R^Kt`Px(X>kI@sIJv`sLV#EaU@#U(+NkJFW2 zz2oW1#eL&S<>KB#n|;1^`&IdzYe<-S{ll*F-j%=dS>l*`#&Y%Q*4};lN`h~XD3yW- zL+z8~2v#~!aro`Xumb(7qGdT-?m0fKkMPKZzD*D<3tV@%=4Q+B2c_unXGLE}7=psp zZ*)%%n6-m}aDMmRLXXv-bk=YD$T=R|8)F;G4tWq{xDu4Q)Ly;y-Sw~TOzCQLE*(A+ z--u<zw0VE*=&T=2y$u^Wf>KLt)k8Iv@3+@;Qg3hGHUJF2uO8w&y776FEu(y)VB*H- zx%P~jg=hR5n>*|6skeQ$fv_b_)&7Sck4*S4iC@3G<<I9A^cLFf8=TTFbBMCOswR!J zthcJE<8mBTcP8qD2)wPbSnv*y_w1{>d$I9?aL=`ednpg>^7WKcCa2Wev*M0ZI(m2c Zy{12$9(?W#fBJ8kI3`i_@rG?X{{zbNuO<Kh literal 0 HcmV?d00001 diff --git a/resources/skins/Default/media/uu.png b/resources/skins/Default/media/uu.png new file mode 100644 index 0000000000000000000000000000000000000000..14ba6b1dc90f37438c85d34d1c0987f472c6291a GIT binary patch literal 2487 zcmb_eeOwb|9KSH+O;OX8Vb(lFP~7e|WNec`z))6BryveVWo)<YV%v?~0mEg8_=bu| zCSV}=!55Gy<rAWT$ud&&rAY;;rD&$?qoR~b8cIF4A*5*bM}OS5=lOnrZ{O$l{BAk2 zSu=)u`glSRG*l8To(sN1=*N99_!K@kYl0xxlX$G0l1pa_m4u$HP!UNO+pISN9Pq-- zMujpNqnJsU1~-V{TMdmc6IY4g`9V@tYK+9Rc=Qqz7PDklta3@RQlNsvLOnywLf}A; zQ3|G6uQQNBvj}$h6@uUNHUcvp6e?K+%cU}ABw@msLF^zl3Ws_!Lrf~QaIScIuQ6DO zU@b)%g$R<Kp3Y7WWD_P0!Vw4r2+BpcToz!k$P5FeFtZHgc-n>2hZrN3CfrEjgn>!> zR3s6pln90a&g^xLnel$_2C}z&AOu1q2#1X#|D+qW1VxZq!q}J5V>W&807D8_KO+u} z44?z~o*u!hFg}eemHs<juYarzl8Q<LLiCFISP72;kg*v?44I3OM5;-NMWtZ|YP>@U zS{Gp?p(9K&pfxZN%<12j;bu%H7vp-&KmyT4Fb{nKj2{U0iRSbwB~-v^pu?^ol0-(z zOoSTO0gRkGBZ4W3isW$wJRXb7b|ygUD3s_G8f+$J&`{dG;QhdST=nEWU7#+N?vQx~ z97w`-#C4d+`!Nw5%muwk_l*OJe<}nHO(+H3tx`}5v4R4ba#1dah4NY4;8;$u5akQG z`~Z|IM4hf2d_sk*GoHt$JDM2+_)@7b8Yd~jl;PNNws{Pe;#@hGI^5CUbcfS?g_5pL z1RG6+DpiT8991~_pGHYSO{FVLShxlpum}!Ut8t)11`}KzTw}mYOb(mR4tm@sU5f#K zpf;4nL0R0XbZt{XZD?<8$p4;=jJ|fyO9dz$7|RI~f^4`!0Vs!-`RS=R+W(otIMM$g z3<vG)381Fas85+^oO*9MAqYK<9vxc<GT>mHgnx`Lpr~^Xj72bCk-h;77JVZcGl02l z0t2`r$b$hvFJ$51(hRsP5ageqnr{mb&lz<zOnvOv8QbOlFCz-9$-ky%G-uSymnSvy z0&NduftT-ID4vjjO^eFOUF_B4Qg?j8B-nQvCe;;{-VO=cbn^49me4;ew*==cZ1WGb z1)Km2bJM={(fl1JzdaSuV!NmPGOzGZrTW^Y@3&9JIxcVU^t<q4$$~4khspciPKn9( zEbH93YfM3BQD;-t&S?i(KkwLC{`TRD!wXlvBfHnytYkOxOQ`!N6p^_@vMa*nk^*D( zihUpEk0>bozEsj)+t$rTcCXWDcKO!j>`!`W+)VeCDbq*qDqA!dyXp7lMnn9ZiH+@k znQIx}w5VF+ze?OPVbYX(@hQpO15GRJDX-$KB|U$2e7wc(Ro`+wLUvd66ERlyh3m?L z`pnnQrCoAAm}ksqUETAV)!JacU*39XSkF*?!<2Vx#`4=%Ty+z@E6$v-=YU`SvL8oQ zmSrDFu8cQYx*BZ1i7K!EK5zcs2Dh!I3yt@Nrd4Y?;!9Vv!JE{>7#&YSkk?51c>(&U zWHbc1yeJWe$7-`W&Mur48$Nv1rO@=i<F=D)+$Uc*zB)x&aOuF1IIGVPapdWX+m`uE z@IU5#W;yaoiDdHNBjmL^vs0D6OV8e2YKvODkMtN^1Z^61wz=ZSx9Sh-XP>_BmB9P+ zb=?+wX5xv6;HH8sL(Zu&pEO;~xw+<)SBFQj+quA2o^W{U#06QR-Lv1<`gVDsE*n0J zNUr&%XE^`3%XvmX*N`mRuI58~liHx7kHp<a)_!rq>K9{|$!jt__-K}QE<>=+dUS_f zF3;cZ{$BL*4Y`cZy{zxYQj@EXErz<vx5X%<@{U@&w`l|9&Fv#P+3x3j;_h4<)Uc>I zuBLqP8)tr7UblfEvRD&X^;L!Iw~~7jeqAJJ=Y3pN-*p1#y=fEd?<ldf{Bo|is;bUq z-k)K^EXz_Ju0LMp(_ImYZFf!MT`9k1Em&8Y%^G$dO7O0C<z?2o6eIP6cwx0}x=?MN zyxR`R8?>%zZ#C>;Ow+n{ZTyMYeC5Vz&l|5KGH<qL$0g=1yEN8vV>{!_$i%6dvW2xS z-J7qr?W_Zg{S)OiZQcvA9(q^%o4x~#n2Y%8gA{P$w)fh&;8393pwiT@*FG?Vt=HtY zS29G00jtbfPgL7SdVgZ=aVcGWc<rK|X3rb0o$%DSJGWQIB_dgcHG9i7=^)UUGi!1g dOIz$?e!TEm<>iY@V(9-{lBikYPa_hS{|%OMm^=Ug literal 0 HcmV?d00001