From b8766796194f8ca9396e8c5ce1ab88cc5656e485 Mon Sep 17 00:00:00 2001 From: greko17 Date: Fri, 6 Sep 2019 12:02:00 +0200 Subject: [PATCH] fix: migliorie altadefinizione01_L e modifica a support --- channels/altadefinizione01_link.json | 85 +--------------------------- channels/altadefinizione01_link.py | 14 ++--- core/support.py | 9 ++- 3 files changed, 16 insertions(+), 92 deletions(-) diff --git a/channels/altadefinizione01_link.json b/channels/altadefinizione01_link.json index ffdfc2f3..069acd32 100644 --- a/channels/altadefinizione01_link.json +++ b/channels/altadefinizione01_link.json @@ -3,88 +3,9 @@ "name": "Altadefinizione01 L", "active": true, "adult": false, - "language": ["ita"], + "language": ["ita","vos"], "thumbnail": "altadefinizione01_L.png", "banner": "altadefinizione01_L.png", - "categories": ["movie","vosi"], - "settings": [ - { - "id": "modo_grafico", - "type": "bool", - "label": "Cerca informazioni extra", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_peliculas", - "type": "bool", - "label": "Includi in Novità", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_italiano", - "type": "bool", - "label": "Includi in Novità - Italiano", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "include_in_global_search", - "type": "bool", - "label": "Includi ricerca globale", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "checklinks", - "type": "bool", - "label": "Verifica se i link esistono", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "checklinks_number", - "type": "list", - "label": "Numero de link da verificare", - "default": 1, - "enabled": true, - "visible": "eq(-1,true)", - "lvalues": [ "5", "10", "15", "20" ] - }, - { - "id": "filter_languages", - "type": "list", - "label": "Mostra link in lingua...", - "default": 0, - "enabled": true, - "visible": true, - "lvalues": [ - "Non filtrare", - "ITA", - "vosi" - ] - }, - { - "id": "perfil", - "type": "list", - "label": "profilo dei colori", - "default": 0, - "enabled": true, - "visible": true, - "lvalues": [ - "Sin color", - "Perfil 5", - "Perfil 4", - "Perfil 3", - "Perfil 2", - "Perfil 1" - ] - } - ] + "categories": ["movie","vos"], + "settings" :[] } diff --git a/channels/altadefinizione01_link.py b/channels/altadefinizione01_link.py index 4a05c7ab..0d14be29 100644 --- a/channels/altadefinizione01_link.py +++ b/channels/altadefinizione01_link.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# -*- Channel Altadefinizione01L Film - Serie -*- +# -*- Channel Altadefinizione01L Film -*- # -*- By Greko -*- from core import support @@ -38,9 +38,9 @@ def peliculas(item): ## support.dbg() support.log('peliculas',item) patron = r'class="innerImage">.*?href="(?P[^"]+)".*?src="(?P[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P[^<]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+> (?P<year>\d{4})[^>]+>[^>]+> (?P<duration>\d+)[^>]+>[^>]+> (?P<quality>[a-zA-Z\\]+)[^>]+>[^>]+> (?P<lang>.*?) [^>]+>' - patronNext = '<span>\d</span> <a href="([^"]+)">' + patronNext = r'<span>\d</span> <a href="([^"]+)">' ## debug = True - return locals() + return locals() # =========== def pagina categorie ====================================== @support.scrape @@ -58,13 +58,13 @@ def genres(item): patronBlock = r'FILM RANDOM.*?class="listSubCat">(?P<block>.*)</ul>' action = 'findvideos' patron = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<' - - return locals() + + return locals() # =========== def per cercare film/serietv ============= #host+/index.php?do=search&story=avatar&subaction=search def search(item, text): - support.log() + support.log('search', item) itemlist = [] text = text.replace(" ", "+") item.url = host+"/index.php?do=search&story=%s&subaction=search" % (text) @@ -80,7 +80,7 @@ def search(item, text): # =========== def per le novità nel menu principale ============= def newest(categoria): - support.log(categoria) + support.log('newest', categoria) itemlist = [] item = Item() try: diff --git a/core/support.py b/core/support.py index 118d6ec9..308adfb2 100644 --- a/core/support.py +++ b/core/support.py @@ -153,13 +153,16 @@ def scrape2(item, patron = '', listGroups = [], headers="", blacklist="", data=" def scrapeLang(scraped, lang, longtitle): ## Aggiunto/modificato per gestire i siti che hanno i video ## in ita e subita delle serie tv nella stessa pagina + # altrimenti dopo un sub-ita mette tutti quelli a seguire in sub-ita + # e credo sia utile per filtertools + lang = 'ITA' if scraped['lang']: if 'sub' in scraped['lang'].lower(): lang = 'Sub-ITA' elif 'ita' in scraped['lang'].lower(): lang = 'ITA' - if lang != '': - longtitle += typo(lang, '_ [] color kod') + + longtitle += typo(lang, '_ [] color kod') return lang, longtitle @@ -951,4 +954,4 @@ def channel_config(item, itemlist): def extract_wrapped(decorated): from types import FunctionType closure = (c.cell_contents for c in decorated.__closure__) - return next((c for c in closure if isinstance(c, FunctionType)), None) \ No newline at end of file + return next((c for c in closure if isinstance(c, FunctionType)), None)