youtube thumbnail generation, thanks Ruben

This commit is contained in:
Wouter Groeneveld 2021-06-15 12:25:18 +02:00
parent f7dc377b53
commit 473e17b037
4 changed files with 11 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "jam-my-stack", "name": "jam-my-stack",
"version": "1.0.18", "version": "1.0.19",
"repository": { "repository": {
"url": "https://github.com/wgroeneveld/jam-my-stack", "url": "https://github.com/wgroeneveld/jam-my-stack",
"type": "git" "type": "git"

View File

@ -2,6 +2,7 @@ const { parseMastoFeed } = require('./mastodon/feed-parser')
const { widgetify } = require('./goodreads/widgetify.js') const { widgetify } = require('./goodreads/widgetify.js')
const { buildIndex } = require('./lunr/index-builder.js') const { buildIndex } = require('./lunr/index-builder.js')
const { howlong } = require('./howlongtobeat/howlong.js') const { howlong } = require('./howlongtobeat/howlong.js')
const { thumbify } = require('./youtube/thumbify.js')
const { getWebmentions } = require('./webmention/get.js') const { getWebmentions } = require('./webmention/get.js')
const { sendWebmentions } = require('./webmention/send.js') const { sendWebmentions } = require('./webmention/send.js')
@ -19,6 +20,9 @@ module.exports = {
howlongtobeat: { howlongtobeat: {
howlong: howlong howlong: howlong
}, },
youtube: {
thumbify: thumbify
},
webmention: { webmention: {
getWebmentions: getWebmentions, getWebmentions: getWebmentions,
send: sendWebmentions send: sendWebmentions

View File

@ -87,5 +87,5 @@ async function run(options) {
} }
module.exports = { module.exports = {
download: run thumbify: run
} }

View File

@ -1,4 +1,4 @@
const { download } = require('../../src/youtube/thumbify.js') const { thumbify } = require('../../src/youtube/thumbify.js')
const fs = require('fs'); const fs = require('fs');
const fsp = require('fs').promises; const fsp = require('fs').promises;
const { rmdir } = require('./../utils') const { rmdir } = require('./../utils')
@ -27,7 +27,7 @@ it doesn't contain a link, sorry...
` `
await fsp.writeFile(`${dumpdir}/post.md`, md, 'utf-8') await fsp.writeFile(`${dumpdir}/post.md`, md, 'utf-8')
await download({ await thumbify({
postDir: dumpdir, postDir: dumpdir,
downloadDir: dumpdir, downloadDir: dumpdir,
overlayImg: `${__dirname}/play.png` overlayImg: `${__dirname}/play.png`
@ -53,7 +53,7 @@ cool vid eh?
` `
await fsp.writeFile(`${dumpdir}/post.md`, md, 'utf-8') await fsp.writeFile(`${dumpdir}/post.md`, md, 'utf-8')
await download({ await thumbify({
postDir: dumpdir, postDir: dumpdir,
downloadDir: dumpdir, downloadDir: dumpdir,
overlayImg: `${__dirname}/play.png` overlayImg: `${__dirname}/play.png`
@ -79,7 +79,7 @@ cool vid eh?
` `
await fsp.writeFile(`${dumpdir}/post.md`, md, 'utf-8') await fsp.writeFile(`${dumpdir}/post.md`, md, 'utf-8')
await download({ await thumbify({
postDir: dumpdir, postDir: dumpdir,
downloadDir: dumpdir, downloadDir: dumpdir,
overlayImg: `${__dirname}/play.png` overlayImg: `${__dirname}/play.png`
@ -101,7 +101,7 @@ cool vid eh?
` `
await fsp.writeFile(`${dumpdir}/post.md`, md, 'utf-8') await fsp.writeFile(`${dumpdir}/post.md`, md, 'utf-8')
await download({ await thumbify({
postDir: dumpdir, postDir: dumpdir,
downloadDir: dumpdir, downloadDir: dumpdir,
overlayImg: `${__dirname}/play.png` overlayImg: `${__dirname}/play.png`