(node)
| 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: |
nothing calls this directly
no outgoing calls
no test coverage detected