fix: cinemalibero.py
pulizia log e debug
This commit is contained in:
@@ -3,9 +3,8 @@
|
|||||||
# Canale per 'cinemaLibero'
|
# Canale per 'cinemaLibero'
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
"""
|
"""
|
||||||
Questi sono commenti per i beta-tester.
|
|
||||||
|
|
||||||
25 titoli per le novità di qualsiasi sezione.
|
25 titoli per le novità
|
||||||
|
|
||||||
NON CONTROLLARE LE SEZIONE SPORT - ANIME, HANNO PROBLEMI!!!
|
NON CONTROLLARE LE SEZIONE SPORT - ANIME, HANNO PROBLEMI!!!
|
||||||
è stata eliminata dall'elenco ma i titoli possono apparire nella ricerca o tra le novità
|
è stata eliminata dall'elenco ma i titoli possono apparire nella ricerca o tra le novità
|
||||||
@@ -31,7 +30,6 @@ headers = [['Referer', host]]
|
|||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
support.log()
|
|
||||||
|
|
||||||
film = ['/category/film/',
|
film = ['/category/film/',
|
||||||
('Novità', ['', 'peliculas', 'update']),
|
('Novità', ['', 'peliculas', 'update']),
|
||||||
@@ -55,8 +53,6 @@ def mainlist(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
support.log()
|
|
||||||
#debug = True
|
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url, headers=headers).data
|
data = httptools.downloadpage(item.url, headers=headers).data
|
||||||
data = re.sub('\n|\t', ' ', data)
|
data = re.sub('\n|\t', ' ', data)
|
||||||
@@ -91,25 +87,21 @@ def peliculas(item):
|
|||||||
|
|
||||||
dataBlock = httptools.downloadpage(item.url, headers=headers).data
|
dataBlock = httptools.downloadpage(item.url, headers=headers).data
|
||||||
genere = scrapertoolsV2.find_single_match(dataBlock, r'rel="category tag">([a-zA-Z0-9]+).+?<')
|
genere = scrapertoolsV2.find_single_match(dataBlock, r'rel="category tag">([a-zA-Z0-9]+).+?<')
|
||||||
support.log('GENERE :', genere)
|
|
||||||
|
|
||||||
if genere.lower() in str(GENERI).lower():
|
if genere.lower() in str(GENERI).lower():
|
||||||
support.log("E' un film: ", genere, ' -> ' , GENERI)
|
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
if item.args == 'update':
|
if item.args == 'update':
|
||||||
item.title = item.title.replace('-',' ')
|
item.title = item.title.replace('-',' ')
|
||||||
elif genere.lower() == 'serie':
|
elif genere.lower() == 'serie':
|
||||||
support.log("E' una serie: ", genere)
|
|
||||||
item.action = 'episodios'
|
item.action = 'episodios'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
elif genere.lower() == 'anime':
|
elif genere.lower() == 'anime':
|
||||||
support.log("E' una anime: ", genere)
|
|
||||||
blockAnime = scrapertoolsV2.find_single_match(dataBlock, r'<div id="container" class="container">(.+?)<div style="margin-left')
|
blockAnime = scrapertoolsV2.find_single_match(dataBlock, r'<div id="container" class="container">(.+?)<div style="margin-left')
|
||||||
if 'stagione' in blockAnime.lower() or 'episodio' in blockAnime.lower() or 'saga' in blockAnime.lower():
|
if 'stagione' in blockAnime.lower() or 'episodio' in blockAnime.lower() or 'saga' in blockAnime.lower():
|
||||||
anime = True
|
anime = True
|
||||||
item.action = 'episodios'
|
item.action = 'episodios'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
else:
|
else:
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.action = 'findvideos'
|
item.action = 'findvideos'
|
||||||
@@ -121,12 +113,11 @@ def peliculas(item):
|
|||||||
return item
|
return item
|
||||||
|
|
||||||
patronNext = r'<a class="next page-numbers".*?href="([^"]+)">'
|
patronNext = r'<a class="next page-numbers".*?href="([^"]+)">'
|
||||||
debug = True
|
#debug = True
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
support.log()
|
|
||||||
|
|
||||||
if item.args == 'anime':
|
if item.args == 'anime':
|
||||||
support.log("Anime :", item)
|
support.log("Anime :", item)
|
||||||
@@ -145,9 +136,9 @@ def episodios(item):
|
|||||||
#debug = True
|
#debug = True
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
support.log()
|
|
||||||
|
|
||||||
action='peliculas'
|
action='peliculas'
|
||||||
patron_block=r'<div id="bordobar" class="dropdown-menu(?P<block>.*?)</li>'
|
patron_block=r'<div id="bordobar" class="dropdown-menu(?P<block>.*?)</li>'
|
||||||
@@ -200,5 +191,4 @@ def findvideos(item):
|
|||||||
if item.contentType == 'movie' and item.args != 'anime':
|
if item.contentType == 'movie' and item.args != 'anime':
|
||||||
return support.server(item)
|
return support.server(item)
|
||||||
else:
|
else:
|
||||||
support.log("Anime: ", item.url)
|
|
||||||
return support.server(item, data= item.url)
|
return support.server(item, data= item.url)
|
||||||
|
|||||||
Reference in New Issue
Block a user