Added support for various tube and social media sites via youtube-dl.
This commit is contained in:
+2
-2
@@ -4,7 +4,7 @@ const config = require('config');
|
||||
const bhttp = require('bhttp');
|
||||
const blake2 = require('blake2');
|
||||
|
||||
async function fetchItem(url, attempt, post) {
|
||||
async function fetchItem(url, attempt, post, host) {
|
||||
async function retry(error) {
|
||||
console.log('\x1b[31m%s\x1b[0m', `Failed to fetch '${url}': ${error.message} (${post ? post.permalink : 'no post'})`);
|
||||
|
||||
@@ -24,7 +24,7 @@ async function fetchItem(url, attempt, post) {
|
||||
throw new Error(`Response not OK for '${url}', HTTP code '${res.status}'`);
|
||||
}
|
||||
|
||||
console.log(`Fetched '${url}' (${post ? post.permalink : 'no post'})`);
|
||||
console.log(`Fetched '${host.url}' (${post ? post.permalink : 'no post'})`);
|
||||
|
||||
const hash = blake2.createHash('blake2b', { digestLength: 24 });
|
||||
hash.update(res.body);
|
||||
|
||||
Reference in New Issue
Block a user