Pale Moon Bookmarking Script using YAD / Sortable / xdotool

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
kjdixo
Posts: 153
Joined: Sun 13 Sep 2009, 21:13

#41 Post by kjdixo »

The bookmarking script bm.sh sometimes downloads a .htm file instead of a .html file.
That messes up the bookmarks html pages as they reference html files and not htm files.
So I decided to detect htm extensions and rename them to html.

In bm.sh replace this

Code: Select all

	
rsync -av --exclude='*.js' /root/$time /root/.bookmarks/bm/wp
rm -rf /root/$time

########################### insert modification here

echo $title | yad --no-buttons --on-top --geometry='900x100' --title $time --text-info
fi


with this

Code: Select all

	
rsync -av --exclude='*.js' /root/$time /root/.bookmarks/bm/wp
rm -rf /root/$time

############################ start modification
export DIR=/root/.bookmarks/bm/wp/$time
if ls ${DIR}/*.htm &>/dev/null
then
echo "file is .htm . . . so rename it to .html"
mv /root/.bookmarks/bm/wp/$time/$time.{htm,html}
fi
############################## end modification

echo $title | yad --no-buttons --on-top --geometry='900x100' --title $time --text-info
fi



It fixes the problem.
Make sure to modify bm.sh in all 5 of the .bookmarks folders.
.bookmarks, .bookmarks-02, .bookmarks-03, .bookmarks-04, .bookmarks-05.

When I get time I will make a .pet to include all of the recent modifications.

kjdixo
Posts: 153
Joined: Sun 13 Sep 2009, 21:13

#42 Post by kjdixo »

Here is a bash script cv.sh to convert to mp4 and bookmark any locally stored videos you may have.
Use it to convert VOB files from a DVD-R recorded from TV (if that is allowed in your part of the world).
I have tried to seamlessly integrate cv.sh with the other scripts in the folder /root/.bookmarks/bv/sh/ for the Palemoon Bookmarking script.
My satellite box (Echolink EL-3020) teletext subtitles when recorded (using a Sharp DV-HR350) to DVD-R are a bit small due to the black frame around the video picture.

So I use mencoder to crop and convert to a perfect size for my requirements . . . these are:

1. Playing seamlessly with mplayer launched from the Palemoon Bookmarking Script the same as I did for YouTube downloads.
2. Videos in the folder /root/.bookmarks/bv/vid/ can easily be transferred to my portable video player (Philips PV7005/12)

Create a "Convert Video" launcher.
For example on your openbox right-click menu

Code: Select all

<item label="CV" icon="/usr/share/pixmaps/filezilla.png"><action name="Execute"><command>sh -c '/root/.bookmarks/bv/sh/cv.sh'</command></action></item> 

Here is the script, remember to make it executable.

Code: Select all

#!/bin/bash
timestamp() {
date +"%Y-%m-%d_%H:%M:%S"
}
# enter a title
title=$(echo $title | yad --mouse --width=1000 --title="Add Video Title" --entry --button="gtk-ok:0")
if [[ $title = "" ]]; then title=$(echo "no title"); fi
sleep 0.5
title1=$(echo $title | cut -c 1-64)
video_title=$(echo $title1 | sed 's/\//_/g' | sed 's/?/_/g' | sed 's/"/_/g' | sed 's/#/_/g')
echo $video_title
# convert the VOB file to mp4
dialog=$(yad --on-top --mouse --title "Convert VOB file" --form --field="Paste address")
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
address=$(echo $dialog | awk 'BEGIN {FS="|" }{print $1}')
time=$(echo $(timestamp))
sorttime=$(echo $((0-$(date +%s))))
mencoder "$address" -o "/root/.bookmarks/bv/vid/"$time".mp4" -ovc xvid -vf crop=706:440:0:80,scale=706:440 -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=2:bitrate=-1200000 | yad --width=900 --on-top --mouse --title "Converting . . .  then please wait for save menu" --progress --pulsate  --auto-close
sleep 0.5
# make a thumbnail
avconv -ss 2 -i "/root/.bookmarks/bv/vid/"$time".mp4" -frames:v 1 -s 60x35 "/root/.bookmarks/bv/vtn/"$time".jpg"
# avprobe get duration of mp4 and redirect stderr to stdout using 2>&1
video_duration=$(avprobe "/root/.bookmarks/bv/vid/"$time".mp4" 2>&1 | awk 'BEGIN {FS="Duration: " } { print $2 }' | awk 'BEGIN {FS="." } { print $1 }')
echo $video_duration
# clean up leading 00: if no hours in HH:MM:SS
# test1 video_duration=$(echo "00:59:59")
# test2 video_duration=$(echo "01:00:00")
video_seconds=$(echo $video_duration | awk -F':' '{if(NF==2){print $1*60+$2}else if(NF==3){print $1*60*60+$2*60+$3}else{print $1}}')
echo $video_seconds
if  (($video_seconds < 3600 )); then
echo "less than 1 hour duration"
video_duration=$(echo $video_duration | cut -c4-)
fi
echo $video_duration

. /root/.bookmarks/bv/txt/tags.txt
dialog=$(yad --on-top --mouse --title="Tag(s)" --width=600 --height=600 --list --checklist --column "Add" --column "Section" FALSE $c2 FALSE $c3 FALSE $c4 FALSE $c5 FALSE $c6 FALSE $c7 FALSE $c8 FALSE $c9 FALSE $c10 FALSE $c11 FALSE $c12 FALSE $c13 FALSE $c14 FALSE $c15 FALSE $c16 FALSE $c17 FALSE $c18 FALSE $c19 FALSE $c20 FALSE $c21 FALSE $c22 FALSE $c23 FALSE $c24 FALSE $c25 FALSE $c26 FALSE $c27)
dialog=$(echo $dialog | sed 's/|//g' | sed 's/ //g' | sed 's/-//g')
if [[ $dialog = *TRUE$c2* ]];then bv2=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv2/index.html'><img src='../bv2/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c3* ]];then bv3=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv3/index.html'><img src='../bv3/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c4* ]];then bv4=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv4/index.html'><img src='../bv4/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c5* ]];then bv5=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv5/index.html'><img src='../bv5/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c6* ]];then bv6=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv6/index.html'><img src='../bv6/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c7* ]];then bv7=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv7/index.html'><img src='../bv7/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c8* ]];then bv8=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv8/index.html'><img src='../bv8/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c9* ]];then bv9=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv9/index.html'><img src='../bv9/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c10* ]];then bv10=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv10/index.html'><img src='../bv10/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c11* ]];then bv11=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv11/index.html'><img src='../bv11/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c12* ]];then bv12=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv12/index.html'><img src='../bv12/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c13* ]];then bv13=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv13/index.html'><img src='../bv13/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c14* ]];then bv14=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv14/index.html'><img src='../bv14/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c15* ]];then bv15=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv15/index.html'><img src='../bv15/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c16* ]];then bv16=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv16/index.html'><img src='../bv16/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c17* ]];then bv17=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv17/index.html'><img src='../bv17/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c18* ]];then bv18=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv18/index.html'><img src='../bv18/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c19* ]];then bv19=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv19/index.html'><img src='../bv19/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c20* ]];then bv20=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv20/index.html'><img src='../bv20/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c21* ]];then bv21=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv21/index.html'><img src='../bv21/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c22* ]];then bv22=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv22/index.html'><img src='../bv22/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c23* ]];then bv23=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv23/index.html'><img src='../bv23/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c24* ]];then bv24=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv24/index.html'><img src='../bv24/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c25* ]];then bv25=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv25/index.html'><img src='../bv25/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c26* ]];then bv26=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv26/index.html'><img src='../bv26/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c27* ]];then bv27=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv27/index.html'><img src='../bv27/favicon.ico'></a></span>");fi
sleep 1

if [[ $dialog = *TRUE$c2* ]];then
dd if=/dev/null of=/root/.bookmarks/bv2/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv2/index.html ) - $( tail -n1 /root/.bookmarks/bv2/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv2/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv2/index.html;
fi

if [[ $dialog = *TRUE$c3* ]];then
dd if=/dev/null of=/root/.bookmarks/bv3/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv3/index.html ) - $( tail -n1 /root/.bookmarks/bv3/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv3/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv3/index.html;
fi

if [[ $dialog = *TRUE$c4* ]];then
dd if=/dev/null of=/root/.bookmarks/bv4/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv4/index.html ) - $( tail -n1 /root/.bookmarks/bv4/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv4/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv4/index.html;
fi

if [[ $dialog = *TRUE$c5* ]];then
dd if=/dev/null of=/root/.bookmarks/bv5/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv5/index.html ) - $( tail -n1 /root/.bookmarks/bv5/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv5/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv5/index.html;
fi

if [[ $dialog = *TRUE$c6* ]];then
dd if=/dev/null of=/root/.bookmarks/bv6/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv6/index.html ) - $( tail -n1 /root/.bookmarks/bv6/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv6/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv6/index.html;
fi

if [[ $dialog = *TRUE$c7* ]];then
dd if=/dev/null of=/root/.bookmarks/bv7/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv7/index.html ) - $( tail -n1 /root/.bookmarks/bv7/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv7/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv7/index.html;
fi

if [[ $dialog = *TRUE$c8* ]];then
dd if=/dev/null of=/root/.bookmarks/bv8/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv8/index.html ) - $( tail -n1 /root/.bookmarks/bv8/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv8/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv8/index.html;
fi

if [[ $dialog = *TRUE$c9* ]];then
dd if=/dev/null of=/root/.bookmarks/bv9/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv9/index.html ) - $( tail -n1 /root/.bookmarks/bv9/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv9/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv9/index.html;
fi

if [[ $dialog = *TRUE$c10* ]];then
dd if=/dev/null of=/root/.bookmarks/bv10/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv10/index.html ) - $( tail -n1 /root/.bookmarks/bv10/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv10/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv10/index.html;
fi

if [[ $dialog = *TRUE$c11* ]];then
dd if=/dev/null of=/root/.bookmarks/bv11/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv11/index.html ) - $( tail -n1 /root/.bookmarks/bv11/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv11/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv11/index.html;
fi

if [[ $dialog = *TRUE$c12* ]];then
dd if=/dev/null of=/root/.bookmarks/bv12/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv12/index.html ) - $( tail -n1 /root/.bookmarks/bv12/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv12/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv12/index.html;
fi

if [[ $dialog = *TRUE$c13* ]];then
dd if=/dev/null of=/root/.bookmarks/bv13/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv13/index.html ) - $( tail -n1 /root/.bookmarks/bv13/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv13/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv13/index.html;
fi

if [[ $dialog = *TRUE$c14* ]];then
dd if=/dev/null of=/root/.bookmarks/bv14/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv14/index.html ) - $( tail -n1 /root/.bookmarks/bv14/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv14/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv14/index.html;
fi

if [[ $dialog = *TRUE$c15* ]];then
dd if=/dev/null of=/root/.bookmarks/bv15/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv15/index.html ) - $( tail -n1 /root/.bookmarks/bv15/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv15/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv15/index.html;
fi

if [[ $dialog = *TRUE$c16* ]];then
dd if=/dev/null of=/root/.bookmarks/bv16/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv16/index.html ) - $( tail -n1 /root/.bookmarks/bv16/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv16/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv16/index.html;
fi

if [[ $dialog = *TRUE$c17* ]];then
dd if=/dev/null of=/root/.bookmarks/bv17/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv17/index.html ) - $( tail -n1 /root/.bookmarks/bv17/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv17/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv17/index.html;
fi

if [[ $dialog = *TRUE$c18* ]];then
dd if=/dev/null of=/root/.bookmarks/bv18/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv18/index.html ) - $( tail -n1 /root/.bookmarks/bv18/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv18/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv18/index.html;
fi

if [[ $dialog = *TRUE$c19* ]];then
dd if=/dev/null of=/root/.bookmarks/bv19/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv19/index.html ) - $( tail -n1 /root/.bookmarks/bv19/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv19/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv19/index.html;
fi

if [[ $dialog = *TRUE$c20* ]];then
dd if=/dev/null of=/root/.bookmarks/bv20/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv20/index.html ) - $( tail -n1 /root/.bookmarks/bv20/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv20/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv20/index.html;
fi

if [[ $dialog = *TRUE$c21* ]];then
dd if=/dev/null of=/root/.bookmarks/bv21/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv21/index.html ) - $( tail -n1 /root/.bookmarks/bv21/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv21/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv21/index.html;
fi

if [[ $dialog = *TRUE$c22* ]];then
dd if=/dev/null of=/root/.bookmarks/bv22/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv22/index.html ) - $( tail -n1 /root/.bookmarks/bv22/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv22/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv22/index.html;
fi

if [[ $dialog = *TRUE$c23* ]];then
dd if=/dev/null of=/root/.bookmarks/bv23/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv23/index.html ) - $( tail -n1 /root/.bookmarks/bv23/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv23/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv23/index.html;
fi

if [[ $dialog = *TRUE$c24* ]];then
dd if=/dev/null of=/root/.bookmarks/bv24/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv24/index.html ) - $( tail -n1 /root/.bookmarks/bv24/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv24/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv24/index.html;
fi

if [[ $dialog = *TRUE$c25* ]];then
dd if=/dev/null of=/root/.bookmarks/bv25/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv25/index.html ) - $( tail -n1 /root/.bookmarks/bv25/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv25/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv25/index.html;
fi

if [[ $dialog = *TRUE$c26* ]];then
dd if=/dev/null of=/root/.bookmarks/bv26/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv26/index.html ) - $( tail -n1 /root/.bookmarks/bv26/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv26/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv26/index.html;
fi

if [[ $dialog = *TRUE$c27* ]];then
dd if=/dev/null of=/root/.bookmarks/bv27/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv27/index.html ) - $( tail -n1 /root/.bookmarks/bv27/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv27/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv27/index.html;
fi

dd if=/dev/null of=/root/.bookmarks/bv0/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv0/index.html ) - $( tail -n1 /root/.bookmarks/bv0/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="/root/.bookmarks/bv/vid/'"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv0/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv0/index.html

printf "%s\n" "$sorttime"_"$video_seconds"_"$video_duration"_"$time"_"$video_title" >> /root/.bookmarks/bv/txt/log.txt

I endeavoured to format everything the same as for my youtube-dl bookmarking script so the code is the same as in bv.sh after this line:

Code: Select all

. /root/.bookmarks/bv/txt/tags.txt

The mencoder cropping options are ideal for my setup.
You might wish to adjust the values or make a YAD dialog to input and preview the settings.

kjdixo
Posts: 153
Joined: Sun 13 Sep 2009, 21:13

#43 Post by kjdixo »

Requirement number 2 from my previous post was:
2. Videos in the folder /root/.bookmarks/bv/vid/ can easily be transferred to my portable video player (Philips PV7005/12)
I had to modify the script cv.sh to make this work how I wanted it to.
The problem was that my microSD cards (16GB and 8GB) when formatted to FAT32 were very fussy about the file names.
Also the filenames I was using were only a timestamp and were not descriptive enough for my old media player which did not use playlists, only filenames.
So I did some work on the script to shorten the date and time stamp.
Old timestamp: YYYY-MM-DD_HH:MM:SS
New timestamp: yyMMDDHHMM
I then appended a variation of the video title with spaces replaced by underscores.
The filenames are now 'FAT32 friendly' and 'old media player friendly' with times and titles in the filenames.
Here is the modified bit of code, it is commented to show what is modified and where it goes.

Code: Select all

#!/bin/bash
timestamp() {
# 20160919 modification to timestamp to be more compatible with FAT32 filenames removed colons [:]
date +"%y%m%d%H%M"
}
# enter a title
title=$(echo $title | yad --mouse --width=1000 --title="Add Video Title" --entry --button="gtk-ok:0")
if [[ $title = "" ]]; then title=$(echo "no title"); fi
sleep 0.5
title1=$(echo $title | cut -c 1-64)
video_title=$(echo $title1 | sed 's/\//_/g' | sed 's/?/_/g' | sed 's/"/_/g' | sed 's/#/_/g')
echo $video_title
# convert the VOB file to mp4
dialog=$(yad --on-top --mouse --title "Convert VOB file" --form --field="Paste address")
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
address=$(echo $dialog | awk 'BEGIN {FS="|" }{print $1}')
time=$(echo $(timestamp))
# 20160919 modification to filename to be more compatible with old FAT32 media players.
# Added bookmark title and removed [: and spaces] and appended to yyMMDDHHMM
file_title=$(echo $video_title | sed 's/ /_/g' | sed 's/:/_/g')
time=$time"_"$file_title
#same as original cv.sh from here onwards
sorttime=$(echo $((0-$(date +%s))))
mencoder "$address" -o "/root/.bookmarks/bv/vid/"$time".mp4" -ovc xvid -vf crop=706:440:0:80,scale=706:440 -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=2:bitrate=-1200000 | yad --width=900 --on-top --mouse --title "Converting . . .  then please wait for save menu" --progress --pulsate  --auto-close
sleep 0.5
On the computer and using the Pale Moon Bookmarking Script to launch mplayer . . .
For viewing with mplayer, depending on what video hardware and drivers you are using it might be necessary to edit the mplayer config file to force full screen zooming.
One of my computers will toggle zoomed full screen with double click left mouse button, or by pressing the keyboard F button.
Another of my computers won't do it with the mouse, only with the F button


/root/.mplayer/config

Code: Select all

# Write your default config options here!
osdlevel=3
vo=x11
zoom=yes

I am now happily watching sub-titled foreign 'soaps' on my portable media player, which is a great way to learn a foreign language.
The files are on a 16GB microSD card.
I might buy a 32GB card to see whether that works.
Quick tip.
I formatted the microSD card with GParted to FAT32 in an SD card reader.
I put the card in the media player and waited for it to acknowledge insertion.
I then formatted the card using the media player settings formatting option.
I then plugged a USB lead from media player to PC and used pmount and Xfe file manager.
It is important to wait at each stage and to not rush as the media player has to connect and transfer info and data.
I hope this is useful.

kjdixo
Posts: 153
Joined: Sun 13 Sep 2009, 21:13

#44 Post by kjdixo »

Another version of the script cv.sh for those who prefer to use their own unique identifiers instead of timestamps in the filenames.
This is the code snippet modification to cv.sh, it needs to be copy / pasted into the beginning of cv.sh and replaces everything up to the line.'# make a thumbnail'.

Code: Select all

#!/bin/bash
# enter a bookmark title, also to be used in the .mp4 filename . . . 
# some older media players only display first 10 characters of filename . . . 
# so we will strip out all un-necessary characters from bookmark title to make the filename.
title=$(echo $title | yad --mouse --width=1000 --title="Add Video Title" --entry --button="gtk-ok:0")
if [[ $title = "" ]]; then title=$(echo "no title"); fi
sleep 0.5
title1=$(echo $title | cut -c 1-64)
video_title=$(echo $title1 | sed 's/\//_/g' | sed 's/?/_/g' | sed 's/"/_/g' | sed 's/#/_/g')
echo $video_title
# convert the VOB file to mp4
dialog=$(yad --on-top --mouse --title "Convert VOB file" --form --field="Paste address")
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
address=$(echo $dialog | awk 'BEGIN {FS="|" }{print $1}')
# No timestamps, instead uses only numbers and upper case letters to uniquely identify.
# The Palemoon bookmark title can be upper and lower case . . . it will be minimized by the script.
# Script automatically converts bookmark title into a capital letter and number 'mnemonic' filename.
# 'Upper Case And Lower Case Title 1_2A-3' will be converted to 'UCALCT12A3'.
file_title=$(echo $video_title | sed 's/_//g' | sed 's/-//g' | sed 's/ //g' | sed 's/://g' | sed 's/[a-z]//g')
time=$file_title
sorttime=$(echo $((0-$(date +%s))))
mencoder "$address" -o "/root/.bookmarks/bv/vid/"$time".mp4" -ovc xvid -vf crop=706:440:0:80,scale=706:440 -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=2:bitrate=-1200000 | yad --width=900 --on-top --mouse --title "Converting . . .  then please wait for save menu" --progress --pulsate  --auto-close
sleep 0.5

A Palemoon bookmark title 'Upper Case And Lower Case Title 1_2A-3' will link to a file named 'UCALCT12A3.mp4'.
This is perfect for older media players using FAT32 formatted storage and filenames to identify the videos..
Enjoy!

kjdixo
Posts: 153
Joined: Sun 13 Sep 2009, 21:13

#45 Post by kjdixo »

The following is the result of practical tests with various different video filename formats on a microSD card in my old media player.
The code changes to the original cv.sh are self explanatory if the code commenting is followed.
Ideally use a syntax highlighted text editor to read it.
Changes all occur before the line
. /root/.bookmarks/bv/txt/tags.txt

Code: Select all


#!/bin/bash
# Script automatically converts bookmark title into a capital letter and number 'mnemonic' filename with timestamp and duration.
# Filename displays well in older style portable media players such as the Philips PV7005/12.

# 'cleverly descriptive bookmark title 1 1 2' will be converted to 'CDBT112-1474393631_9m.mp4'.
# The number code 1 1 2 is a very short code referring to DVD_1 VTS_01 VOB_2 so you can uniquely associate it to a particular vob in your dvd library.
# The timestamp -1474393631 is easy to cross reference between the media player filename and the Palemoon bookmarking script.
# _9m is the duration 9 minutes rounded down, so for less than 1 minute it will be _0m, for 1 hour 34mins 59secs it will be _94m.
# duration is only appended to filename after conversion has completed.
# If the yad dialog for video converting is killed then tagging dialog still runs afterwards and duration is correctly extracted from incomplete video file.

title=$(echo $title | yad --mouse --width=1000 --title="Add a Unique Video Title" --entry --button="gtk-ok:0")
# Duplicate titles may cause overwriting of files with same durations so append a date code to the filename later in the script
if [[ $title = "" ]]; then title=$(echo "no title"); fi
sleep 0.5
title1=$(echo $title | cut -c 1-64)
video_title=$(echo $title1 | sed 's/\//_/g' | sed 's/?/_/g' | sed 's/"/_/g' | sed 's/#/_/g' | sed "s/'/_/g")
echo $video_title
# convert the VOB file to mp4
dialog=$(yad --on-top --mouse --title "Convert VOB file" --form --field="Paste address")
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
address=$(echo $dialog | awk 'BEGIN {FS="|" }{print $1}')

# Next line transforms video_title (and bookmark title) into capitalized string (first letter of each word).
video_title=$(echo "${video_title}" | awk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}1')
# Remove various characters and lower case letters
file_title=$(echo $video_title | sed 's/_//g' | sed 's/-//g' | sed 's/ //g' | sed 's/\.//g' | sed 's/\;//g' | sed 's/://g' | sed 's/[a-z]//g')
# Duplicate titles may cause overwriting of files so append a date code to the filename
sorttime=$(echo $((0-$(date +%s))))
# Use existing sortime for datecode as it will be easy to cross reference between media player filename and Palemoon bookmarking script.
time=$file_title$sorttime

mencoder "$address" -o "/root/.bookmarks/bv/vid/"$time".mp4" -ovc xvid -vf crop=706:440:0:80,scale=706:440 -oac mp3lame -lameopts cbr:br=128 -xvidencopts pass=2:bitrate=-1200000 | yad --width=900 --on-top --mouse --title "Converting . . .  then please wait for save menu" --progress --pulsate  --auto-close
sleep 0.5
# make a thumbnail
avconv -ss 2 -i "/root/.bookmarks/bv/vid/"$time".mp4" -frames:v 1 -s 60x35 "/root/.bookmarks/bv/vtn/"$time".jpg"
# avprobe get duration of mp4 and redirect to stdout using 2>&1
video_duration=$(avprobe "/root/.bookmarks/bv/vid/"$time".mp4" 2>&1 | awk 'BEGIN {FS="Duration: " } { print $2 }' | awk 'BEGIN {FS="." } { print $1 }')
echo $video_duration
echo $datecode
# clean up leading 00: if no hours in HH:MM:SS
# test1 video_duration=$(echo "00:59:59")
# test2 video_duration=$(echo "01:00:00")
video_seconds=$(echo $video_duration | awk -F':' '{if(NF==2){print $1*60+$2}else if(NF==3){print $1*60*60+$2*60+$3}else{print $1}}')
echo $video_seconds
if  (($video_seconds < 3600 )); then
echo "less than 1 hour duration"
video_duration=$(echo $video_duration | cut -c4-)
fi
echo $video_duration

# minutes rounded down to nearest minute
let video_minutes=video_seconds/60
video_minutes=$(echo $video_minutes"m")
echo $video_minutes
# rename video file and thumbnail
mv "/root/.bookmarks/bv/vid/"$time".mp4"  "/root/.bookmarks/bv/vid/"$time"_"$video_minutes".mp4" 
mv "/root/.bookmarks/bv/vtn/"$time".jpg" "/root/.bookmarks/bv/vtn/"$time"_"$video_minutes".jpg"

# redefine $time for bookmarking code below
time=$(echo $time"_"$video_minutes)
echo $time

. /root/.bookmarks/bv/txt/tags.txt
dialog=$(yad --on-top --mouse --title="Tag(s)" --width=600 --height=600 --list --checklist --column "Add" --column "Section" FALSE $c2 FALSE $c3 FALSE $c4 FALSE $c5 FALSE $c6 FALSE $c7 FALSE $c8 FALSE $c9 FALSE $c10 FALSE $c11 FALSE $c12 FALSE $c13 FALSE $c14 FALSE $c15 FALSE $c16 FALSE $c17 FALSE $c18 FALSE $c19 FALSE $c20 FALSE $c21 FALSE $c22 FALSE $c23 FALSE $c24 FALSE $c25 FALSE $c26 FALSE $c27)
dialog=$(echo $dialog | sed 's/|//g' | sed 's/ //g' | sed 's/-//g')
if [[ $dialog = *TRUE$c2* ]];then bv2=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv2/index.html'><img src='../bv2/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c3* ]];then bv3=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv3/index.html'><img src='../bv3/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c4* ]];then bv4=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv4/index.html'><img src='../bv4/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c5* ]];then bv5=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv5/index.html'><img src='../bv5/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c6* ]];then bv6=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv6/index.html'><img src='../bv6/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c7* ]];then bv7=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv7/index.html'><img src='../bv7/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c8* ]];then bv8=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv8/index.html'><img src='../bv8/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c9* ]];then bv9=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv9/index.html'><img src='../bv9/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c10* ]];then bv10=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv10/index.html'><img src='../bv10/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c11* ]];then bv11=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv11/index.html'><img src='../bv11/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c12* ]];then bv12=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv12/index.html'><img src='../bv12/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c13* ]];then bv13=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv13/index.html'><img src='../bv13/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c14* ]];then bv14=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv14/index.html'><img src='../bv14/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c15* ]];then bv15=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv15/index.html'><img src='../bv15/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c16* ]];then bv16=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv16/index.html'><img src='../bv16/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c17* ]];then bv17=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv17/index.html'><img src='../bv17/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c18* ]];then bv18=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv18/index.html'><img src='../bv18/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c19* ]];then bv19=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv19/index.html'><img src='../bv19/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c20* ]];then bv20=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv20/index.html'><img src='../bv20/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c21* ]];then bv21=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv21/index.html'><img src='../bv21/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c22* ]];then bv22=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv22/index.html'><img src='../bv22/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c23* ]];then bv23=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv23/index.html'><img src='../bv23/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c24* ]];then bv24=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv24/index.html'><img src='../bv24/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c25* ]];then bv25=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv25/index.html'><img src='../bv25/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c26* ]];then bv26=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv26/index.html'><img src='../bv26/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c27* ]];then bv27=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bv27/index.html'><img src='../bv27/favicon.ico'></a></span>");fi
sleep 1

if [[ $dialog = *TRUE$c2* ]];then
dd if=/dev/null of=/root/.bookmarks/bv2/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv2/index.html ) - $( tail -n1 /root/.bookmarks/bv2/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv2/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv2/index.html;
fi

if [[ $dialog = *TRUE$c3* ]];then
dd if=/dev/null of=/root/.bookmarks/bv3/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv3/index.html ) - $( tail -n1 /root/.bookmarks/bv3/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv3/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv3/index.html;
fi

if [[ $dialog = *TRUE$c4* ]];then
dd if=/dev/null of=/root/.bookmarks/bv4/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv4/index.html ) - $( tail -n1 /root/.bookmarks/bv4/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv4/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv4/index.html;
fi

if [[ $dialog = *TRUE$c5* ]];then
dd if=/dev/null of=/root/.bookmarks/bv5/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv5/index.html ) - $( tail -n1 /root/.bookmarks/bv5/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv5/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv5/index.html;
fi

if [[ $dialog = *TRUE$c6* ]];then
dd if=/dev/null of=/root/.bookmarks/bv6/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv6/index.html ) - $( tail -n1 /root/.bookmarks/bv6/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv6/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv6/index.html;
fi

if [[ $dialog = *TRUE$c7* ]];then
dd if=/dev/null of=/root/.bookmarks/bv7/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv7/index.html ) - $( tail -n1 /root/.bookmarks/bv7/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv7/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv7/index.html;
fi

if [[ $dialog = *TRUE$c8* ]];then
dd if=/dev/null of=/root/.bookmarks/bv8/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv8/index.html ) - $( tail -n1 /root/.bookmarks/bv8/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv8/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv8/index.html;
fi

if [[ $dialog = *TRUE$c9* ]];then
dd if=/dev/null of=/root/.bookmarks/bv9/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv9/index.html ) - $( tail -n1 /root/.bookmarks/bv9/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv9/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv9/index.html;
fi

if [[ $dialog = *TRUE$c10* ]];then
dd if=/dev/null of=/root/.bookmarks/bv10/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv10/index.html ) - $( tail -n1 /root/.bookmarks/bv10/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv10/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv10/index.html;
fi

if [[ $dialog = *TRUE$c11* ]];then
dd if=/dev/null of=/root/.bookmarks/bv11/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv11/index.html ) - $( tail -n1 /root/.bookmarks/bv11/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv11/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv11/index.html;
fi

if [[ $dialog = *TRUE$c12* ]];then
dd if=/dev/null of=/root/.bookmarks/bv12/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv12/index.html ) - $( tail -n1 /root/.bookmarks/bv12/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv12/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv12/index.html;
fi

if [[ $dialog = *TRUE$c13* ]];then
dd if=/dev/null of=/root/.bookmarks/bv13/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv13/index.html ) - $( tail -n1 /root/.bookmarks/bv13/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv13/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv13/index.html;
fi

if [[ $dialog = *TRUE$c14* ]];then
dd if=/dev/null of=/root/.bookmarks/bv14/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv14/index.html ) - $( tail -n1 /root/.bookmarks/bv14/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv14/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv14/index.html;
fi

if [[ $dialog = *TRUE$c15* ]];then
dd if=/dev/null of=/root/.bookmarks/bv15/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv15/index.html ) - $( tail -n1 /root/.bookmarks/bv15/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv15/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv15/index.html;
fi

if [[ $dialog = *TRUE$c16* ]];then
dd if=/dev/null of=/root/.bookmarks/bv16/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv16/index.html ) - $( tail -n1 /root/.bookmarks/bv16/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv16/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv16/index.html;
fi

if [[ $dialog = *TRUE$c17* ]];then
dd if=/dev/null of=/root/.bookmarks/bv17/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv17/index.html ) - $( tail -n1 /root/.bookmarks/bv17/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv17/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv17/index.html;
fi

if [[ $dialog = *TRUE$c18* ]];then
dd if=/dev/null of=/root/.bookmarks/bv18/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv18/index.html ) - $( tail -n1 /root/.bookmarks/bv18/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv18/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv18/index.html;
fi

if [[ $dialog = *TRUE$c19* ]];then
dd if=/dev/null of=/root/.bookmarks/bv19/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv19/index.html ) - $( tail -n1 /root/.bookmarks/bv19/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv19/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv19/index.html;
fi

if [[ $dialog = *TRUE$c20* ]];then
dd if=/dev/null of=/root/.bookmarks/bv20/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv20/index.html ) - $( tail -n1 /root/.bookmarks/bv20/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv20/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv20/index.html;
fi

if [[ $dialog = *TRUE$c21* ]];then
dd if=/dev/null of=/root/.bookmarks/bv21/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv21/index.html ) - $( tail -n1 /root/.bookmarks/bv21/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv21/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv21/index.html;
fi

if [[ $dialog = *TRUE$c22* ]];then
dd if=/dev/null of=/root/.bookmarks/bv22/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv22/index.html ) - $( tail -n1 /root/.bookmarks/bv22/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv22/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv22/index.html;
fi

if [[ $dialog = *TRUE$c23* ]];then
dd if=/dev/null of=/root/.bookmarks/bv23/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv23/index.html ) - $( tail -n1 /root/.bookmarks/bv23/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv23/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv23/index.html;
fi

if [[ $dialog = *TRUE$c24* ]];then
dd if=/dev/null of=/root/.bookmarks/bv24/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv24/index.html ) - $( tail -n1 /root/.bookmarks/bv24/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv24/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv24/index.html;
fi

if [[ $dialog = *TRUE$c25* ]];then
dd if=/dev/null of=/root/.bookmarks/bv25/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv25/index.html ) - $( tail -n1 /root/.bookmarks/bv25/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv25/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv25/index.html;
fi

if [[ $dialog = *TRUE$c26* ]];then
dd if=/dev/null of=/root/.bookmarks/bv26/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv26/index.html ) - $( tail -n1 /root/.bookmarks/bv26/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv26/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv26/index.html;
fi

if [[ $dialog = *TRUE$c27* ]];then
dd if=/dev/null of=/root/.bookmarks/bv27/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv27/index.html ) - $( tail -n1 /root/.bookmarks/bv27/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="'/root/.bookmarks/bv/vid/"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv27/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv27/index.html;
fi

dd if=/dev/null of=/root/.bookmarks/bv0/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bv0/index.html ) - $( tail -n1 /root/.bookmarks/bv0/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><p>'"$video_seconds"'</p></td><td><a onfocus="this.blur()" href="/root/.bookmarks/bv/vid/'"$time".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'.jpg">'"$video_title"'_'"$video_duration"'</a></td><td>'"$bv"''"$bv1"''"$bv2"''"$bv3"''"$bv4"''"$bv5"''"$bv6"''"$bv7"''"$bv8"''"$bv9"''"$bv10"''"$bv11"''"$bv12"''"$bv13"''"$bv14"''"$bv15"''"$bv16"''"$bv17"''"$bv18"''"$bv19"''"$bv20"''"$bv21"''"$bv22"''"$bv23"''"$bv24"''"$bv25"''"$bv26"''"$bv27"'</td></tr>' >>  /root/.bookmarks/bv0/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bv0/index.html

printf "%s\n" "$sorttime"_"$video_seconds"_"$video_duration"_"$time"_"$video_title" >> /root/.bookmarks/bv/txt/log.txt

Script automatically converts bookmark title into a capital letter and number 'mnemonic' filename with timestamp and duration.
Filename displays well in older style portable media players such as the Philips PV7005/12.

'cleverly descriptive bookmark title 1 1 2' will be converted to 'CDBT112-1474393631_9m.mp4'.
The number code 1 1 2 is a very short code referring to DVD_1 VTS_01 VOB_2 so you can uniquely associate it to a particular vob in your dvd library.
The timestamp -1474393631 is easy to cross reference between the media player filename and the Palemoon bookmarking script.
_9m is the duration 9 minutes rounded down, so for less than 1 minute it will be _0m, for 1 hour 34mins 59secs it will be _94m.
Duration is only appended to filename after conversion has completed.
If the yad dialog for video converting is killed then the tagging dialog still runs afterwards and the duration is correctly extracted from the incomplete video file.

Post Reply