fix ricerca altadefinizioneclick e registrazione hdmario
This commit is contained in:
@@ -46,6 +46,7 @@ def mainlist(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
|
# debug = True
|
||||||
patron = r'<div class="wrapperImage">[ ]?(?:<span class="hd">(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)".+?<h2 class="titleFilm">[^>]+>'\
|
patron = r'<div class="wrapperImage">[ ]?(?:<span class="hd">(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)".+?<h2 class="titleFilm">[^>]+>'\
|
||||||
r'(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?(?:IMDB\:</strong>[ ](?P<rating>.+?)<|</h2> )'
|
r'(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?(?:IMDB\:</strong>[ ](?P<rating>.+?)<|</h2> )'
|
||||||
patronBlock = r'h1>(?P<block>.*?)<div class="row ismobile">'
|
patronBlock = r'h1>(?P<block>.*?)<div class="row ismobile">'
|
||||||
@@ -60,8 +61,7 @@ def peliculas(item):
|
|||||||
r'.+?<h2 class="titleFilm(?:Mobile)?">[^>]+>(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?(IMDB\:[ ](?P<rating>.+?))<'
|
r'.+?<h2 class="titleFilm(?:Mobile)?">[^>]+>(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?(IMDB\:[ ](?P<rating>.+?))<'
|
||||||
elif item.args == 'search':
|
elif item.args == 'search':
|
||||||
patronBlock = r'<section id="lastUpdate">(?P<block>.*?)<div class="row ismobile">'
|
patronBlock = r'<section id="lastUpdate">(?P<block>.*?)<div class="row ismobile">'
|
||||||
patron = r'<a href="(?P<url>[^"]+)">\s*<div class="wrapperImage">(?:<span class="hd">(?P<quality>[^<]+)<\/span>)?<img[^s]+src="(?P<thumb>[^"]+)"'\
|
patron = r'<a href="(?P<url>[^"]+)">\s*<div class="wrapperImage">(?:<span class="year">(?P<year>[^<]+)<\/span>)?(?:<span class="hd">(?P<quality>[^<]+)<\/span>)?<img[^s]+src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)'
|
||||||
r'[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)<[^<]+>(?:.*?IMDB:\s(\2[^<]+)<\/div>)?'
|
|
||||||
|
|
||||||
if not item.args:
|
if not item.args:
|
||||||
patronBlock = r'ULTIMI INSERITI(?P<block>.*?)<div class="sliderLastUpdate ismobile ">'
|
patronBlock = r'ULTIMI INSERITI(?P<block>.*?)<div class="sliderLastUpdate ismobile ">'
|
||||||
|
|||||||
+5
-2
@@ -1,6 +1,7 @@
|
|||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
import time
|
import time
|
||||||
|
from ast import literal_eval
|
||||||
|
|
||||||
from core import httptools, support
|
from core import httptools, support
|
||||||
from platformcode import platformtools, config, logger
|
from platformcode import platformtools, config, logger
|
||||||
@@ -121,11 +122,13 @@ class Gmailnator(Mailbox):
|
|||||||
inbox = self.inbox()
|
inbox = self.inbox()
|
||||||
if inbox:
|
if inbox:
|
||||||
self.user, id = support.match(inbox[0]['content'], patron='([^\/]+)\/messageid\/#([a-z0-9]+)').match
|
self.user, id = support.match(inbox[0]['content'], patron='([^\/]+)\/messageid\/#([a-z0-9]+)').match
|
||||||
#<b>subject</b><div>2 minutes ago</div><hr /><div dir="ltr">body</div>
|
#<b>subject<\/b><div>2 minutes ago</div><hr \/><div dir="ltr">body</div>
|
||||||
html = httptools.downloadpage(self.baseUrl + 'mailbox/get_single_message/', post={'csrf_gmailnator_token': self.csrf, 'action': 'get_message', 'message_id': id, 'email': self.user}).data
|
html = httptools.downloadpage(self.baseUrl + 'mailbox/get_single_message/', post={'csrf_gmailnator_token': self.csrf, 'action': 'get_message', 'message_id': id, 'email': self.user}).data
|
||||||
|
html = literal_eval('"""' + html + '"""')
|
||||||
logger.debug(html)
|
logger.debug(html)
|
||||||
m = Email()
|
m = Email()
|
||||||
m.subject, m.date, m.body = support.match(html, patron='<b>([^<]+)<\/b><div>([^<]+)<\/div><hr \/>(.*)').match
|
# ritorna stringhe raw, devo convertirle per eliminare gli \ in piu
|
||||||
|
m.subject, m.date, m.body = support.match(html, patron=r'<b>([^<]+)<\\/b><div>([^<]+)<hr \\/>(.*)').match
|
||||||
|
|
||||||
return m
|
return m
|
||||||
return inbox
|
return inbox
|
||||||
|
|||||||
+2
-1
@@ -77,7 +77,8 @@ def registerOrLogin(page_url):
|
|||||||
if reg['email'] == mailbox.address:
|
if reg['email'] == mailbox.address:
|
||||||
mail = mailbox.waitForMail()
|
mail = mailbox.waitForMail()
|
||||||
if mail:
|
if mail:
|
||||||
checkUrl = scrapertools.find_single_match(mail.body, 'href="([^"]+)">Premi qui')
|
checkUrl = scrapertools.find_single_match(mail.body, 'href="([^"]+)">Premi qui').replace(r'\/', '/')
|
||||||
|
logger.debug('CheckURL: ' + checkUrl)
|
||||||
httptools.downloadpage(checkUrl)
|
httptools.downloadpage(checkUrl)
|
||||||
config.set_setting('username', mailbox.address, server='hdmario')
|
config.set_setting('username', mailbox.address, server='hdmario')
|
||||||
config.set_setting('password', randPsw, server='hdmario')
|
config.set_setting('password', randPsw, server='hdmario')
|
||||||
|
|||||||
Reference in New Issue
Block a user