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

#31 Post by kjdixo »

Photo gallery script gallery2.sh has simple image rotation 0 90 180 270.
I might use parts of this code when I make the multi-page document gallery.

Code: Select all

#! /bin/sh
# put this script in the folder with the images.
title=$(pwd | awk -F / '{print $NF}') 
title=$(echo $title | yad --mouse --width=1000 --title="Edit Title or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
if [[ $title = "" ]]; then title=$(echo "no title"); fi
echo "<!DOCTYPE html>" > index.html
echo "<head>" >> index.html
echo "<title>$title</title>" >> index.html
echo "<link rel=\"shortcut icon\" href=\"/root/.bookmarks/bm/img/favicon.ico\">" >> index.html
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"/root/.bookmarks/bm/css/gallery.css\">" >> index.html
echo "</head>" >> index.html
echo "<body>" >> index.html
echo "<div class=\"header\">$title</div>" >> index.html
fext=$(echo ".JPG" | yad --mouse --width=1000 --title="VERY IMPORTANT file extension of the images" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
if [[ $fext = "" ]]; then fext=$(echo ".JPG"); fi
for i in *$fext; do 
convert.im6 -resize 600'x'600 "$i" "tn_"$i

yad --image="tn_$i" --mouse --title="ROTATE?" \
--button="270:2" \
--button="180:3" \
--button="90:4" \
--button="0:5" \
--button="EXIT:6"

ret=$?
if [[ $ret -eq 2 ]]; then
convert.im6 -rotate 270 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
echo "</body>" >> index.html
echo "</html>" >> index.html
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div class=\"des\">$title - $desc</div>" >> index.html
echo "<img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\">" >> index.html;
fi
if [[ $ret -eq 3 ]]; then
convert.im6 -rotate 180 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
echo "</body>" >> index.html
echo "</html>" >> index.html
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div class=\"des\">$title - $desc</div>" >> index.html
echo "<img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\">" >> index.html;
fi
if [[ $ret -eq 4 ]]; then
convert.im6 -rotate 90 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
echo "</body>" >> index.html
echo "</html>" >> index.html
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div class=\"des\">$title - $desc</div>" >> index.html
echo "<img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\">" >> index.html;
fi
if [[ $ret -eq 5 ]]; then
convert.im6 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
echo "</body>" >> index.html
echo "</html>" >> index.html
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div class=\"des\">$title - $desc</div>" >> index.html
echo "<img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\">" >> index.html;
fi
if [[ $ret -eq 6 ]]; then
echo "</body>" >> index.html
echo "</html>" >> index.html
exit 0
fi
done;
echo "</body>" >> index.html
echo "</html>" >> index.html

Attachments
gallery2.sh.tar.gz
(806 Bytes) Downloaded 162 times
rotate.jpg
(35.36 KiB) Downloaded 703 times

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

#32 Post by kjdixo »

A simple improvement to the above, if most of the photos don't need rotating.
I found that swapping the buttons around so the default "0" is on the right-hand side makes the rotate dialog easier to use (in combination with the rename dialog which has an OK button on the right hand side).
You can quickly run through a folder of camera photos and create a thumbnailed index.html photo gallery web page.

Code: Select all

yad --image="tn_$i" --mouse --title="ROTATE?" \
--button="EXIT:6" \
--button="270:2" \
--button="180:3" \
--button="90:4" \
--button="0:5"
The EXIT button has been moved to the left-hand side, out of the way, where it is less likely to be "accidentally clicked" when doing a fast and rapid run through of many photos.

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

#33 Post by kjdixo »

I will include a final version of these galleries in my YAD bookmarking scripts.
Here we have a photo gallery gallery3.sh with a drop down list for navigation.
The drop down list is always at the top right hand side of the browser window.
Wherever you scroll in the gallery the navigation list will always be easy to find.

Code: Select all

#! /bin/sh
# put this script in the folder with the images.
# define EXIT and cancel
end_it_all(){
echo "<select id=\"nav\" onchange=\"location=this.value\">" >> index.html
cat temp.txt >> index.html
echo "</select>" >> index.html
echo "</body>" >> index.html
echo "</html>" >> index.html	
}
rm -rf temp.txt
title=$(pwd | awk -F / '{print $NF}') 
title=$(echo $title | yad --mouse --width=1000 --title="Edit Title or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
if [[ $title = "" ]]; then title=$(echo "no title"); fi
echo "<!DOCTYPE html>" > index.html
echo "<head>" >> index.html
echo "<title>$title</title>" >> index.html
echo "<link rel=\"shortcut icon\" href=\"/root/.bookmarks/bm/img/favicon.ico\">" >> index.html
echo "<style>" >> index.html
echo "body{background-color:#ba8;background-image:url('/root/.bookmarks/bm/img/bg.jpg')}" >> index.html
echo "img{border:solid 4px white;margin:0px 0px;position:relative;top:4px}" >> index.html
echo "#nav{position:fixed;top:4px;right:4px;border:solid 2px yellow}" >> index.html
echo "</style>" >> index.html
echo "</head>" >> index.html
echo "<body>" >> index.html

fext=$(echo ".JPG" | yad --mouse --width=1000 --title="VERY IMPORTANT file extension of the images" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
if [[ $fext = "" ]]; then fext=$(echo ".JPG"); fi
for i in *$fext; do 
convert.im6 -resize 600'x'600 "$i" "tn_"$i
# remove file extension
im=$(basename "$i")
id="${im%.*}"

yad --image="tn_$i" --mouse --title="ROTATE?" \
--button="EXIT:6" \
--button="270:2" \
--button="180:3" \
--button="90:4" \
--button="0:5"

ret=$?
if [[ $ret -eq 2 ]]; then
convert.im6 -rotate 270 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?

if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 3 ]]; then
convert.im6 -rotate 180 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 4 ]]; then
convert.im6 -rotate 90 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 5 ]]; then
convert.im6 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 6 ]]; then
end_it_all
exit 0
fi
done;
end_it_all

Images are closely stacked, I removed inline titles, the drop down list and image hovers are sufficient I think.
I wrote a temporary text file to hold the drop down list data which is then inserted before the final closing tags.
No external style sheet is needed this time.
EDIT
Edited once as I forgot to remove the stylesheet link from the script.
New attachment uploaded.
Attachments
gallery3.sh.tar.gz
(1.02 KiB) Downloaded 147 times

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

#34 Post by kjdixo »

Much more exciting . . . add the following code to the image style

Code: Select all

width:100%

To modify the script gallery3.sh change line 23 to

Code: Select all

echo "img{border:solid 4px white;margin:0px 0px;position:relative;top:4px;width:100%}" >> index.html

This makes all the images neatly fit the full width of the browser window and it looks much nicer than varying widths that need zooming.

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

#35 Post by kjdixo »

Photo gallery navigation is improved with gallery4.sh.
It adds updating of the navigation list by clicking on a photo.
It does this with a little extra JavaScript woven into the html page.
I could have done "onmouseover" . . . however, that is probably too automated and "onclick" gives a feeling of feedback and control whilst scrolling the gallery.
A photo when clicked will jump to the top of the browser window and its description will be updated on the drop-down navigation list.

Code: Select all

#! /bin/sh
# put this script in the folder with the images.
# define EXIT and cancel
end_it_all(){
echo "<select id=\"nav\" onchange=\"location=this.value\">" >> index.html
cat temp.txt >> index.html
echo "</select>" >> index.html
echo "</body>" >> index.html
echo "</html>" >> index.html	
}
rm -rf temp.txt
title=$(pwd | awk -F / '{print $NF}') 
title=$(echo $title | yad --mouse --width=1000 --title="Edit Title or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
if [[ $title = "" ]]; then title=$(echo "no title"); fi
echo "<!DOCTYPE html>" > index.html
echo "<head>" >> index.html
echo "<title>$title</title>" >> index.html
echo "<link rel=\"shortcut icon\" href=\"/root/.bookmarks/bm/img/favicon.ico\">" >> index.html
echo "<style>" >> index.html
echo "body{background-color:#ba8;background-image:url('/root/.bookmarks/bm/img/bg.jpg')}" >> index.html
echo "img{border:solid 4px white;margin:0px 0px;position:relative;top:4px;width:100%}" >> index.html
echo "#nav{position:fixed;top:4px;right:4px;border:solid 2px yellow}" >> index.html
echo "</style>" >> index.html
echo "<script type=\"text/javascript\">function nav(){location=loc;document.getElementById('nav').value=loc}</script>" >> index.html
echo "</head>" >> index.html
echo "<body>" >> index.html

fext=$(echo ".JPG" | yad --mouse --width=1000 --title="VERY IMPORTANT file extension of the images" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
if [[ $fext = "" ]]; then fext=$(echo ".JPG"); fi
for i in *$fext; do 
convert.im6 -resize 600'x'600 "$i" "tn_"$i
# remove file extension
im=$(basename "$i")
id="${im%.*}"

yad --image="tn_$i" --mouse --title="ROTATE?" \
--button="EXIT:6" \
--button="270:2" \
--button="180:3" \
--button="90:4" \
--button="0:5"

ret=$?
if [[ $ret -eq 2 ]]; then
convert.im6 -rotate 270 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?

if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\" onclick=\"loc='#$id';nav()\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 3 ]]; then
convert.im6 -rotate 180 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\" onclick=\"loc='#$id';nav()\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 4 ]]; then
convert.im6 -rotate 90 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\" onclick=\"loc='#$id';nav()\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 5 ]]; then
convert.im6 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\" onclick=\"loc='#$id';nav()\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 6 ]]; then
end_it_all
exit 0
fi
done;
end_it_all

Viewing a photographed postcard collection or a sequence of photographed printed pages is very easy with this system.
The photo galleries can be allocated a button or a category in the Pale Moon Bookmarking Script.
Attachments
gallery4.sh.tar.gz
(1.11 KiB) Downloaded 155 times

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

#36 Post by kjdixo »

To do with anchors, url hashes and the photo galleries and jumping to positions in any bookmarked web page (not just photo galleries . . . any web page).
I have made 2 improvements here.
1. Photo galleries created with this script gallery4a.sh will pass the url # anchor from the address bar to the drop-down list and update it correctly.
The created web page has a body onload to make the nav list value equal window.location.hash from the url address bar.

Code: Select all

#! /bin/sh
# put this script in the folder with the images.
# define EXIT and cancel
end_it_all(){
echo "<select id=\"nav\" onchange=\"location=this.value\">" >> index.html
cat temp.txt >> index.html
echo "</select>" >> index.html
echo "</body>" >> index.html
echo "</html>" >> index.html	
}
rm -rf temp.txt
title=$(pwd | awk -F / '{print $NF}') 
title=$(echo $title | yad --mouse --width=1000 --title="Edit Title or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
if [[ $title = "" ]]; then title=$(echo "no title"); fi
echo "<!DOCTYPE html>" > index.html
echo "<head>" >> index.html
echo "<title>$title</title>" >> index.html
echo "<link rel=\"shortcut icon\" href=\"/root/.bookmarks/bm/img/favicon.ico\">" >> index.html
echo "<style>" >> index.html
echo "body{background-color:#ba8;background-image:url('/root/.bookmarks/bm/img/bg.jpg')}" >> index.html
echo "img{border:solid 4px white;margin:0px 0px;position:relative;top:4px;width:100%}" >> index.html
echo "#nav{position:fixed;top:4px;right:4px;border:solid 2px yellow}" >> index.html
echo "</style>" >> index.html
echo "<script type=\"text/javascript\">function nav(){location=loc;document.getElementById('nav').value=loc}</script>" >> index.html
echo "</head>" >> index.html
echo "<body onload=\"document.getElementById('nav').value=window.location.hash\">" >> index.html

fext=$(echo ".JPG" | yad --mouse --width=1000 --title="VERY IMPORTANT file extension of the images" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
if [[ $fext = "" ]]; then fext=$(echo ".JPG"); fi
for i in *$fext; do 
convert.im6 -resize 600'x'600 "$i" "tn_"$i
# remove file extension
im=$(basename "$i")
id="${im%.*}"

yad --image="tn_$i" --mouse --title="ROTATE?" \
--button="EXIT:6" \
--button="270:2" \
--button="180:3" \
--button="90:4" \
--button="0:5"

ret=$?
if [[ $ret -eq 2 ]]; then
convert.im6 -rotate 270 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?

if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\" onclick=\"loc='#$id';nav()\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 3 ]]; then
convert.im6 -rotate 180 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\" onclick=\"loc='#$id';nav()\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 4 ]]; then
convert.im6 -rotate 90 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\" onclick=\"loc='#$id';nav()\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 5 ]]; then
convert.im6 -resize 600'x'600 "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1000 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\" onclick=\"loc='#$id';nav()\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 6 ]]; then
end_it_all
exit 0
fi
done;
end_it_all

2. Complimentary to 1. above
The Pale Moon Bookmarking script bm.sh now includes an anchor # feature.
To use this feature when bookmarking any page right click and view the source of the web page to be bookmarked or inspect elements.
Then find the element id of where you want the bookmark to jump to and copy it and append it into the url address bar of Pale Moon, making sure to insert a '#' between the url and the append.
Hit enter and watch the url with the appended # cause the page to auto jump to the position of the element id.
I thought it would be nice for the Pale Moon bookmarking script to retain and respect these anchor points within long web pages and have bookmarks that contained the html anchors.
The modification to bm.sh is contained in the following lines of code.

Code: Select all

anchor=$(echo $address | awk 'BEGIN {FS="#" }{print $2}')
anchor2=$(echo "#"$anchor)
if [[ -z $anchor ]]; then anchor2=$(echo ""); fi
time=$(echo $(timestamp))
sorttime=$(echo $((0-$(date +%s))))
bm=$(echo "<span class='tag'><a onfocus='this.blur()' target='_blank' href='file:///root/.bookmarks/bm/wp/$time/$time.html$anchor2'><img src='../bm/img/favicon.ico'></a></span>")

EDIT added a line of code if [[ -z $anchor ]]; then anchor2=$(echo ""); fi above to remove the # from a locally stored bookmark that did not have a hash anchor to start with.

Remember to modify bm.sh in all category folders (.bookmarks, bookmarks-02 to .bookmarks-05 etc etc)
Attachments
bm.sh.tar.gz
(2.59 KiB) Downloaded 136 times
gallery4a.sh.tar.gz
(1.13 KiB) Downloaded 146 times

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

#37 Post by kjdixo »

Gallery Optimized for Viewing Books and Documents (to then bookmark).

It is easier to carry around a micro sd card than 10kg of books.
So you might at some stage have photographed with your camera some documents or book pages.
When you eventually look at the photographed pages on your computer screen you are less than impressed.
The photos are darker than you thought they were.
They are going to need contrast and brightness increasing, before they are good enough to stitch together into a gallery.
This script gallery5.sh is basically the same as the previous gallery scripts, but with a few extra features added.

1. An option at the start of batch thumbnailing to brighten up all the photos.
2. The photo thumbnail widths are 1200 pixels, double the resolution of before.

Dazzle or Normal is a one off choice to be made at the beginning of thumbnailing.
Dazzle implements imagemagick's "brightness, contrast, hue" feature.
I set it to -modulate 160,160,100 which is in my opinion, with my photos, fairly good.

Written text needs to be sharp and focussed . . . not compressed too much and blurry, so that is why the resolution has been increased.
It also means bigger image files and therefore slower loading.

Code: Select all

#! /bin/sh
# put this script in the folder with the images.
# define EXIT and cancel
end_it_all(){
echo "<select id=\"nav\" onchange=\"location=this.value\">" >> index.html
cat temp.txt >> index.html
echo "</select>" >> index.html
echo "</body>" >> index.html
echo "</html>" >> index.html	
}
rm -rf temp.txt
title=$(pwd | awk -F / '{print $NF}') 
title=$(echo $title | yad --mouse --width=1000 --title="Edit Title or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
if [[ $title = "" ]]; then title=$(echo "no title"); fi
echo "<!DOCTYPE html>" > index.html
echo "<head>" >> index.html
echo "<title>$title</title>" >> index.html
echo "<link rel=\"shortcut icon\" href=\"/root/.bookmarks/bm/img/favicon.ico\">" >> index.html
echo "<style>" >> index.html
echo "body{background-color:#ba8;background-image:url('/root/.bookmarks/bm/img/bg.jpg')}" >> index.html
echo "img{border:solid 4px white;margin:0px 0px;position:relative;top:4px;width:100%}" >> index.html
echo "#nav{position:fixed;top:4px;right:4px;border:solid 2px yellow}" >> index.html
echo "</style>" >> index.html
echo "<script type=\"text/javascript\">function nav(){location=loc;document.getElementById('nav').value=loc}</script>" >> index.html
echo "</head>" >> index.html
echo "<body onload=\"document.getElementById('nav').value=window.location.hash\">" >> index.html

fext=$(echo ".JPG" | yad --mouse --width=800 --title="VERY IMPORTANT file extension of the images" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
if [[ $fext = "" ]]; then fext=$(echo ".JPG"); fi

yad --mouse --title="Dazzle?" --button="Dazzle:0" --button="Normal:2"
ret=$?
if [[ $ret -eq 0 ]];then 
daz=$(echo "-modulate 160,160,100");echo $daz;fi
if [[ $ret -eq 2 ]];then 
daz=$(echo "");echo $daz;fi

for i in *$fext; do 
convert.im6 -resize 1200x $daz "$i" "tn_"$i
# remove file extension
im=$(basename "$i")
id="${im%.*}"

yad --image="tn_$i" --mouse --title="ROTATE?" \
--button="EXIT:6" \
--button="270:2" \
--button="180:3" \
--button="90:4" \
--button="0:5"

ret=$?
if [[ $ret -eq 2 ]]; then
convert.im6 -rotate 270 -resize 1200x $daz "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1600 --title="Edit Description or add one here" --text-info --editable)
ret=$?

if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\" onclick=\"loc='#$id';nav()\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 3 ]]; then
convert.im6 -rotate 180 -resize 1200x $daz "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1600 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\" onclick=\"loc='#$id';nav()\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 4 ]]; then
convert.im6 -rotate 90 -resize 1200x $daz "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1600 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\" onclick=\"loc='#$id';nav()\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 5 ]]; then
convert.im6 -resize 1200x $daz "$i" "tn_"$i
desc=$(echo "tn_"$i | yad  --image="tn_$i" --mouse --width=1600 --title="Edit Description or add one here" --text-info --editable)
ret=$?
if [[ $ret -eq 1 ]];then 
end_it_all
exit 0;fi
if [[ $desc = "" ]]; then desc=$(echo "tn_"$i); fi
echo "<div id=\"$id\"><img src=\"tn_$i\" alt=\"$desc\" title=\"$desc\" onclick=\"loc='#$id';nav()\"></div>" >> index.html;
echo "<option value=\"#$id\">$desc</option>" >> temp.txt;
fi
if [[ $ret -eq 6 ]]; then
end_it_all
exit 0
fi
done;
end_it_all

You might need to tweak the imagemagick parameters and resolutions to suit your particular screen size or maybe the brightness is not exactly what you want.
Modify to suit.
Attachments
gallery5.sh.tar.gz
(1.19 KiB) Downloaded 130 times

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

#38 Post by kjdixo »

You could include the -resize parameter in the Dazzle option $daz above.
So that you get 1200px width for enhanced printed pages and 600px width for ordinary photographs (Normal option).
Also, if you photograph a set of pages, they probably all have a consistent strip of floor or desk area top and bottom, or at the sides, that could do with cropping.
Removal of the thumbnail edges (cropping) could be included in the script.
Other imagemagick functions http://www.imagemagick.org/Usage/ could also be included in the script.
Maybe add extra YAD code to input the imagemagick options to $daz.
Use buttons, combo boxes, a check list or a "--text-info --editable" dialog.

The gallery5.sh ROTATE? dialog has an option to EXIT and restart the process.
So when you are doing the first thumbnail rotation you can also check the contrast and brightness before proceeding.
If it is not correct then EXIT, tweak the parameters until perfect and then proceed with all the rest of the thumbnails.

The version of imagemagick I am using requires that convert is written as convert.im6

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

#39 Post by kjdixo »

The bookmarking retagging script bmretag.sh now includes renaming of bookmark titles.
I only show here the section of code that has been modified, not all the code of bmretag.sh.
The attachment contains the complete code.

Code: Select all

#!/bin/sh

dialog=$(yad --on-top --mouse --width=900 --title "To Retag or Rename a bookmark press a blue button for 2 seconds" --form --field="Then click 10 digit timestamp and drag it into this box")
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
timestamp=$(echo $dialog | awk 'BEGIN {FS="|" } { print $1 }')
if [[ $timestamp = "" ]]; then exit 0; fi
timestamp2=$(echo $timestamp | awk 'BEGIN {FS="-" } { print $2 }')
size=${#timestamp2}
if [ $size = 10 ];
then
case $timestamp2 in
''|*[!0-9]*) ;;
*) 
# here copy line containing $timestamp2 from bm0/index.html to $bm_tmp, if timestamp not found then exit.
# also - if you are trying to use a video bookmark timestamp instead of a bookmark timestamp - it will exit.
bm_tmp=$(awk '/'$timestamp2'/' /root/.bookmarks/bm0/index.html | sed 's/span><span.*/span>/' | sed 's/<\/td><\/tr>//')
bm_title=$(echo $bm_tmp | awk 'BEGIN {FS=".pdf\">" }{print $2}' | awk 'BEGIN {FS="</a>" }{print $1}')
echo $bm_title
# rename the bookmark (give it a new title)
title=$(echo $bm_title | yad --mouse --width=1000 --title="Edit Title or add one here" --text-info --editable --button="gtk-ok:0")
if [[ $title = "" ]]; then title=$(echo "no title"); fi
echo $title
title1=$(echo $title | cut -c 1-64)
title2=$(echo $title1 | sed 's/\//_/g' | sed 's/?/_/g' | sed 's/"/_/g' | sed 's/#/_/g')
echo $title2
bm_tmp=$(echo $bm_tmp | sed "s/$bm_title/$title2/g")
# rename .pdf in the folder /root/.bookmarks/bm/pdf/
bm_time=$(echo $bm_tmp | awk 'BEGIN {FS="/bm/wp/" }{print $2}' | awk 'BEGIN {FS="/" }{print $1}')
echo $bm_time
cd /root/.bookmarks/bm/pdf
file_old=$(ls $bm_time*.pdf)
echo $file_old
file_new=$(ls $bm_time*.pdf | sed "s/$bm_title/$title2/g")
echo $file_new
mv "$file_old" "$file_new"
sleep 1
if [[ -z $bm_tmp ]]; then exit 0; fi
# once that is done delete existing tags and proceed as normal with code below to retag. 
                                                                           #
                                                  #
                              #
             #
#
             #
                                #
# please see the complete code in the attachment or graft the code above onto the beginning of your bmretag.sh
# it is probably best to check the attachment for the complete code.
As well as renaming the bookmark title it also changes the filename of the local timestamped .pdf.
Make sure you modify bmretag.sh in all 5 of the .bookmarks folders.
.bookmarks, .bookmarks-02, .bookmarks-03, .bookmarks-04, .bookmarks-05.
Enjoy . . . renaming your bookmarks.
Attachments
bmretag.sh.tar.gz
(2.54 KiB) Downloaded 133 times

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

#40 Post by kjdixo »

The video bookmarking script bv.sh sometimes downloads a webm file instead of an mp4 file (using youtube-dl).
That messes up the video bookmarks html pages as they reference mp4 files and not webm files.
It would be possible to detect file extensions and write the html bookmarks accordingly.
It would also be possible to convert from webm to mp4 (which takes a while to do and requires ffmpeg) it works but that solution was overkill.
A better method is to force the downloading of an mp4 file . . . in the first place.
I did this by adding the code: -f mp4 to the youtube-dl script in bv.sh.
In bv.sh replace this line

Code: Select all

youtube-dl "$address" -o "/root/.bookmarks/bv/vid/"$time"_%(id)s.%(ext)s" | yad --width=900 --on-top --mouse --title "Downloading . . . then please wait for save menu" --progress --pulsate  --auto-close
with this line

Code: Select all

youtube-dl "$address" -o "/root/.bookmarks/bv/vid/"$time"_%(id)s.%(ext)s" -f mp4 | yad --width=900 --on-top --mouse --title "Downloading . . . then please wait for save menu" --progress --pulsate  --auto-close
That (-f mp4) fixes the problem.
Make sure to modify bv.sh in all 5 of the .bookmarks folders.
.bookmarks, .bookmarks-02, .bookmarks-03, .bookmarks-04, .bookmarks-05.

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