Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion socid_extractor/schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2513,7 +2513,13 @@
'fullname': lambda x: x.get('owner', {}).get('name'),
'image': lambda x: x.get('owner', {}).get('avatarUrl'),
'blog_title': lambda x: x.get('title'),
'blog_description': lambda x: x.get('description') or None,
'blog_description': lambda x: ' '.join(
json.loads(b['content'])[0]
for b in (x.get('description') or [])
if b.get('type') in ('text', 'link') and b.get('content')
and isinstance(json.loads(b['content']), list)
and json.loads(b['content'])[0]
).strip() or None,
'telegram_username': lambda x: (x.get('owner', {}).get('externalApps', {}).get('telegram', {}).get('username') or None),
},
},
Expand Down
5 changes: 4 additions & 1 deletion tests/test_socid_improvements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,10 @@ def test_boosty_api_json():
body = json.dumps({
"id": 123,
"title": "Организуем митапы",
"description": "Канал про митапы",
"description": [
{"type": "text", "content": '["Канал про митапы","unstyled",[]]', "modificator": ""},
{"type": "text", "content": "", "modificator": "BLOCK_END"},
],
"owner": {
"name": "OSINT mindset",
"id": 10276482,
Expand Down
Loading