From b1a62bf651844701eefc64e15660760b666e2ef1 Mon Sep 17 00:00:00 2001 From: Flummi Date: Wed, 4 Nov 2020 15:19:34 +0100 Subject: [PATCH] hopefully fixed youtube-dlc by updating to the latest version and specifying mp4 as the hardcoded extension for youtube, removing youtube-dl not working line from how.html, adding some css to the item page to make it more amoled! --- public/s/css/f0ck-custom.css | 31 ++++++++++++++++++++++++++++--- src/inc/trigger/parser.mjs | 8 ++++---- views/how.html | 4 +--- views/item.html | 4 ++-- 4 files changed, 35 insertions(+), 12 deletions(-) diff --git a/public/s/css/f0ck-custom.css b/public/s/css/f0ck-custom.css index 1d75550..3b9e73d 100644 --- a/public/s/css/f0ck-custom.css +++ b/public/s/css/f0ck-custom.css @@ -117,9 +117,9 @@ a { align-self: center; } -a.id-link { +/*a.id-link { padding-right: 5; -} +}*/ div#my-video { max-height: unset; @@ -230,4 +230,29 @@ img#biohaz { span.badge.badge-dark { margin-right: 5px; -} \ No newline at end of file +} + +.badge-dark, #themeselector { + color: #fff; + background-color: #000000; + border-radius: 0; + border-left: 1px solid #262626; + border-right: 1px solid #262626; + border-top: 1px solid #000; + border-bottom: 1px solid #262626; +} +.video-js .vjs-control-bar { + background-color: #1b1b1b !important; +} + +a#rndbtn { + color: #fff; + background-color: #1b1b1b; + border-radius: 0; + border-left: 1px solid #262626; + border-right: 1px solid #262626; + border-top: 1px solid #262626; + border-bottom: 1px solid #262626; + padding: 0px 5px 0px 5px; + text-decoration: none; +} diff --git a/src/inc/trigger/parser.mjs b/src/inc/trigger/parser.mjs index ae7125b..c77065d 100644 --- a/src/inc/trigger/parser.mjs +++ b/src/inc/trigger/parser.mjs @@ -43,16 +43,16 @@ export default async bot => { const uuid = (await sql.query("select left(uuid(), 8) as uuid"))[0].uuid; // read metadata - const meta = JSON.parse((await exec(`youtube-dl --skip-download --dump-json "${link}"`)).stdout); + const meta = JSON.parse((await exec(`youtube-dlc --skip-download --dump-json "${link}"`)).stdout); - const filename = `${uuid}.${meta.ext}`; + const filename = `${uuid}.mp4`; e.reply(`downloading ${filename}...`); // download data const start = new Date(); const maxfilesize = getLevel(e.user).level > 50 ? cfg.main.maxfilesize * 2.5 : cfg.main.maxfilesize; - const source = (await exec(`youtube-dl "${link}" --max-filesize ${maxfilesize} -o ./tmp/${filename}`)).stdout.trim(); + const source = (await exec(`youtube-dlc "${link}" -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" --max-filesize ${maxfilesize} -o ./tmp/${filename}`)).stdout.trim(); if(source.match(/larger than/)) return e.reply("too large lol"); const end = ~~((new Date() - start) / 1e3); @@ -80,7 +80,7 @@ export default async bot => { ); // generate thumbnail - let thumb_orig = (await exec(`youtube-dl --get-thumbnail "${link}"`)).stdout.trim(); + let thumb_orig = (await exec(`youtube-dlc --get-thumbnail "${link}"`)).stdout.trim(); if(!thumb_orig.startsWith("http")) { if(mime.startsWith("image") && mime !== "image/gif") thumb_orig = `./public/b/${filename}`; diff --git a/views/how.html b/views/how.html index 8b56c75..c76e696 100644 --- a/views/how.html +++ b/views/how.html @@ -27,9 +27,7 @@

f0ck will f0ck any media link posted in the channel ending with: jpg|gif|png|webm|mp3|mp4|ogg|flac

If you don't want f0ck to f0ck it put !ignore behind your link. Example: https://retard-journal.com/stupidshit.png !ignore -

f0ck will only f0ck media links with the maximum size of 30MB for cool people 80MB

-

YouTube Links are currently not working, if you really want to f0ck them, you gotta download it yourself and - reupload somewhere until this is fixed

+

f0ck will only f0ck media links with the maximum size of 40MB for cool people ??MB

{{include main/footer}} diff --git a/views/item.html b/views/item.html index 033149f..c08e442 100644 --- a/views/item.html +++ b/views/item.html @@ -1,7 +1,7 @@ {{include main/header}}