-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[TikTokBridge] Use oEmbed for video metadata #4514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fetches oEmbed-formatted metadata for videos through the TikTok API to provide post titles, thumbnails, and authors. This hasn't yet been tested, so it's possible it doesn't work.
Pull request artifacts
last change: Sunday 2025-05-04 15:54:49 |
I've been running with this patch on my instance for a little while, and it looks like the TikTok oEmbed API actually occasionally returns 400 bad request, even with a valid URL. I'll investigate this a bit more, and try to implement a fix (I figure I can probably just check if the request is successful and, in the case that it is not, just retry a few times, since it seems to work fine after re-sending the request). Here's the error output if anyone's interested.
|
ok cool |
The non-www URL resulted in a 301 redirect to the www URL, so this just skips that redirect, improving performance a bit and hopefully helping with the 400 errors.
If an OEmbed request fails, retry a few times, waiting a bit in between each retry. This should fix the problem for the most part, since I think the problem was related to some sort of rate limit (it isn't mentioned in the docs, but it seems to only happen when sending large quantities of sequential requests).
I added some retry logic, and it seems to be working pretty consistently now (I wrote that patch about a week ago, and I don't think it's happened since - my RSS aggregator is fetching 6 TikTok feeds every ~15 minutes, so it was happening about once every 1.5 days before). |
Fetches oEmbed-formatted metadata for videos through the TikTok API to provide post titles, thumbnails, and authors. I'm not caching JSON responses so it has the potential to be a bit slow in theory, but in my testing this doesn't appear to cause any noticeable performance issues (I'm not super familiar with PHP so I'm not entirely sure how to add this if it is needed).