Skip to content

Auto-translated map_item updates from 4CAT: instagram#93

Draft
4cat-to-zeeschuimer-automation-pr[bot] wants to merge 1 commit into
masterfrom
auto/4cat-map-item-sync-instagram
Draft

Auto-translated map_item updates from 4CAT: instagram#93
4cat-to-zeeschuimer-automation-pr[bot] wants to merge 1 commit into
masterfrom
auto/4cat-map-item-sync-instagram

Conversation

@4cat-to-zeeschuimer-automation-pr

@4cat-to-zeeschuimer-automation-pr 4cat-to-zeeschuimer-automation-pr Bot commented Jun 30, 2026

Copy link
Copy Markdown

🤖 This PR was auto-generated by the 4CAT map_item sync workflow. The JavaScript was produced by an LLM and requires human review before merging — including manual fixes for any lint warnings flagged below.

Generation parameters

  • Model: gpt-oss-120b (provider: litellm)
  • Total LLM time: 77.07s
  • Trigger: push of 27dbc53 to 4CAT master (module: instagram).

Summary

  • ✅ 1 translated
  • ⚠️ 1 translated with lint warnings (require manual fix)
  • ❌ 0 failed
  • ❔ 0 skipped
Datasource Module Time Warnings
datasources/instagram/search_instagram.py modules/instagram.js 77.05s ⚠️ 1

⚠️ Lint warnings — fix before merging

The following datasources translated successfully but the static lint flagged issues that need human fixes. The auto-generated code was spliced into the JS module as-is; please patch the file directly in this PR.

datasources/instagram/search_instagram.py -> modules/instagram.js

  • [helpers_to_add[0]] Literal newline inside a string literal — JS strings can't span lines without escape ("\n") or template literals (`\n`).

datasources/instagram/search_instagram.py -> modules/instagram.js (77.05s) ⚠️

LLM commentary:

The map_item function mirrors the Python logic: it filters out ads, detects Polaris vs Graph vs legacy itemlist formats, and delegates to helper parsers. Helper functions (extractHashtags, parsePolarisItem, parseGraphItem, parseItemlistItem) are provided in helpers_to_add and include the necessary constants (MEDIA_TYPE_* and HASHTAG_REGEX). All Python-specific constructs (dict.get, f-strings, True/False, None) have been replaced with JavaScript equivalents. MissingMappedField and MapItemException are instantiated with 'new' as required. Timestamp formatting uses the global formatUtcTimestamp helper. No external imports are needed because Zeeschuimer globals supply MappedItem, MissingMappedField, normalize_url_encoding, and formatUtcTimestamp.

Python diff
diff --git a/datasources/instagram/search_instagram.py b/datasources/instagram/search_instagram.py
index 0f76b66f..d375c560 100644
--- a/datasources/instagram/search_instagram.py
+++ b/datasources/instagram/search_instagram.py
@@ -144,7 +144,7 @@ class SearchInstagram(Search):
             "body": caption,
 
             # Authors
-            "author_id": user.get("id", owner.get("id", MissingMappedField(""))), # This should always be present
+            "author_id": user.get("id", owner.get("id", MissingMappedField(""))), # This should always be present; and yet I have seen old datasets where it is not
             "author": user.get("username", owner.get("username", MissingMappedField(""))),
             # full_name not seen in this format
             "author_fullname": user.get("full_name", owner.get("full_name", MissingMappedField(""))),
@@ -408,9 +408,10 @@ class SearchInstagram(Search):
             for coauthor_node in node["coauthor_producers"]:
                 coauthors.append(coauthor_node.get("username", MissingMappedField("")))
                 coauthor_fullnames.append(coauthor_node.get("full_name", MissingMappedField("")))
-                coauthor_ids.append(coauthor_node.get("id"))
+                coauthor_ids.append(coauthor_node.get("id", MissingMappedField("")))
         coauthors = ",".join([str(value) for value in coauthors])
         coauthor_fullnames = ",".join([str(value) for value in coauthor_fullnames])
+        coauthor_ids = ",".join([str(value) for value in coauthor_ids])
 
         no_likes = bool(node.get("like_and_view_counts_disabled"))
 
@@ -458,7 +459,7 @@ class SearchInstagram(Search):
             "author_avatar_url": user.get("profile_pic_url", owner.get("profile_pic_url", MissingMappedField(""))),
             "coauthors": coauthors,
             "coauthor_fullnames": coauthor_fullnames,
-            "coauthor_ids": ",".join(coauthor_ids),
+            "coauthor_ids": coauthor_ids,
 
             # Media
             "media_type": media_type,

@4cat-to-zeeschuimer-automation-pr
4cat-to-zeeschuimer-automation-pr Bot force-pushed the auto/4cat-map-item-sync-instagram branch from 44a178f to 9fabc2e Compare July 23, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant