Added parent-child relations to network, showing parent network in sidebar. Added Burning Angel using Gamma API.
This commit is contained in:
12
src/media.js
12
src/media.js
@@ -43,7 +43,7 @@ async function createThumbnail(buffer) {
|
||||
function pluckItems(items, specifiedLimit) {
|
||||
const limit = specifiedLimit || config.media.limit;
|
||||
|
||||
if (items.length <= limit) return items;
|
||||
if (!items || items.length <= limit) return items;
|
||||
|
||||
const plucked = [1]
|
||||
.concat(
|
||||
@@ -73,7 +73,9 @@ async function getEntropy(buffer) {
|
||||
}
|
||||
|
||||
async function extractItem(source) {
|
||||
const res = await bhttp.get(source.src);
|
||||
const res = await bhttp.get(source.src, {
|
||||
responseTimeout: 10000,
|
||||
});
|
||||
|
||||
if (res.statusCode === 200) {
|
||||
const { q } = ex(res.body.toString());
|
||||
@@ -114,7 +116,9 @@ async function fetchItem(source, index, existingItemsBySource, domain, role, att
|
||||
|
||||
logger.verbose(`Fetching media item from ${source.src || source}`);
|
||||
|
||||
const res = await bhttp.get(source.src || source);
|
||||
const res = await bhttp.get(source.src || source, {
|
||||
responseTimeout: 10000,
|
||||
});
|
||||
|
||||
if (res.statusCode === 200) {
|
||||
const { pathname } = new URL(source.src || source);
|
||||
@@ -199,6 +203,8 @@ async function saveItems(items, domain, role) {
|
||||
logger.error(`Failed to store ${domain} ${role} from ${item.source}: ${error.message}`);
|
||||
return null;
|
||||
}
|
||||
}, {
|
||||
concurrency: 20,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user