Skip to content

Commit

Permalink
Fix issues #11
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Pitkov committed Mar 28, 2023
1 parent e029730 commit d33a616
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion account_generator_helper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

__author__ = 'Dionis1902'
__email__ = 'den70007.ua@gmail.com'
__version__ = '1.0.13'
__version__ = '1.0.14'
2 changes: 1 addition & 1 deletion account_generator_helper/temp_mail/gmailnator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ def get_inbox(self):
r = self._s.post('https://www.emailnator.com/message-list',
headers={**headers, 'x-xsrf-token': self.__get_xsrf_token()}, data=payload)
if r.status_code == 200:
return [Letter(self._email, _letter, self._proxies, self.__get_xsrf_token(), self._s) for _letter in r.json()['messageData'] if
return [Letter(self._email, _letter, self.__get_xsrf_token(), self._s) for _letter in r.json()['messageData'] if
'ADS' not in _letter['messageID']]
return []
9 changes: 6 additions & 3 deletions account_generator_helper/temp_mail/gmailnator/letter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@


class Letter(letter.Letter):
def __init__(self, to, content, proxies, token, session):
def __init__(self, to, content, token, session):
self._token = token
self._s = session
letter_id, _from, subject = content['messageID'], content['from'], content['subject']
super().__init__(to, *re.findall(r'(.*) <(.*)>', _from)[0], subject, datetime.fromtimestamp(0), proxies, letter_id)
if '<' in content['from']:
name, from_email = re.findall(r'^(.*) <(.*)>$', content['from'])[0]
else:
name = from_email = content['from']
super().__init__(to, name, from_email, content['subject'], datetime.fromtimestamp(0), content['messageID'])

@property
def letter(self):
Expand Down
2 changes: 1 addition & 1 deletion account_generator_helper/temp_mail/inboxkitten/letter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Letter(letter.Letter):
def __init__(self, url, headers, timestamp, session):
if '<' in headers['from']:
name, from_email = re.findall(r'(.*) <(.*)>', headers['from'])[0]
name, from_email = re.findall(r'^(.*) <(.*)>$', headers['from'])[0]
else:
name = from_email = headers['from']
super().__init__(headers['to'], name, from_email, headers['subject'], datetime.fromtimestamp(timestamp))
Expand Down
2 changes: 1 addition & 1 deletion account_generator_helper/temp_mail/tempmail/letter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Letter(letter.Letter):
def __init__(self, to, from_email, subject, timestamp, body):
if '<' in from_email:
name, from_email = re.findall(r'(.*) <(.*)>', from_email)[0]
name, from_email = re.findall(r'^(.*) <(.*)>$', from_email)[0]
else:
name = from_email = from_email

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='account_generator_helper',
version='1.0.13',
version='1.0.14',
packages=find_packages(),
classifiers=[
'Development Status :: 3 - Alpha',
Expand Down

0 comments on commit d33a616

Please sign in to comment.