mirror of
https://github.com/soxoj/maigret.git
synced 2026-05-06 14:08:59 +00:00
Added memory.lol (Twitter usernames archive) (#1067)
This commit is contained in:
+10
-1
@@ -6,6 +6,7 @@ try:
|
||||
except ImportError:
|
||||
from unittest.mock import Mock
|
||||
|
||||
import ast
|
||||
import re
|
||||
import ssl
|
||||
import sys
|
||||
@@ -374,8 +375,16 @@ def process_site_result(
|
||||
if extracted_ids_data:
|
||||
new_usernames = {}
|
||||
for k, v in extracted_ids_data.items():
|
||||
if "username" in k:
|
||||
if "username" in k and not "usernames" in k:
|
||||
new_usernames[v] = "username"
|
||||
elif "usernames" in k:
|
||||
try:
|
||||
tree = ast.literal_eval(v)
|
||||
if type(tree) == list:
|
||||
for n in tree:
|
||||
new_usernames[n] = "username"
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
if k in SUPPORTED_IDS:
|
||||
new_usernames[v] = k
|
||||
|
||||
|
||||
+11
-1
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Maigret main module
|
||||
"""
|
||||
import ast
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
@@ -85,8 +86,17 @@ def extract_ids_from_page(url, logger, timeout=5) -> dict:
|
||||
else:
|
||||
print(get_dict_ascii_tree(info.items(), new_line=False), ' ')
|
||||
for k, v in info.items():
|
||||
if 'username' in k:
|
||||
# TODO: merge with the same functionality in checking module
|
||||
if 'username' in k and not 'usernames' in k:
|
||||
results[v] = 'username'
|
||||
elif 'usernames' in k:
|
||||
try:
|
||||
tree = ast.literal_eval(v)
|
||||
if type(tree) == list:
|
||||
for n in tree:
|
||||
results[n] = 'username'
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
if k in SUPPORTED_IDS:
|
||||
results[v] = k
|
||||
|
||||
|
||||
@@ -24135,6 +24135,24 @@
|
||||
"usernameUnclaimed": "noonewouldeverusethis7",
|
||||
"usernameClaimed": "alex"
|
||||
},
|
||||
"memory.lol": {
|
||||
"tags": [
|
||||
"messaging"
|
||||
],
|
||||
"regexCheck": "^[a-zA-Z0-9_]{1,15}$",
|
||||
"checkType": "message",
|
||||
"absenceStrs": [
|
||||
"{\"accounts\":[]}"
|
||||
],
|
||||
"presenseStrs": [
|
||||
"{\"accounts\":[{"
|
||||
],
|
||||
"source": "Twitter",
|
||||
"urlMain": "https://memory.lol",
|
||||
"url": "https://api.memory.lol/v1/tw/{username}",
|
||||
"usernameClaimed": "libsoftiktok",
|
||||
"usernameUnclaimed": "noonewould123"
|
||||
},
|
||||
"metroman.3dn.ru": {
|
||||
"engine": "uCoz",
|
||||
"urlMain": "http://metroman.3dn.ru",
|
||||
|
||||
Reference in New Issue
Block a user