Browse Source

Create program

master
Mew Mew 1 year ago
parent
commit
1e9532c928
2 changed files with 8 additions and 0 deletions
  1. +1
    -0
      .gitignore
  2. +7
    -0
      nightcorify.sh

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
*.mp4

+ 7
- 0
nightcorify.sh View File

@@ -0,0 +1,7 @@
jobid=$RANDOM$RANDOM
curl "https://konachan.net/post.xml?limit=1&tags=rating%3As&page=$RANDOM" 2>/dev/null | sed -e '1,2d' | sed '2d' | sed -e 's/.*file_url=\"\(.*\)\" frames=\"\" frames_pending.*/\1/' | xargs curl > /tmp/$jobid-imagedl.png 2>/dev/null
youtube-dl -x "ytsearch:$1" -o "/tmp/$jobid-download.%(ext)s" -f m4a
ffmpeg -y -i /tmp/$jobid-imagedl.png -vf scale=1920:1080 /tmp/$jobid-imagescaled.png
ffmpeg -y -i /tmp/$jobid-download.m4a -filter:a "asetrate=55125" -map 0:a -shortest -strict -2 "/tmp/$jobid-nightcore.m4a"
ffmpeg -y -i /tmp/$jobid-imagescaled.png -i /tmp/$jobid-nightcore.m4a -vf "drawtext=text=$1:fontsize=100:x=(w-tw)/2:y=(h-3.5*th)" -map 0:v -map 1:a -strict -2 "$1-nightcore.mp4"
rm /tmp/$jobid-imagedl.png /tmp/$jobid-imagescaled.png /tmp/$jobid-download.m4a /tmp/$jobid-nightcore.m4a

Loading…
Cancel
Save