fix registrazione HDmario
This commit is contained in:
+6
-5
@@ -95,8 +95,8 @@ class OneSecMailbox(Mailbox):
|
|||||||
|
|
||||||
|
|
||||||
class Gmailnator(Mailbox):
|
class Gmailnator(Mailbox):
|
||||||
def __init__(self, domains=('.gmail',)):
|
def __init__(self, domains=('.gmail', '+gmail')):
|
||||||
self.baseUrl = 'https://gmailnator.com/'
|
self.baseUrl = 'https://www.gmailnator.com/'
|
||||||
self.genDomains = {
|
self.genDomains = {
|
||||||
'gmailnator': 1,
|
'gmailnator': 1,
|
||||||
'+gmail': 2,
|
'+gmail': 2,
|
||||||
@@ -108,8 +108,9 @@ class Gmailnator(Mailbox):
|
|||||||
def new(self):
|
def new(self):
|
||||||
self.csrf = support.match(self.baseUrl, patron='csrf-token" content="([a-z0-9]+)').match
|
self.csrf = support.match(self.baseUrl, patron='csrf-token" content="([a-z0-9]+)').match
|
||||||
logger.debug(self.csrf)
|
logger.debug(self.csrf)
|
||||||
e = httptools.downloadpage(self.baseUrl + 'index/indexquery', post={'csrf_gmailnator_token': self.csrf, 'action': 'GenerateEmail', 'data[]': self.data})
|
e = httptools.downloadpage(self.baseUrl + 'index/indexquery', post={'csrf_gmailnator_token': self.csrf, 'action': 'GenerateEmail', 'data[]': self.data},
|
||||||
if e.success:
|
headers={'x-requested-with': 'XMLHttpRequest'})
|
||||||
|
if e.success and e.data:
|
||||||
return e.data
|
return e.data
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_ok(config.get_localized_string(20000), 'Impossibile ottenere una mail temporanea')
|
platformtools.dialog_ok(config.get_localized_string(20000), 'Impossibile ottenere una mail temporanea')
|
||||||
@@ -128,7 +129,7 @@ class Gmailnator(Mailbox):
|
|||||||
logger.debug(html)
|
logger.debug(html)
|
||||||
m = Email()
|
m = Email()
|
||||||
# ritorna stringhe raw, devo convertirle per eliminare gli \ in piu
|
# 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
|
m.subject, m.date, m.body = support.match(html, patron=r'Subject:\s?<\\/b>([^<]+)<\\/b><div><b>Time:\s?<\\/b>([^<]+).*?\"content\"\s?:\s?\"(.*?)\"}').match
|
||||||
|
|
||||||
return m
|
return m
|
||||||
return inbox
|
return inbox
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ def dialog_register(heading, user=False, email=False, password=False, user_defau
|
|||||||
if height < 250: height = 250
|
if height < 250: height = 250
|
||||||
self.getControl(10000).setHeight(height)
|
self.getControl(10000).setHeight(height)
|
||||||
self.getControl(10001).setHeight(height)
|
self.getControl(10001).setHeight(height)
|
||||||
self.getControl(10000).setPosition(255, (720 - height) / 2)
|
self.getControl(10000).setPosition(255, old_div(720 - height, 2))
|
||||||
self.setFocusId(30000)
|
self.setFocusId(30000)
|
||||||
|
|
||||||
def onClick(self, control):
|
def onClick(self, control):
|
||||||
|
|||||||
+6
-2
@@ -50,7 +50,7 @@ def registerOrLogin(page_url):
|
|||||||
if user_pre != user_post or password_pre != password_post:
|
if user_pre != user_post or password_pre != password_post:
|
||||||
return registerOrLogin(page_url)
|
return registerOrLogin(page_url)
|
||||||
else:
|
else:
|
||||||
return False
|
return []
|
||||||
else:
|
else:
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
@@ -75,6 +75,10 @@ def registerOrLogin(page_url):
|
|||||||
platformtools.dialog_ok('HDmario', error)
|
platformtools.dialog_ok('HDmario', error)
|
||||||
return False
|
return False
|
||||||
if reg['email'] == mailbox.address:
|
if reg['email'] == mailbox.address:
|
||||||
|
if "L'indirizzo email è già stato utilizzato" in regPost.data:
|
||||||
|
# httptools.downloadpage(baseUrl + '/forgotPassword', post={'email': reg['email']})
|
||||||
|
platformtools.dialog_ok('HDmario', 'Indirizzo mail già utilizzato')
|
||||||
|
return False
|
||||||
mail = mailbox.waitForMail()
|
mail = mailbox.waitForMail()
|
||||||
if mail:
|
if mail:
|
||||||
checkUrl = scrapertools.find_single_match(mail.body, 'href="([^"]+)">Premi qui').replace(r'\/', '/')
|
checkUrl = scrapertools.find_single_match(mail.body, 'href="([^"]+)">Premi qui').replace(r'\/', '/')
|
||||||
@@ -116,7 +120,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
data = page.data
|
data = page.data
|
||||||
|
|
||||||
if '/unauthorized' in page.url or '/not-active' in page.url:
|
if '/unauthorized' in page.url or '/not-active' in page.url:
|
||||||
httptools.set_cookies({}, True) # clear cookies
|
httptools.set_cookies({'domain': 'hdmario.live'}, True) # clear cookies
|
||||||
if not registerOrLogin(page_url):
|
if not registerOrLogin(page_url):
|
||||||
return []
|
return []
|
||||||
page = httptools.downloadpage(page_url)
|
page = httptools.downloadpage(page_url)
|
||||||
|
|||||||
Reference in New Issue
Block a user