Skip to content

Commit

Permalink
Yet more ways LinkedIn stores image URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Oct 14, 2024
1 parent 0bc88a3 commit c27fbbe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion datasources/linkedin/search_linkedin.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ def map_item(item):
# or alternatively they are stored here:
if not images and item["content"] and item["content"].get("articleComponent") and item["content"]["articleComponent"].get("largeImage"):
image = item["content"]["articleComponent"]["largeImage"]["attributes"][0]["detailData"]["vectorImage"]
images.append(image["rootUrl"] + image["artifacts"][0]["fileIdentifyingUrlPathSegment"])
if not image and item["content"]["articleComponent"]["largeImage"]["attributes"][0]["imageUrl"]:
images.append(item["content"]["articleComponent"]["largeImage"]["attributes"][0]["imageUrl"]["url"])
elif image and image.get("artifacts"):
images.append(image["rootUrl"] + image["artifacts"][0]["fileIdentifyingUrlPathSegment"])

author = SearchLinkedIn.get_author(item)

Expand Down

0 comments on commit c27fbbe

Please sign in to comment.