fix registrazione HDmario
This commit is contained in:
@@ -95,8 +95,8 @@ class OneSecMailbox(Mailbox):
|
||||
|
||||
|
||||
class Gmailnator(Mailbox):
|
||||
def __init__(self, domains=('.gmail',)):
|
||||
self.baseUrl = 'https://gmailnator.com/'
|
||||
def __init__(self, domains=('.gmail', '+gmail')):
|
||||
self.baseUrl = 'https://www.gmailnator.com/'
|
||||
self.genDomains = {
|
||||
'gmailnator': 1,
|
||||
'+gmail': 2,
|
||||
@@ -108,8 +108,9 @@ class Gmailnator(Mailbox):
|
||||
def new(self):
|
||||
self.csrf = support.match(self.baseUrl, patron='csrf-token" content="([a-z0-9]+)').match
|
||||
logger.debug(self.csrf)
|
||||
e = httptools.downloadpage(self.baseUrl + 'index/indexquery', post={'csrf_gmailnator_token': self.csrf, 'action': 'GenerateEmail', 'data[]': self.data})
|
||||
if e.success:
|
||||
e = httptools.downloadpage(self.baseUrl + 'index/indexquery', post={'csrf_gmailnator_token': self.csrf, 'action': 'GenerateEmail', 'data[]': self.data},
|
||||
headers={'x-requested-with': 'XMLHttpRequest'})
|
||||
if e.success and e.data:
|
||||
return e.data
|
||||
else:
|
||||
platformtools.dialog_ok(config.get_localized_string(20000), 'Impossibile ottenere una mail temporanea')
|
||||
@@ -128,7 +129,7 @@ class Gmailnator(Mailbox):
|
||||
logger.debug(html)
|
||||
m = Email()
|
||||
# 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 inbox
|
||||
|
||||
@@ -161,7 +161,7 @@ def dialog_register(heading, user=False, email=False, password=False, user_defau
|
||||
if height < 250: height = 250
|
||||
self.getControl(10000).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)
|
||||
|
||||
def onClick(self, control):
|
||||
|
||||
@@ -50,7 +50,7 @@ def registerOrLogin(page_url):
|
||||
if user_pre != user_post or password_pre != password_post:
|
||||
return registerOrLogin(page_url)
|
||||
else:
|
||||
return False
|
||||
return []
|
||||
else:
|
||||
import random
|
||||
import string
|
||||
@@ -75,6 +75,10 @@ def registerOrLogin(page_url):
|
||||
platformtools.dialog_ok('HDmario', error)
|
||||
return False
|
||||
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()
|
||||
if mail:
|
||||
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
|
||||
|
||||
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):
|
||||
return []
|
||||
page = httptools.downloadpage(page_url)
|
||||
|
||||
Reference in New Issue
Block a user