chore: update Angular cache and TypeScript build info files
This commit is contained in:
+21
-1
@@ -60,7 +60,27 @@ async function scrapeRumbleVideo(videoId) {
|
||||
const duration = durationText ? parseInt(durationText) : 0;
|
||||
const uploadedDate = $('meta[property="article:published_time"]').attr('content') || '';
|
||||
const description = $('meta[property="og:description"]').attr('content') || '';
|
||||
return { videoId, title: title || 'Untitled Video', thumbnail, uploaderName: uploaderName || 'Unknown Uploader', views, duration, uploadedDate, description, url: `https://rumble.com/${videoId}`, type: 'video' };
|
||||
// Try to extract the official embed URL
|
||||
let embedUrl = $('meta[property="og:video"], meta[name="twitter:player"]').attr('content') || '';
|
||||
if (!embedUrl) {
|
||||
const iframeSrc = $('iframe[src*="/embed/"]').attr('src') || '';
|
||||
embedUrl = iframeSrc || '';
|
||||
}
|
||||
// Normalize protocol-less URLs
|
||||
if (embedUrl && embedUrl.startsWith('//')) embedUrl = 'https:' + embedUrl;
|
||||
// Detect canonical URL to extract stable ID
|
||||
const canonicalUrl = $('link[rel="canonical"]').attr('href') || $('meta[property="og:url"]').attr('content') || '';
|
||||
// Normalize/derive the stable Rumble ID (e.g., v464efu)
|
||||
let stableId = videoId;
|
||||
const mEmbed = /\/embed\/(v[0-9A-Za-z]+)/.exec(embedUrl || '');
|
||||
const mCanon = /\/(v[0-9A-Za-z]+)(?:[\-./]|$)/.exec(canonicalUrl || '');
|
||||
if (mEmbed && mEmbed[1]) stableId = mEmbed[1];
|
||||
else if (mCanon && mCanon[1]) stableId = mCanon[1];
|
||||
// If embedUrl is a page URL, convert to embed path as a fallback
|
||||
if (!/\/embed\//.test(embedUrl)) {
|
||||
embedUrl = `https://rumble.com/embed/${stableId}/?autoplay=2&muted=1`;
|
||||
}
|
||||
return { videoId: stableId, title: title || 'Untitled Video', thumbnail, uploaderName: uploaderName || 'Unknown Uploader', views, duration, uploadedDate, description, url: `https://rumble.com/${stableId}`, embedUrl, type: 'video' };
|
||||
} catch (e) {
|
||||
console.error('scrapeRumbleVideo error:', e.message);
|
||||
return { videoId, error: 'Scraping failed' };
|
||||
|
||||
Reference in New Issue
Block a user