2 Commits
Author SHA1 Message Date
litruv 72b749e933 Bump cinny to fetch the TikTok oEmbed through the main process.
Build / prepare (push) Successful in 15s
Build / build-windows (push) Successful in 4m28s
Build / build-linux (push) Successful in 2m38s
Build / finalize-release (push) Successful in 4s
2026-10-15 23:13:14 +11:00
litruv a2a2fe39e0 Fetch the TikTok oEmbed in the main process with a browser user agent. 2026-10-15 23:13:10 +11:00
3 changed files with 28 additions and 1 deletions
+1 -1
Submodule cinny updated: a4e96dd01f...a6fac786b3
+22
View File
@@ -1475,6 +1475,28 @@ ipcMain.handle('get-youtube-stream', async (event, url) => {
return getYouTubeStream(url);
});
// TikTok oEmbed. TikTok blocks the Electron user agent, so this runs in the main
// process with a plain browser UA and is not subject to CORS.
ipcMain.handle('tiktok:oembed', async (event, url) => {
try {
const response = await fetch(`https://www.tiktok.com/oembed?url=${encodeURIComponent(url)}`, {
headers: {
'User-Agent':
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
Accept: 'application/json',
},
});
if (!response.ok) {
console.warn('[tiktok:oembed]', response.status, url);
return null;
}
return await response.json();
} catch (error) {
console.warn('[tiktok:oembed] failed:', error?.message || error);
return null;
}
});
// Background sync stubs (desktop doesn't need it)
ipcMain.handle('start-background-sync', async () => {
return { success: true };
+5
View File
@@ -124,6 +124,11 @@ contextBridge.exposeInMainWorld('electron', {
youtube: {
getStream: (url) => ipcRenderer.invoke('get-youtube-stream', url)
},
// TikTok oEmbed (fetched in the main process)
tiktok: {
getOEmbed: (url) => ipcRenderer.invoke('tiktok:oembed', url)
},
// Background sync (stubs for desktop)
sync: {