youtube playlist download
This commit is contained in:
parent
28296003af
commit
f306396c1a
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
function getInsertA {
|
||||
git log --author="$1" --no-merges --oneline --shortstat | grep "insertions" | cut -d " " -f5 | sed '/^$/d' | paste -sd+ | bc
|
||||
}
|
||||
|
||||
function getDeleteA {
|
||||
git log --author="$1" --no-merges --oneline --shortstat | grep "deletions" | cut -d " " -f7 | sed '/^$/d' | paste -sd+ | bc
|
||||
}
|
||||
|
||||
#author list
|
||||
author=$(git log --format="%aN" | sort | uniq)
|
||||
insertsALL=$(git log --no-merges --oneline --shortstat | grep "insertions" | cut -d " " -f5 | sed '/^$/d' | paste -sd+ | bc)
|
||||
deletesALL=$(git log --no-merges --oneline --shortstat | grep "deletions" | cut -d " " -f7 | sed '/^$/d' | paste -sd+ | bc)
|
||||
bothALL=$(($insertsALL + $deletesALL))
|
||||
|
||||
for user in $author; do
|
||||
ins=$(getInsertA $user)
|
||||
del=$(getDeleteA $user)
|
||||
both=$(($ins + $del))
|
||||
insp=$(python -c "print (int(($ins./$insertsALL)*1000)/10.)")
|
||||
delp=$(python -c "print (int(($del./$deletesALL)*1000)/10.)")
|
||||
bothp=$(python -c "print (int(($both./$bothALL)*1000)/10.)")
|
||||
echo "$user: $ins ($insp%) insertions, $del ($delp%) deleteions, $both ($bothp%) both"
|
||||
done
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
git ls-files | xargs -n1 git blame --line-porcelain | sed -n 's/^author //p' | sort -f | uniq -ic | sort -nr
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
#$1 = game data dir
|
||||
#extracts ogg files from .resource files
|
||||
dir="~/tmp/extract/"
|
||||
#get dependency
|
||||
mkdir -fp "$dir"
|
||||
cd "$dir"
|
||||
git clone https://github.com/HearthSim/python-fsb5.git python-fsb5
|
||||
cd python-fsb5/
|
||||
for file in "$1/*resource"; do
|
||||
./extract "$file"
|
||||
done
|
||||
nemo "$dir"
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
playlist=""
|
||||
folder="download/$playlist"
|
||||
format="bestaudio"
|
||||
youtube-dl -f "$format" --min-filesize 1k --restrict-filenames --no-overwrites --no-mtime --add-metadata -o "${folder}-%(playlist_title)s/raw/%(playlist_index)03d%(title)s-%(id)s.%(ext)s" "https://youtube.com/playlist?list=$playlist"
|
||||
#not supported: --embed-thumbnail --xattrs
|
||||
#debug: --playlist-end 3
|
||||
|
||||
#convert to ogg
|
||||
cd $folder*
|
||||
mkdir -p "ogg/raw/"
|
||||
pwd
|
||||
find "raw/" -type f -exec bash -c "~/git/ffmpeg/ffmpeg -i {} ogg/{}.ogg" \;
|
||||
mv ogg/raw/* "ogg/"
|
||||
rm -r "ogg/raw/"
|
||||
|
Loading…
Reference in New Issue