diff options
author | rubenwardy <rw@rubenwardy.com> | 2018-12-25 19:28:32 +0000 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2018-12-25 19:28:32 +0000 |
commit | 21960f24047bdf64eff99ec955ff2229c49eff50 (patch) | |
tree | e5bafd280407fabe863f4d1fbf5b667f02c607e3 /app/tasks/phpbbparser.py | |
parent | f94885a58f05864682af5394c1b0c3733d46a305 (diff) | |
download | cheatdb-21960f24047bdf64eff99ec955ff2229c49eff50.tar.xz |
Add support for using forum profile pictures
Diffstat (limited to 'app/tasks/phpbbparser.py')
-rw-r--r-- | app/tasks/phpbbparser.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/tasks/phpbbparser.py b/app/tasks/phpbbparser.py index 9984ad0..d3e1231 100644 --- a/app/tasks/phpbbparser.py +++ b/app/tasks/phpbbparser.py @@ -15,8 +15,9 @@ def urlEncodeNonAscii(b): class Profile: def __init__(self, username): - self.username = username - self.signature = "" + self.username = username + self.signature = "" + self.avatar = None self.properties = {} def set(self, key, value): @@ -33,6 +34,11 @@ def __extract_properties(profile, soup): if el is None: return None + res1 = el.find_all("dl") + imgs = res1[0].find_all("img") + if len(imgs) == 1: + profile.avatar = imgs[0]["src"] + res = el.find_all("dl", class_ = "left-box details") if len(res) != 1: return None |