chore: update Angular cache and TypeScript build info files
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Minimal Dailymotion provider handler
|
||||
*/
|
||||
const handler = {
|
||||
id: 'dm',
|
||||
label: 'Dailymotion',
|
||||
/**
|
||||
* @param {string} q
|
||||
* @param {{ limit: number, page?: number }} opts
|
||||
* @returns {Promise<Array<any>>}
|
||||
*/
|
||||
async search(q, opts) {
|
||||
const { limit = 10 } = opts;
|
||||
try {
|
||||
const response = await fetch(
|
||||
`https://api.dailymotion.com/videos?` +
|
||||
new URLSearchParams({
|
||||
search: q,
|
||||
limit: Math.min(limit, 100).toString(),
|
||||
sort: 'relevance'
|
||||
})
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Dailymotion API error: ${response.status}`);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
return (data.list || []).map(item => ({
|
||||
title: item.title,
|
||||
id: item.id,
|
||||
url: `https://www.dailymotion.com/video/${item.id}`,
|
||||
thumbnail: item.thumbnail_360_url || item.thumbnail_180_url || item.thumbnail_url,
|
||||
uploaderName: item.owner.screenname || item.owner.username,
|
||||
type: 'video'
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error('Dailymotion search error:', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
};
|
||||
export default handler;
|
||||
Reference in New Issue
Block a user