Update bt4g.js
Browse files
bt4g.js
CHANGED
|
@@ -94,10 +94,20 @@ async function fetchRSSFeeds(searchQuery) {
|
|
| 94 |
});
|
| 95 |
}
|
| 96 |
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
} catch (error) {
|
| 99 |
console.error('❌ Error fetching from BT4G:', error);
|
| 100 |
-
return [];
|
| 101 |
}
|
| 102 |
}
|
| 103 |
|
|
|
|
| 94 |
});
|
| 95 |
}
|
| 96 |
|
| 97 |
+
// Return results formatted for Stremio catalog
|
| 98 |
+
return {
|
| 99 |
+
metas: validStreams.map(result => ({
|
| 100 |
+
id: result.infoHash, // Use the infoHash as the unique identifier
|
| 101 |
+
name: result.websiteTitle,
|
| 102 |
+
poster: '', // Add poster if available
|
| 103 |
+
year: '', // Add year if available
|
| 104 |
+
description: result.websiteTitle, // Use title as description or extract a proper one
|
| 105 |
+
genres: result.categories || [], // Use categories from the result
|
| 106 |
+
}))
|
| 107 |
+
};
|
| 108 |
} catch (error) {
|
| 109 |
console.error('❌ Error fetching from BT4G:', error);
|
| 110 |
+
return { metas: [] }; // Return empty results on error
|
| 111 |
}
|
| 112 |
}
|
| 113 |
|