tomquirk / linkedin-api

👨‍💼 LinkedIn API for Python
https://pypi.org/project/linkedin-api
MIT License
2.15k stars 455 forks source link

Access embeddede images & Videos #450

Open kqvanity opened 3 weeks ago

kqvanity commented 3 weeks ago

I'd like to access the accompanying media e.g., image direct URLs, videos.

it's should ideally be signified as well! Thanks!

BennyDanielT commented 1 week ago

You can construct them by retrieving the displayImageUrl and img_400_400 URL.

local_api = Linkedin(
            os.getenv("LINKEDIN_EMAIL"),
            os.getenv("LINKEDIN_PASSWORD"),
            cookies=cookie_jar,
        )
        profile = local_api.get_profile(profile_id)
        display_picture_url = profile.get("displayPictureUrl", "")
        img_400_400 = profile.get("img_400_400", "")
        parsed_image_url = f"{display_picture_url}{img_400_400}"

Let me know, if you have further questions.

kqvanity commented 1 week ago

I mean the actual content of the LinkedIn Post itself, where the author might've uploaded many photos.

BennyDanielT commented 1 week ago

I see. Let me play around, I'll keep you posted!