MCPcopy Create free account
hub / github.com/CScorza/IntelOSINT / _append_media

Method _append_media

IntelOSINT.py:15984–16001  ·  view source on GitHub ↗
(src)

Source from the content-addressed store, hash-verified

15982 media = []
15983
15984 def _append_media(src):
15985 if not src:
15986 return
15987 if isinstance(src, dict):
15988 for key in ("url", "src", "image", "avatar", "header", "cover", "picture", "avatarThumbs", "headerThumbs"):
15989 _append_media(src.get(key))
15990 return
15991 if isinstance(src, list):
15992 for item in src:
15993 _append_media(item)
15994 return
15995 if isinstance(src, tuple):
15996 for item in src:
15997 _append_media(item)
15998 return
15999 url = self._safe_abs_url(source_url, str(src))
16000 if self._looks_like_image_url(url) and not _is_generic_image(url) and url not in media:
16001 media.append(url)
16002
16003 for src in [avatar, header, profile.get("Image"), profile.get("image"), profile.get("avatar"), profile.get("cover"), profile.get("banner"), profile.get("profilePicture"), profile.get("avatarThumbs"), profile.get("headerThumbs")]:
16004 _append_media(src)

Callers

nothing calls this directly

Calls 2

_safe_abs_urlMethod · 0.95
_looks_like_image_urlMethod · 0.95

Tested by

no test coverage detected