tomashco / payload-instagram-plugin

This plugin allows you to use an instagram connected feed as content to be shown inside payload blog.
https://www.npmjs.com/package/payload-instagram-plugin
MIT License
5 stars 1 forks source link

Fix 'URL signature expired' on media, after a few days #1

Closed tomashco closed 2 months ago

tomashco commented 3 months ago

After a few days (4/5 noone seems to know the correct timespan), the image url retrieved with the api seems to expire, returning error 403 and 'URL signature expired'.

A cron job should be inserted in order to verify that the content (image or video) is still valid, otherwise substitute it with a new one.

more info can be found here: 'URL signature expired'

tomashco commented 2 months ago

Added a logic in the beforeRead hook, so everytime a content is displayed, a test on the goodness of the url is made. If it fails, the media url is fetched again and updated inside the collection. Currently working from version 0.0.10