fix apri nel browser su alcuni canali

This commit is contained in:
marco
2020-10-24 13:17:59 +02:00
parent 11c943f917
commit c70aabdb33
3 changed files with 21 additions and 18 deletions
+6 -6
View File
@@ -42,16 +42,16 @@ def peliculas(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
# debug = True
data = support.match(item, headers=headers).data data = support.match(item, headers=headers).data
if 'clicca qui per aprire' in data.lower(): data = support.match(support.match(data, patron=r'"go_to":"([^"]+)"').match.replace('\\',''), headers=headers).data if 'clicca qui per aprire' in data.lower(): data = support.match(support.match(data, patron=r'"go_to":"([^"]+)"').match.replace('\\',''), headers=headers).data
elif 'clicca qui</span>' in data.lower(): data = support.match(support.match(data, patron=r'<h2 style="text-align: center;"><a href="([^"]+)">').match, headers=headers).data elif 'clicca qui</span>' in data.lower(): data = support.match(support.match(data, patron=r'<h2 style="text-align: center;"><a href="([^"]+)">').match, headers=headers).data
patronBlock = r'</span>(?P<block>[a-zA-Z\s]+\d+(.+?)?(?:\()?(?P<lang>ITA|SUB ITA)(?:\))?.*?)</div></div>' patronBlock = r'</span>(?P<block>[a-zA-Z\s]+\d+(.+?)?(?:\()?(?P<lang>ITA|SUB ITA)(?:\))?.*?)</div></div>'
patron = r'(?P<season>\d+)&#\d+;(?P<episode>\d+(?:-\d+)?)\s*(?:</strong>|<em>)?\s*(?P<title>.+?)(?:–|-.+?-|–.+?–|–|em|.)?(?:/em.*?)?(?:<a (?P<url>.*?))?<br />' patron = r'(?P<season>\d+)&#\d+;(?P<episode>\d+(?:-\d+)?)\s*(?:</strong>|<em>)?\s*(?P<title>.*?)(?:–|-.+?-|–.+?–|–|em|.)?(?:/em.*?)?(?:<a (?P<other>.*?))?<br />'
def itemHook(item): def itemHook(i):
if not item.url: i.url = item.url
item.url = '' return i
return item
return locals() return locals()
@@ -96,4 +96,4 @@ def newest(categoria):
def findvideos(item): def findvideos(item):
support.info() support.info()
return support.server(item, item.url) return support.server(item, item.other)
+9 -7
View File
@@ -71,12 +71,14 @@ def episodios(item):
patron = r'<img src="(?P<thumb>[^"]+)">.*?<li class="season-no">(?P<season>\d+)(?:&#215;|×|x)(?P<episode>\d+)[^<0-9]*<\/li>(?P<url>.*?javascript:;">(?P<title>[^<]+).*?</tbody>)' patron = r'<img src="(?P<thumb>[^"]+)">.*?<li class="season-no">(?P<season>\d+)(?:&#215;|×|x)(?P<episode>\d+)[^<0-9]*<\/li>(?P<url>.*?javascript:;">(?P<title>[^<]+).*?</tbody>)'
else: else:
patronBlock = r'(?:STAGIONE|Stagione)(?:<[^>]+>)?\s*(?:(?P<lang>[A-Za-z- ]+))?(?P<block>.*?)(?:&nbsp;|<strong>|<div class="addtoany)' patronBlock = r'(?:STAGIONE|Stagione)(?:<[^>]+>)?\s*(?:(?P<lang>[A-Za-z- ]+))?(?P<block>.*?)(?:&nbsp;|<strong>|<div class="addtoany)'
patron = r'(?:/>|p>)\s*(?P<season>\d+)(?:&#215;|×|x)(?P<episode>\d+)[^<]+(?P<url>.*?)(?:<br|</p)' patron = r'(?:/>|p>)\s*(?P<season>\d+)(?:&#215;|×|x)(?P<episode>\d+)[^<]+(?P<other>.*?)(?:<br|</p)'
def itemHook(item):
item.title.replace('&#215;','x') def itemHook(i):
if not item.contentLanguage: i.url = item.url
item.contentLanguage = 'ITA' i.title.replace('&#215;','x')
return item if not i.contentLanguage:
i.contentLanguage = 'ITA'
return i
return locals() return locals()
@@ -157,4 +159,4 @@ def findvideos(item):
data = httptools.downloadpage(item.url).data data = httptools.downloadpage(item.url).data
return support.server(item, data=data, patronTag='Versione: <[^>]+>([^<]+)') return support.server(item, data=data, patronTag='Versione: <[^>]+>([^<]+)')
else: else:
return support.server(item, item.url) return support.server(item, item.other)
+6 -5
View File
@@ -52,13 +52,14 @@ def episodios(item):
seasons = support.match(item, patron=r'<option value="(\d+)"[^>]*>\D+(\d+)').matches seasons = support.match(item, patron=r'<option value="(\d+)"[^>]*>\D+(\d+)').matches
patronBlock = r'</select><div style="clear:both"></div></h2>(?P<block>.*?)<div id="trailer" class="tab">' patronBlock = r'</select><div style="clear:both"></div></h2>(?P<block>.*?)<div id="trailer" class="tab">'
patron = r'(?:<div class="list (?:active)?")?\s*<a data-id="\d+(?:[ ](?P<lang>[SuUbBiItTaA\-]+))?"(?P<other>[^>]+)>.*?Episodio [0-9]+\s?(?:<br>(?P<title>[^<]+))?.*?Stagione (?P<season>[0-9]+) , Episodio - (?P<episode>[0-9]+).*?<(?P<url>.*?<iframe)' patron = r'(?:<div class="list (?:active)?")?\s*<a data-id="\d+(?:[ ](?P<lang>[SuUbBiItTaA\-]+))?"(?P<other>[^>]+)>.*?Episodio [0-9]+\s?(?:<br>(?P<title>[^<]+))?.*?Stagione (?P<season>[0-9]+) , Episodio - (?P<episode>[0-9]+).*?<(?P<url>.*?<iframe)'
def itemHook(item): def itemHook(i):
for value, season in seasons: for value, season in seasons:
info(value) info(value)
info(season) info(season)
item.title = item.title.replace(value+'x',season+'x') i.title = i.title.replace(value+'x',season+'x')
item.url += '\n' + item.other i.other += '\n' + i.url
return item i.url = item.url
return i
return locals() return locals()
@@ -110,7 +111,7 @@ def newest(categoria):
def findvideos(item): def findvideos(item):
info(item) info(item)
if item.args != 'update': if item.args != 'update':
return support.server(item, data=item.url) return support.server(item, data=item.other)
else: else:
itemlist = [] itemlist = []
item.infoLabels['mediatype'] = 'episode' item.infoLabels['mediatype'] = 'episode'