Skip to content

Commit

Permalink
Added memory.lol (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
soxoj authored Jul 24, 2023
1 parent 5a940dc commit 4503617
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions socid_extractor/schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1809,5 +1809,14 @@
'registered_domains': lambda x: [i["productCode"] for i in x["exact"] if i["status"] == "registered"],
'protected_domains': lambda x: [i["productCode"] for i in x["exact"] if i["status"] == "protected"],
}
},
'memory.lol': {
'flags': ['{"accounts":[{'],
'regex': r'^({[\S\s]+?})$',
'extract_json': True,
'fields': {
'id': lambda x: x['accounts'][0]['id'],
'known_usernames': lambda x: [i for i in x['accounts'][0]['screen_names']],
}
}
}
7 changes: 7 additions & 0 deletions tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -1220,3 +1220,10 @@ def test_aparat_api():
assert info.get("links") == "['https://sibmo.ir/bigmj', 'http://www.telegram.me/amobig', 'http://www.instagram.com/amobigstream']"
assert 'video_count' in info
assert info.get("bio") == "چنل تلگرام:\r\nhttps://t.me/amobig"


def test_memory_lol():
info = extract(parse('https://api.memory.lol/v1/tw/libsoftiktok')[0])

assert info.get("id") == "1326229737551912960"
assert info.get("known_usernames") == "['shaya69830552', 'shaya_ray', 'chayaraichik', 'chayathepatriot', 'cuomomustgo', 'houseplantpotus', 'libsoftiktok']"

0 comments on commit 4503617

Please sign in to comment.