summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoragnotek2016-01-24 03:28:14 +0100
committeragnotek2016-01-24 03:28:14 +0100
commiteea4206d9300918be1929e7ba023b14004c6df0b (patch)
treeb22ea530a5ab3e3f8dd5b8d3b34c73441caafd31
parent97f06f08225d9f1b6ef2ce42d227719fa67ccd98 (diff)
downloadaur-eea4206d9300918be1929e7ba023b14004c6df0b.tar.gz
New Version 9.0
-rwxr-xr-x.SRCINFO6
-rwxr-xr-xPKGBUILD4
-rwxr-xr-xYTPLMP4199
3 files changed, 134 insertions, 75 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ce45000a3a5a..42a7c9c7d7ed 100755
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -2,7 +2,7 @@
# Mon Oct 19 23:51:08 UTC 2015
pkgbase = ytplmp4
pkgdesc = YTPLMP4 - YouTube Playlist to MP3. Download single songs or playlists from Youtube and Soundcloud.
- pkgver = 8.2
+ pkgver = 9.0
pkgrel = 1
url = http://youtube.com/
install = ytplmp4.install
@@ -21,10 +21,10 @@ pkgbase = ytplmp4
depends = lame
depends = sox
options = !strip
- source = https://dl.dropboxusercontent.com/u/9839330/ytplmp4/YTPLMP4-8.2.tar.gz
+ source = https://dl.dropboxusercontent.com/u/9839330/ytplmp4/YTPLMP4-9.0.tar.gz
source = ytplmp4.install
source = ytplmp4.desktop
- md5sums = 3a7ac549244de4d89bac4738f979d69d
+ md5sums = 93489e86f6cdee18b99d877bd55a9a03
md5sums = 9347b695d57d40c8756fcb593f28158c
md5sums = ceae8591b64a369118d4928042cfb403
diff --git a/PKGBUILD b/PKGBUILD
index 3d9dc8065109..fc340c2b9fce 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: agnotek <agnostic [dot] sn [at] gmail [dot] com>
pkgname=ytplmp4
-pkgver=8.2
+pkgver=9.0
pkgrel=1
pkgdesc="YTPLMP4 - YouTube Playlist to MP3. Download single songs or playlists from Youtube and Soundcloud."
arch=('any')
@@ -11,7 +11,7 @@ makedepends=('')
depends=('id3v2' 'python2-eyed3' 'youtube-dl' 'yad' 'curl' 'feh' 'recode' 'smplayer' 'ffmpeg' 'perl-image-exiftool' 'lame' 'sox')
options=('!strip')
install="ytplmp4.install"
-md5sums=('3a7ac549244de4d89bac4738f979d69d'
+md5sums=('93489e86f6cdee18b99d877bd55a9a03'
'9347b695d57d40c8756fcb593f28158c'
'ceae8591b64a369118d4928042cfb403')
diff --git a/YTPLMP4 b/YTPLMP4
index d15eda52a480..a8182381f7b0 100755
--- a/YTPLMP4
+++ b/YTPLMP4
@@ -11,19 +11,18 @@
# no copyright, just copyleft for my work
#
#set -x
-ytplver=8.2
-confver=1
-
-### TODO ChangeLog ###
-chngvar=('Changelog YTPLMP3 - 20160113<br>')
+ytplver=9.0
+confver=2
+### ChangeLog ###
+chngvar=('Changelog YTPLMP3 - 20160124<br>')
chngvar+=('YTPLMP3 Version: '\"$ytplver\"'<br>')
chngvar+=('----------------------------------<br>')
#chngvar+=('Youtube: webm format is now being supported<br>')
#chngvar+=('Soundcloud: Playlist from to is working for Sets<br>')
-chngvar+=('Fixes: Bugfixes Downloadlist<br>')
-chngvar+=('Design: Show names instead of links<br>')
-#chngvar+=('Drag & Drop for addtional links<br>')
-#chngvar+=('various other fixes<br>')
+#chngvar+=('Fixes: Bugfixes Downloadlist<br>')
+chngvar+=('Design: redesigned Output-Window<br>')
+chngvar+=('Converting of all files before editing id3 info<br>')
+chngvar+=('Ability to save Files in Directories named after their Genre<br>')
#chngvar+=('<br>')
chngdate=$(echo -e "${chngvar[0]}" | cut -d'-' -f2 | cut -d'<' -f1 | sed 's/\\n/ /g' | sed 's/ *$//' | sed 's/^ *//' | sed 's/ */\ /g')
@@ -34,6 +33,7 @@ tmpdir=/tmp/ytpld$(date +%d%m%y)
tmpsnd=/tmp/scpld$(date +%d%m%y)
tmppic=$tmpdir/pics
tmpjsn=$tmpdir/json
+tmpvid=$tmpdir/vids
tmptitle=$HOME/yttitle.txt
tmpdelet=$HOME/ytdelet.txt
tmppllst=$HOME/ytlist.txt
@@ -59,6 +59,7 @@ mkdir $tmpdir
mkdir $tmpsnd
mkdir $tmppic
mkdir $tmpjsn
+mkdir $tmpvid
touch $tmptitle
touch $tmpdelet
@@ -74,7 +75,7 @@ chgfile=$HOME/.local/share/YTPLMP3/changelog-ytplmp3.html
if [ -e $confile ]; then
source $confile
[ "$versconf" != "$confver" ] && { rm $confile; logdate=$(echo "`date +%Y-%m-%d`"); versconf=$confver; lastdir=$HOME; lastdat=$(echo "`date +%Y-%m-%d`"); \
- lasturl=""; lastnum="FALSE"; lastid3="TRUE"; preview="TRUE"; rdchnge=false; SndCloudID="95a4c0ef214f2a4a0852142807b54b35";}
+ lasturl=""; lastnum="FALSE"; lastid3="TRUE"; preview="TRUE"; genfldr="FALSE"; rdchnge=false; SndCloudID="95a4c0ef214f2a4a0852142807b54b35";}
else
touch $confile
versconf=$confver
@@ -85,6 +86,7 @@ else
lastnum="FALSE"
lastid3="TRUE"
preview="TRUE"
+ genfldr="FALSE"
rdchnge=false
SndCloudID="95a4c0ef214f2a4a0852142807b54b35"
fi
@@ -126,7 +128,7 @@ fi
### YAD -Dialogues ###
function desc_url(){
- descurl=$(wget --no-check-certificate -qO- "$1" | perl -l -0777 -ne 'print $1 if /<title.*?>\s*(.*?)(?: - youtube)?\s*<\/title/si' | sed "s/[&amp;]/&/g")
+ descurl=$(wget --no-check-certificate -qO- "$1" | perl -l -0777 -ne 'print $1 if /<title.*?>\s*(.*?)(?: - youtube)?\s*<\/title/si' | sed "s/[&amp;]/&/g" | sed "s/&quot;/\'/g")
}
function addmore_dlg(){
@@ -150,7 +152,6 @@ function addmore_dlg(){
addlnks+=("$rdline")
done <<< "$dlgmore"
fi
-# echo "Chars: ${#dlgmore}"
return
}
@@ -173,7 +174,8 @@ yad --plug=23 --tabnum=1 --form --separator="," \
--field="keep Video-Files:CHK" \
--field="edit ID3-Tag:CHK" \
--field="use Preview (only works in conjunction with edit ID3-Tag):CHK" \
- "$lastdir" "" "!$lasturl" "" "$lastnum" "FALSE" "$lastdat" "1!1..200" "0!0..200" "" "$lastid3" "$preview" &> /tmp/yttb1 2>/dev/null &
+ --field="create Directories for each Genre:CHK" \
+ "$lastdir" "" "!$lasturl" "" "$lastnum" "FALSE" "$lastdat" "1!1..200" "0!0..200" "" "$lastid3" "$preview" "$genfldr" &> /tmp/yttb1 2>/dev/null &
if [ "$availdll" = true ] ; then
yad --plug=23 --tabnum=5 --form --separator="," \
--text="Here are your saved Download-Links" \
@@ -276,11 +278,14 @@ if [ $procdllst = false ] ; then
echo "lastid3=$edid3t" >> $confile
preview=$(echo "$ytpl2mp3" | cut -d, -f12)
echo "preview=$preview" >> $confile
+ genfldr=$(echo "$ytpl2mp3" | cut -d, -f13)
+ echo "genfldr=$genfldr" >> $confile
echo "rdchnge=$chnglog" >> $confile
else
diruse="$lastdir"
edid3t="$lastid3"
preview="$preview"
+ genfldr="$genfldr"
dateup="$lastdat"
plstnm=1
plstto=0
@@ -341,7 +346,6 @@ if [ "$availdll" = true ] ; then
rm -f /tmp/yttb5
fi
-
### Counting links
multic=0
[ ${#addlnks[*]} -gt 0 ] && { multic=${#addlnks[*]}; multif=$(echo ${addlnks[@]} | sed 's/ /*/g'); }
@@ -354,7 +358,7 @@ case $usedllist in
if [ ${#addlnks[*]} -gt 0 ] ; then
if ! grep -Fxq "$yutlnk" "$dllistf" ; then
echo "$yutlnk" >> $dllistf
- yttitdll=$(wget --no-check-certificate -qO- "$yutlnk" | perl -l -0777 -ne 'print $1 if /<title.*?>\s*(.*?)(?: - youtube)?\s*<\/title/si' | sed "s/&amp;/\&/g" | sed "s/&#39;/\'/g")
+ yttitdll=$(wget --no-check-certificate -qO- "$yutlnk" | perl -l -0777 -ne 'print $1 if /<title.*?>\s*(.*?)(?: - youtube)?\s*<\/title/si' | sed "s/&amp;/\&/g" | sed "s/&#39;/\'/g" | sed "s/&quot;/\'/g")
echo "$yttitdll" >> $rdlistf
addnams+=(\'"$yttitdll"\')
fi
@@ -362,7 +366,7 @@ case $usedllist in
for item in ${addlnks[*]} ; do
if ! grep -Fxq "$item" "$dllistf" ; then
echo "$item" >> $dllistf
- yttitdll=$(wget --no-check-certificate -qO- "$item" | perl -l -0777 -ne 'print $1 if /<title.*?>\s*(.*?)(?: - youtube)?\s*<\/title/si' | sed "s/&amp;/\&/g" | sed "s/&#39;/\'/g")
+ yttitdll=$(wget --no-check-certificate -qO- "$item" | perl -l -0777 -ne 'print $1 if /<title.*?>\s*(.*?)(?: - youtube)?\s*<\/title/si' | sed "s/&amp;/\&/g" | sed "s/&#39;/\'/g" | sed "s/&quot;/\'/g")
echo "$yttitdll" >> $rdlistf
addnams+=(\'"$yttitdll"\')
fi
@@ -370,13 +374,11 @@ case $usedllist in
fi
;;
esac
-######
function get_filetype(){
tstfile="$1"
fleext=$(echo "$tstfile" | awk -F"." '{print $NF}')
deli=$(echo $fleext | wc -c)
-# echo -e "\n\n\nExtenstion:$fleext\nCutting: $deli\n\n\n"
}
function sox_file(){
@@ -413,13 +415,14 @@ function renid3tagfile(){
nufile=$( echo "$fle2ren/$art3di - $tit3di.mp3")
;;
esac
- echo -e "Org:$oldfile\nNeu:$nufile"
mv "$oldfile" "$nufile"
}
function getduration() {
-#TODO check for Sndcld and take duration of Tag "duration": ; cut last 3 digits to get seconds
durcomp=`exiftool "$1" | grep 'Duration' | cut -d':' -f2- | sed 's/ *$//' | sed 's/^ *//' | cut -d' ' -f1`
+ if [[ $durcomp == *[.]* ]] ; then
+ durcomp="0:03:00"
+ fi
durhour=$(echo $durcomp | cut -d':' -f1)
if [ $durhour -gt 0 ] ; then durhour=$(($durhour * 3600)) ; fi
durminu=$(echo $durcomp | cut -d':' -f2 | sed 's/^0//')
@@ -450,7 +453,6 @@ function newid3tags() {
getduration "$nufile"
i3info=$( echo "$i3info" | sed "s/[&]/&amp;/g")
[ -z "$id3gen" ] && dispgen="$lstgen" || dispgen="$id3gen!$lstgen"
-# [ -z "$tagge" ] && dispgen="$lstgen" || { sndgen=$(echo ${tagge[@]} | sed 's/ /!/g' | sed 's/_/ /g'); dispgen="$sndgen!$lstgen";}
newid3t="$(yad --form --width 250 --title="$ytpltitle" --center --window-icon="multimedia-player-symbolic" --timeout=$compdur --timeout-indicator=bottom \
--text="File:$i3info\nGenre: $id3gen\nDuration: $durcomp Bitrate: $mp3bitr" \
--separator="%" \
@@ -523,6 +525,9 @@ function settags() {
TRUE )
newid3tags sndcld
;;
+ FALSE )
+ gen3di="$id3gen"
+ ;;
esac
cntfile="${nufile:0:-4}.mp3"
cntfile=$(echo "$cntfile" | sed "s/[\"']//g")
@@ -538,7 +543,14 @@ function settags() {
echo "$ytinfo $prntgnr" >> $tmptitle
fi
sndcldcnt=$(($sndcldcnt+1));
- mv -n "$nufile" "$diruse/"
+ if [ -e "$nufile" ] ; then
+ if [ "$genfldr" == "TRUE" ] ; then
+ [ ! -d "$diruse/$gen3di/" ] && mkdir "$diruse/$gen3di/"
+ mv -n "$nufile" "$diruse/$gen3di/"
+ else
+ mv -n "$nufile" "$diruse/"
+ fi
+ fi
}
function downsong() { # Parse json for one song
@@ -569,17 +581,15 @@ function fromjsontomp3() { # use the json to download info and mp3
else
tagge+=(***_Soundcloud_Tags_above_***)
fi
-#echo -e "\n\nTaglist:${tagge[@]}\n#1:${tagge[0]}\n#2:${tagge[1]}\n#4:${tagge[3]}\n\n}"
rlsyear=$(echo "$songinfo" | grep '"created_at"' | cut -d'"' -f4 | cut -c1-4)
songpermalink=$(echo -e "$songinfo" | grep -m2 "permalink_url" | tail -n1 | cut -d '"' -f 4)
if [ -e "$filename" ]; then
echo "The song $filename has already been downloaded..." && $cont
else
- echo "# downloading from Soundcloud: ....." >&3;
echo "# ... Artist: $artist" >&3;
echo "# ... Title : $title" >&3;
- echo "# ... Genre: $genre" >&3;
+ echo "# ... Genre: $genre\n" >&3;
curl -# -L --user-agent 'Mozilla/5.0' -o "`echo -e "$filename"`" "$realsongurl"
wavtomp3 "$filename"
sox_file "$filename"
@@ -726,22 +736,22 @@ function sndclddl() {
echo "# Bad Soundcloud URL!" >&3;
return 1
elif [[ "$d1" == "groups" ]] ; then
- echo "# detected download type : All song of the group" >&3;
+ echo "# \nSoundcloud-Download: All song of the group" >&3;
downgroup "$soundurl"
elif [[ "$d2" == "likes" ]] ; then
- echo "# detected download type : All of one user's like" >&3;
+ echo "# \nSoundcloud-Download: All of one user's like" >&3;
downlike "$soundurl"
elif [[ "$d2" == "" ]] ; then
- echo "# detected download type : All of one user's songs" >&3;
+ echo "# \nSoundcloud-Download: All of one user's songs" >&3;
downallsongs "$soundurl"
elif [[ "$d2" == "sets" ]] && [[ "$d3" == "" ]] ; then
- echo "# detected download type : All of one user's sets" >&3;
+ echo "# \nSoundcloud-Download: All of one user's sets" >&3;
downallsets "$soundurl"
elif [[ "$d2" == "sets" ]] ; then
- echo "# detected download type : One of one user's sets" >&3;
+ echo "# \nSoundcloud-Download: One of one user's sets" >&3;
downset "$soundurl"
else
- echo "# detected download type : One single song" >&3;
+ echo "# \nSoundcloud-Download: One single song" >&3;
downsong "$soundurl"
fi
}
@@ -770,20 +780,18 @@ exec 3> >(yad --progress --title="$ytpltitle" --text="downloading the videos and
)
echo "5" >&3;
-[ $pcount -gt 1 ] && echo "# processing $pcount links ..." >&3 || echo "# processing $pcount link ..." >&3
-[ $usedllist = true ] && echo "# \nAdding links to Downloadlist\n" >&3
+[ $pcount -gt 1 ] && echo "# processing $pcount links ...\n" >&3 || echo "# processing $pcount link ...\n" >&3
+[ $usedllist = true ] && echo "# Adding links to Downloadlist\n" >&3
case $usedllist in
true )
for ((i = 0; i < ${#addnams[@]}; i++)) ; do
- echo "# added link for: ${addnams[$i]}\n" >&3
+ echo "# added link for: ${addnams[$i]}" >&3
done
- echo "# existing links weren't added!" >&3
+ echo "# \nexisting links weren't added!" >&3
;;
esac
-
-
wget -qO- $yutlnk | perl -l -0777 -ne 'print $1 if /<title.*?>\s*(.*?)(?: - youtube)?\s*<\/title/si'
#### Youtube-Playlist download
fun_yutube_DL(){
@@ -811,13 +819,12 @@ fun_yutube_DL(){
;;
esac
# yttit=`youtube-dl -e $ytlog --skip-download $1`
- yttit=$(wget --no-check-certificate -qO- "$1" | perl -l -0777 -ne 'print $1 if /<title.*?>\s*(.*?)(?: - youtube)?\s*<\/title/si' | sed "s/&amp;/\&/g")
- echo "# \ndownloading $2: $yttit" >&3;
+ yttit=$(wget --no-check-certificate -qO- "$1" | perl -l -0777 -ne 'print $1 if /<title.*?>\s*(.*?)(?: - youtube)?\s*<\/title/si' | sed "s/&amp;/\&/g" | sed "s/&quot;/\'/g")
+ echo "# downloading $2: $yttit" >&3;
unset yttit
while [ $failcnt -gt 0 ] ; do
loopcnt=$(($loopcnt+1));
echo "$((5+(($loopcnt*15)-1)))" >&3;
- echo "# Attempt #$loopcnt :$1" >&3;
tmpfail="$(youtube-dl --write-thumbnail --write-info-json -i -q --socket-timeout 5 $ytlog \
-R 4 --audio-format=best --playlist-start $plstnm $plstend --dateafter $dateup \
--newline -o $tmpdir/$precnt$filename "$1" 2>&1 > /dev/null)"
@@ -858,10 +865,9 @@ fun_yutube_DL(){
ytlogin=false
;;
3 ) ### Preconfiguered Soundcloud -> load directly to user directory
- echo "# \nprocessing: $1 " >&3;
sndclddl "$1"
;;
- esac
+ esac
}
function fun_chklnks(){
@@ -887,7 +893,7 @@ function fun_chklnks(){
if `echo $plstytf | grep -q 'ERROR:' 1>/dev/null 2>&1` || `echo $plstytf | grep -q 'WARNING:' 1>/dev/null 2>&1` ; then
errorwrng=$(echo "$plstytf" | cut -d':' -f4-)
geterror=$(echo "$plstytf" | cut -d' ' -f2 | cut -d":" -f1)
- errurl=$(wget --no-check-certificate -qO- "$ytmainlnk""$geterror" | perl -l -0777 -ne 'print $1 if /<title.*?>\s*(.*?)(?: - youtube)?\s*<\/title/si' | sed "s/[&amp;]/&/g")
+ errurl=$(wget --no-check-certificate -qO- "$ytmainlnk""$geterror" | perl -l -0777 -ne 'print $1 if /<title.*?>\s*(.*?)(?: - youtube)?\s*<\/title/si' | sed "s/[&amp;]/&/g" | sed "s/&quot;/\'/g")
echo "# \n*** ERROR YOUTUBE DOWNLOAD: $errurl ***\n*** $errorwrng ***" >&3
else
fun_yutube_DL ''"$ytmainlnk""$plstytf"'' ''" ($pllstcnt)"''
@@ -933,6 +939,7 @@ tcount=$count
IFS='
' # wegen Dateien mit Leerzeichen
i=0
+d=0
echo "50" >&3;
if [ $count -gt 1 ]; then
echo "# \n$count Files are gonna be converted to MP3..." >&3
@@ -944,13 +951,11 @@ for file in $tmpdir/* ; do
i=$(($i+1))
get_filetype $file
shfile=$(echo "$file" | cut -d'/' -f4-)
- discnt="$((50+($i*49/$count)))"
- if [ $discnt -ge 100 ]; then discnt=99; fi
- echo "# Song $i of $tcount" >&3; #Info -deleteable
+ discnt="$((($i*49/$count)))"
+ if [ $discnt -ge 100 ]; then discnt=49; fi
+ echo "# Song $i of $tcount: $shfile" >&3; #Info -deleteable
echo "$discnt" >&3;
- echo "# '$shfile' is being converted..." >&3;
nufile="${file:0:-$deli}.mp3"
-# nufile=$(echo "$nufile" | sed "s/[\"']//g")
i3info=$(echo "$nufile" | cut -d'/' -f4-)
jpgfle="${file:0:-$deli}.jpg"
pi1c=$(echo "$jpgfle" | cut -d'/' -f4-)
@@ -959,6 +964,7 @@ for file in $tmpdir/* ; do
json=$(echo "$jsnfle" | cut -d'/' -f4-)
jsnfle=$tmpjsn/$json
ffmpeg -v 5 -y -i "$file" -acodec libmp3lame -ac 2 -q:a 0 -map a "$nufile"
+ mv -f "$file" $tmpvid
sox_file "$nufile" # Trim Silence at the beginning of file
jsndes=`cat $jsnfle`
appurl="https://www.youtube.com/watch?v="
@@ -980,32 +986,84 @@ for file in $tmpdir/* ; do
id3tit=$(echo "$i3info" | cut -d"-" -f2- | sed 's/^ *//' | sed "s/[&amp;]/&/g")
id3tag --artist=$id3art --song=$id3tit --comment=$comurl $nufile
eyeD3 --add-image $jpgfle:FRONT_COVER $nufile
- case $edid3t in
- TRUE )
+done
+
+echo "# \n$count Files were converted to MP3...\n" >&3
+################ TODO Clean up part below ################################################################################################
+case $edid3t in
+ TRUE )
+ if [ $count -gt 1 ]; then
+ echo "# \n$count MP3-Files are gonna be edited..." >&3
+ else
+ echo "# \n$count MP3-File is gonna be edited..." >&3
+ fi
+ for mp3f in $tmpdir/* ; do
+ if [ -d $mp3f ]; then continue; fi #Verzeichnisse überspringen
+ d=$(($d+1))
+ shfile=$(echo "$mp3f" | cut -d'/' -f4-)
+ descnt="$((50+($d*49/$count)))"
+ if [ $descnt -ge 100 ]; then descnt=99; fi
+ echo "# Song $d of $tcount: $shfile" >&3; #Info -deleteable
+ echo "$descnt" >&3;
+ nufile="$mp3f"
+ i3info=$(echo "$nufile" | cut -d'/' -f4-)
+ jpgfle="${mp3f:0:-4}.jpg"
+ pi1c=$(echo "$jpgfle" | cut -d'/' -f4-)
+ jpgfle=$tmppic/$pi1c
+ jsnfle="${mp3f:0:-4}.info.json"
+ json=$(echo "$jsnfle" | cut -d'/' -f4-)
+ jsnfle=$tmpjsn/$json
+ jsndes=`cat $jsnfle`
+ appurl="https://www.youtube.com/watch?v="
+ OLD_IFS=$IFS
+ IFS=','
+ larry="$jsndes"
+ for url in $larry ; do
+ if `echo $url | grep 'display_id' 1>/dev/null 2>&1` ; then
+ baseurl=$( echo "$url" | cut -d'"' -f4)
+ comurl=$appurl$baseurl
+ fi
+ done
+ IFS=$OLD_IFS
+ i3info="${i3info:0:-4}"
+ if `echo "$i3info" | cut -c2 | grep '_' 1>/dev/null 2>&1` ; then i3info="${i3info:2}"; fi
+ if `echo "$i3info" | cut -c3 | grep '_' 1>/dev/null 2>&1` ; then i3info="${i3info:3}"; fi
+ if `echo "$i3info" | cut -c4 | grep '_' 1>/dev/null 2>&1` ; then i3info="${i3info:4}"; fi
+ id3art=$(echo "$i3info" | cut -d"-" -f1 | sed 's/ *$//')
+ id3tit=$(echo "$i3info" | cut -d"-" -f2- | sed 's/^ *//' | sed "s/[&amp;]/&/g")
id3alb=""
id3gen=""
newid3tags
- ;;
- esac
- ytinfo=$(echo "$nufile" | cut -d'/' -f4- | sed "s/[&]/&amp;/g")
- if [ -z "$gen3di" ] ; then
- prntgnr=""
- else
- prntgnr="-> $gen3di"
- fi
+ ytinfo=$(echo "$nufile" | cut -d'/' -f4- | sed "s/[&]/&amp;/g")
+ if [ -z "$gen3di" ] ; then
+ prntgnr=""
+ else
+ prntgnr="-> $gen3di"
+ fi
- if [ "$gen3di" = "**** deleted ****" ] ; then
- echo "$ytinfo" >> $tmpdelet
- else
- echo "$ytinfo $prntgnr" >> $tmptitle
- fi
- if [ -e "$nufile" ] ; then
- mv -n "$nufile" "$diruse/"
- if [ "$keepvd" == "TRUE" ]; then
- mv -n $file $diruse/Videos/
- fi
- fi
-done
+ if [ "$gen3di" = "**** deleted ****" ] ; then
+ echo "$ytinfo" >> $tmpdelet
+ else
+ echo "$ytinfo $prntgnr" >> $tmptitle
+ fi
+ if [ -e "$nufile" ] ; then
+ if [ "$genfldr" == "TRUE" ] ; then
+ [ ! -d "$diruse/$gen3di/" ] && mkdir "$diruse/$gen3di/"
+ mv -n "$nufile" "$diruse/$gen3di/"
+ else
+ mv -n "$nufile" "$diruse/"
+ fi
+ if [ "$keepvd" == "TRUE" ] ; then
+ mv -n $file $diruse/Videos/
+ fi
+ fi
+ done
+ ;;
+ * )
+ mv -n $tmpdir/*.mp3 "$diruse/"
+ ;;
+esac
+####################################################################################################################################################
count=`expr $count + $sndcldcnt`
if [ $count -eq 1 ] ; then
@@ -1036,6 +1094,7 @@ rm -f /tmp/yttb2
rm -f /tmp/yttb3
rm -f /tmp/yttb4
rm -rf $tmppic
+rm -rf $tmpvid
rm -rf $tmpjsn
rm -rf $tmpdir
rm -rf $tmpsnd