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

Method _extract_insta_pageinfo

IntelOSINT.py:815–837  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

813 encoded_variables = (q.get("variables") or [None])[0]
814
815 def _extract_insta_pageinfo(node):
816 if isinstance(node, dict):
817 page_info = node.get("page_info") or node.get("pageInfo")
818 if isinstance(page_info, dict):
819 has_next = page_info.get("has_next_page")
820 end_cursor = page_info.get("end_cursor") or page_info.get("endCursor")
821 if has_next and end_cursor and qhash:
822 try:
823 variables = json.loads(encoded_variables) if encoded_variables else {}
824 except Exception:
825 variables = {}
826 if isinstance(variables, dict):
827 collected_api_pages.append({
828 "query_hash": qhash,
829 "variables": variables,
830 "end_cursor": str(end_cursor),
831 "page_info": bool(has_next)
832 })
833 for v in node.values():
834 _extract_insta_pageinfo(v)
835 elif isinstance(node, list):
836 for it in node:
837 _extract_insta_pageinfo(it)
838
839 _extract_insta_pageinfo(data)
840 except:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected