Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
weboob
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
177
Issues
177
List
Boards
Labels
Milestones
Merge Requests
48
Merge Requests
48
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
weboob
weboob
Commits
86f90b0c
Commit
86f90b0c
authored
Jan 02, 2019
by
Romain Bignon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aum: fix compatibility with python3
parent
29c0cab6
Pipeline
#1877
passed with stages
in 16 minutes and 35 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
8 deletions
+11
-8
modules/aum/browser.py
modules/aum/browser.py
+4
-4
modules/aum/contact.py
modules/aum/contact.py
+3
-2
modules/aum/module.py
modules/aum/module.py
+3
-2
tools/py3-compatible.modules
tools/py3-compatible.modules
+1
-0
No files found.
modules/aum/browser.py
View file @
86f90b0c
...
...
@@ -154,9 +154,9 @@ class AuMBrowser(DomainBrowser):
headers
=
kwargs
.
setdefault
(
'headers'
,
{})
if
'applications'
not
in
url
:
today
=
local2utc
(
datetime
.
now
())
.
strftime
(
'
%
Y-
%
m-
%
d'
)
token
=
sha256
(
self
.
username
+
self
.
APITOKEN
+
today
)
.
hexdigest
()
token
=
sha256
(
(
self
.
username
+
self
.
APITOKEN
+
today
)
.
encode
(
'utf-8'
)
)
.
hexdigest
()
headers
[
'Authorization'
]
=
'Basic
%
s'
%
(
b64encode
(
'
%
s:
%
s'
%
(
self
.
username
,
self
.
password
))
)
headers
[
'Authorization'
]
=
'Basic
%
s'
%
(
b64encode
(
b
'
%
s:
%
s'
%
(
self
.
username
.
encode
(
'utf-8'
),
self
.
password
.
encode
(
'utf-8'
))))
.
decode
(
'utf-8'
)
headers
[
'X-Platform'
]
=
'android'
headers
[
'X-Client-Version'
]
=
self
.
APIVERSION
headers
[
'X-AUM-Token'
]
=
token
...
...
@@ -181,8 +181,8 @@ class AuMBrowser(DomainBrowser):
return
self
.
consts
self
.
consts
=
[{},
{}]
for
key
,
sexes
in
self
.
request
(
'values'
)
.
ite
rite
ms
():
for
sex
,
values
in
sexes
.
ite
rite
ms
():
for
key
,
sexes
in
self
.
request
(
'values'
)
.
items
():
for
sex
,
values
in
sexes
.
items
():
if
sex
in
(
'boy'
,
'both'
):
self
.
consts
[
0
][
key
]
=
values
if
sex
in
(
'girl'
,
'both'
):
...
...
modules/aum/contact.py
View file @
86f90b0c
...
...
@@ -26,6 +26,7 @@ from collections import OrderedDict
from
weboob.capabilities.contact
import
Contact
as
_Contact
,
ProfileNode
from
weboob.tools.html
import
html2text
from
weboob.tools.compat
import
unicode
,
basestring
class
FieldBase
(
object
):
...
...
@@ -242,7 +243,7 @@ class Contact(_Contact):
self
.
profile
=
OrderedDict
()
if
'sex'
in
profile
:
for
section
,
d
in
self
.
TABLE
.
ite
rite
ms
():
for
section
,
d
in
self
.
TABLE
.
items
():
flags
=
ProfileNode
.
SECTION
if
section
.
startswith
(
'_'
):
flags
|=
ProfileNode
.
HEAD
...
...
@@ -254,7 +255,7 @@ class Contact(_Contact):
s
=
ProfileNode
(
section
,
section
.
capitalize
(),
OrderedDict
(),
flags
=
flags
)
for
key
,
builder
in
d
.
ite
rite
ms
():
for
key
,
builder
in
d
.
items
():
try
:
value
=
builder
.
get_value
(
profile
,
consts
[
int
(
profile
[
'sex'
])])
except
KeyError
:
...
...
modules/aum/module.py
View file @
86f90b0c
...
...
@@ -36,6 +36,7 @@ from weboob.exceptions import BrowserUnavailable, BrowserHTTPNotFound
from
weboob.tools.value
import
Value
,
ValueBool
,
ValueBackendPassword
from
weboob.tools.date
import
local2utc
from
weboob.tools.misc
import
to_unicode
from
weboob.tools.compat
import
unicode
,
long
,
basestring
from
.contact
import
Contact
from
.antispam
import
AntiSpam
...
...
@@ -104,7 +105,7 @@ class AuMModule(Module, CapMessages, CapMessagesPost, CapDating, CapChat, CapCon
all_events
[
u'baskets'
]
=
(
self
.
browser
.
get_baskets
,
'You were put into
%
s
\'
s basket'
)
all_events
[
u'flashs'
]
=
(
self
.
browser
.
get_flashs
,
'You sent a charm to
%
s'
)
all_events
[
u'visits'
]
=
(
self
.
browser
.
get_visits
,
'Visited by
%
s'
)
for
type
,
(
events
,
message
)
in
all_events
.
ite
rite
ms
():
for
type
,
(
events
,
message
)
in
all_events
.
items
():
for
event
in
events
():
e
=
Event
(
event
[
'who'
][
'id'
])
...
...
@@ -343,7 +344,7 @@ class AuMModule(Module, CapMessages, CapMessagesPost, CapDating, CapChat, CapCon
if
'profile'
in
fields
:
contact
=
self
.
get_contact
(
contact
)
if
contact
and
'photos'
in
fields
:
for
name
,
photo
in
contact
.
photos
.
ite
rite
ms
():
for
name
,
photo
in
contact
.
photos
.
items
():
if
photo
.
url
and
not
photo
.
data
:
data
=
self
.
browser
.
openurl
(
photo
.
url
)
.
read
()
contact
.
set_photo
(
name
,
data
=
data
)
...
...
tools/py3-compatible.modules
View file @
86f90b0c
...
...
@@ -14,6 +14,7 @@ anticaptcha
amundi
apec
arte
aum
avendrealouer
axabanque
bandcamp
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment