[instagram] extract 'coauthors' metadata (#3107)
This commit is contained in:
@@ -172,6 +172,15 @@ class InstagramExtractor(Extractor):
|
|||||||
data["location_url"] = "{}/explore/locations/{}/{}/".format(
|
data["location_url"] = "{}/explore/locations/{}/{}/".format(
|
||||||
self.root, location["pk"], slug)
|
self.root, location["pk"], slug)
|
||||||
|
|
||||||
|
coauthors = post.get("coauthor_producers")
|
||||||
|
if coauthors:
|
||||||
|
data["coauthors"] = [
|
||||||
|
{"id" : user["pk"],
|
||||||
|
"username" : user["username"],
|
||||||
|
"full_name": user["full_name"]}
|
||||||
|
for user in coauthors
|
||||||
|
]
|
||||||
|
|
||||||
if "carousel_media" in post:
|
if "carousel_media" in post:
|
||||||
items = post["carousel_media"]
|
items = post["carousel_media"]
|
||||||
data["sidecar_media_id"] = data["post_id"]
|
data["sidecar_media_id"] = data["post_id"]
|
||||||
@@ -266,6 +275,14 @@ class InstagramExtractor(Extractor):
|
|||||||
data["location_url"] = "{}/explore/locations/{}/{}/".format(
|
data["location_url"] = "{}/explore/locations/{}/{}/".format(
|
||||||
self.root, location["id"], location["slug"])
|
self.root, location["id"], location["slug"])
|
||||||
|
|
||||||
|
coauthors = post.get("coauthor_producers")
|
||||||
|
if coauthors:
|
||||||
|
data["coauthors"] = [
|
||||||
|
{"id" : user["id"],
|
||||||
|
"username": user["username"]}
|
||||||
|
for user in coauthors
|
||||||
|
]
|
||||||
|
|
||||||
data["_files"] = files = []
|
data["_files"] = files = []
|
||||||
if "edge_sidecar_to_children" in post:
|
if "edge_sidecar_to_children" in post:
|
||||||
for num, edge in enumerate(
|
for num, edge in enumerate(
|
||||||
|
|||||||
Reference in New Issue
Block a user