From 5ca4ef3f5a2ee297065f0bbf7f55874fd008fe78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Sun, 2 Aug 2020 14:32:50 +0200 Subject: [PATCH] add more scripts. --- adddbmetadata.sh | 9 +++++++++ renamedb.sh | 6 ++++++ youtube-dl-script.sh | 41 +++++++++++++++++++++++++++++++++++++++++ youtube-dl.sh | 7 +++++++ 4 files changed, 63 insertions(+) create mode 100755 adddbmetadata.sh create mode 100755 renamedb.sh create mode 100755 youtube-dl-script.sh create mode 100755 youtube-dl.sh diff --git a/adddbmetadata.sh b/adddbmetadata.sh new file mode 100755 index 0000000..7d0a4b3 --- /dev/null +++ b/adddbmetadata.sh @@ -0,0 +1,9 @@ +#!/bin/bash +mkdir edited +for file in *.mkv; do + ffmpeg -i $file -map 0 \ + -metadata:s:a:0 language=eng -metadata:s:a:0 title="English" \ + -metadata:s:a:1 language=jpn -metadata:s:a:1 title="Japanese" \ + -c copy ./edited/$file +done + diff --git a/renamedb.sh b/renamedb.sh new file mode 100755 index 0000000..6213411 --- /dev/null +++ b/renamedb.sh @@ -0,0 +1,6 @@ +#!/bin/bash +prename 's/ /\./g' * +prename "s/'//g" * +prename "s/\!//g" * +prename 's/Dragon\.Ball\.-\.//g' * +prename "s/\.-\./_/g" * diff --git a/youtube-dl-script.sh b/youtube-dl-script.sh new file mode 100755 index 0000000..4e3541b --- /dev/null +++ b/youtube-dl-script.sh @@ -0,0 +1,41 @@ +#!/run/current-system/sw/bin/bash + +export DEFAULT_PLAYLIST_END=10 + +download_single() { + youtube-dl "$1" \ + --download-archive "~/Videos/YT/history.conf" \ + --prefer-free-formats\ + --write-description \ + --output "~/Videos/YT/%(uploader)s/%(upload_date)s - %(title)s.%(ext)s" +} +export -f download_single + +download() { + youtube-dl "$1" \ + --download-archive "~/Videos/YT/history.conf" \ + --prefer-free-formats\ + --playlist-end $2 \ + --write-description \ + --output "~/Videos/YT/%(uploader)s/%(upload_date)s - %(title)s.%(ext)s" +} +export -f download + +download_user() { + download "https://www.youtube.com/user/$1" ${2-$DEFAULT_PLAYLIST_END} +} +export -f download_user + +download_channel() { + download "https://www.youtube.com/channel/$1" ${2-DEFAULT_PLAYLIST_END} +} +export -f download_channel + +download_playlist() { + download "https://www.youtube.com/playlist?list=$1" ${2-DEFAULT_PLAYLIST_END} +} +export -f download_playlist + + + + diff --git a/youtube-dl.sh b/youtube-dl.sh new file mode 100755 index 0000000..8dae724 --- /dev/null +++ b/youtube-dl.sh @@ -0,0 +1,7 @@ +#!/run/current-system/sw/bin/bash + +youtube-dl "$1" \ + --download-archive "~/Videos/YT/history.conf" \ + --prefer-free-formats\ + --write-description \ + --output "~/Videos/YT/%(uploader)s/%(upload_date)s - %(title)s.%(ext)s"