Add LinkedIn avatar downloader + Chrome-session auth (macOS)#294
Open
framallo wants to merge 2 commits into
Open
Add LinkedIn avatar downloader + Chrome-session auth (macOS)#294framallo wants to merge 2 commits into
framallo wants to merge 2 commits into
Conversation
- core/chrome_cookies.py: get_chrome_linkedin_cookies() decrypts cookies from a logged-in Chrome profile (macOS Keychain) so you can auth without a password. - scrapers/avatar.py: AvatarScraper.download() element-screenshots the main square profile photo — the only reliable way to get a headshot file. - samples/download_avatar.py + skills/linkedin-avatar/SKILL.md + README section. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drops core/chrome_cookies.py (get_chrome_linkedin_cookies) and its macOS Keychain cookie decryption. AvatarScraper now authenticates with the library's existing cross-platform helpers (login_with_cookie via LI_AT, credentials, or manual login). Updates sample, skill, and README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a LinkedIn avatar downloader with password-free Chrome-session auth (macOS)
This adds a small, self-contained way to save a profile's headshot as a real image file, plus a cookie-based auth path that reuses your already-logged-in Chrome — no LinkedIn password stored or typed.
Why
Every "obvious" way to grab a LinkedIn avatar is blocked:
<img>src and download itfetch()the bytes in-page<canvas>→toDataURL()SecurityError: tainted canvasThe one thing that works: element-screenshot the rendered
<img>with Playwright. This PR packages that.What's included
core/chrome_cookies.py—get_chrome_linkedin_cookies(): reads the local Chrome cookie DB (copies the WAL so it works while Chrome is open) and decryptsli_atet al. with theChrome Safe Storagekey from the macOS Keychain. Returns Playwright-ready cookie dicts. macOS only (cleanly documented).scrapers/avatar.py—AvatarScraper(page).download(url, out_path): navigates a profile, picks the largest squaremedia.licdn.comimage (the photo, not the cover banner or a thumbnail), and screenshots it at 2x. Returns{saved, path, rendered};saved: Falsefor ghost/no-photo profiles.core/__init__.py,scrapers/__init__.py, and the top-level package.samples/download_avatar.py— one-file CLI example.skills/linkedin-avatar/SKILL.md+ a README section.Usage
Notes
AvatarScraperitself works with any authenticated context (Linux/Windows users can supply cookies their own way).