diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-17 22:03:10 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-17 22:03:10 +0200 |
| commit | 5f53f241189af3fceb26395af383809cd4fa3bf0 (patch) | |
| tree | 4ffabc358ec85ed1da425f72e1357e80f340b2c1 /internal/platforms/linkedin/preview.go | |
| parent | a8cb28d2257cff652fc4f8a9768b66b9d69fd68a (diff) | |
fix: improve LinkedIn API posting and authenticationv1.2.4
- Add token validation before using cached credentials to prevent stale token issues
- Add proper error handling for image upload initialization with helpful 426 messages
- Skip data URI images instead of attempting to download them
- Update default LinkedIn API version to 202601 (January 2026) - latest active version
- Fix re-authentication flow for expired tokens
Amp-Thread-ID: https://ampcode.com/threads/T-019c6d28-4526-7738-b593-9bd584baa478
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'internal/platforms/linkedin/preview.go')
| -rw-r--r-- | internal/platforms/linkedin/preview.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/platforms/linkedin/preview.go b/internal/platforms/linkedin/preview.go index a583c7a..125a4bf 100644 --- a/internal/platforms/linkedin/preview.go +++ b/internal/platforms/linkedin/preview.go @@ -73,6 +73,12 @@ func (p preview) Thumbnail() (string, bool) { } func (p preview) DownloadImage(destPath string) (string, error) { + // Skip data URIs - they can't be downloaded and don't provide meaningful images + if u, err := url.Parse(p.thumbnailURL); err == nil && u.Scheme == "data" { + colour.Infoln("Skipping data URI image, using article metadata instead") + return "", nil + } + if err := oi.EnsureDir(destPath); err != nil { return "", err } |
