Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 24 Jul 2016, 14:36
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Pale Moon Bookmarking Script using YAD / Sortable / xdotool
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [41 Posts]   Goto page: 1, 2, 3 Next
Author Message
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Sat 23 Apr 2016, 09:33    Post subject:  Pale Moon Bookmarking Script using YAD / Sortable / xdotool
Subject description: Tag bookmarks into predefined categories and save the web pages and videos locally
 

This is the readme.txt
Pale Moon Browser Bookmarking script.
Tag bookmarks into predefined categories and save them as 'pdf' and 'web page complete'.
Requires accompanying script SORTable.js (modified by me) which sorts by time and domain.
Requires xclip, xdotool, yad, youtube-dl, imagemagick and a correctly configured file and folder structure.
I am using it with Puppy Linux Quirky Tahr 6.05.
Install Pale Moon browser Version 25.3.1 (x86).
During normal use ensure only one browser instance is running.
There is a reason I am using the Pale Moon in-built 'pdf' and 'web page complete' save dialogs.
These dialogs are reliable and work, "so why re-invent the wheel?".
I spent weeks messing with other methods which eventually I abandoned due to several issues one of which was UTF8 encoding issues.
My method automates the running of the Pale Moon save dialogs by using xdotool.
Un-install CUPS so that the browser print dialog only has "Print to File" and there are no printers.
Setup browser Print dialog > Page Setup > Paper Orientation to Landscape (displays pdfs better without the right side text cropped).
'/' and '?' and '#' are replaced by '_' in '$title' . . . as forward slashes etc. in the pdf filenames cause errors when saving the pdfs.
Install Evince and set default display to full screen - when in full screen type ctrl + T to set as default.
Install MPlayer for viewing the videos.
In the file /root/.mplayer/config add a line . . . osdlevel=3 . . . so that the seek times are displayed.
Go into Pale Moon > Edit > Preferences > Applications and set PDF file action = Use evince. Set video/mp4 action = Use mplayer.
Install xclip if not already installed.
Install xdotool.
Install youtube-dl.
Install YAD (version 27) in Puppy Linux install Geoffrey's .pet linked from the forums.
Setup a quick way to access the bookmarks and their configuration scripts as described below.
1. Copy the the 5 bookmark folders to your root folder (in puppy linux /root/) . . . /root/.bookmarks/ , /root/.bookmarks-02/ , /root/.bookmarks-03/ , /root/.bookmarks-04/ , /root/.bookmarks-05/
2. Add a bookmark to the Pale Moon toolbar . . . file:///root/.bookmarks/bm0/index.html
3. Add 2 shortcuts to your Openbox menu (or another launcher method) . . . use sh -c ' ' if necessary.
I used this:
Code:
<item label="BM" icon="/usr/share/pixmaps/filezilla.png"><action name="Execute"><command>/root/.bookmarks/bm/launcher.sh</command></action></item>
<item label="BV" icon="/usr/share/pixmaps/filezilla.png"><action name="Execute"><command>sh -c '/root/.bookmarks/bv/launcher.sh'</command></action></item>

Whilst getting to know . . . don't be in too much of a hurry and wait up to ten seconds after each dialog has closed to wait to see if another dialog pops up.
If something goes wrong then dive in and try to hack a fix. For example when 'web page complete' is saved:
If a saved web page file extension is .htm or .xhtml then manually rename it to .html (after the script has made the .html link).
If a saved web page file extension is .txt (very rare) then manually rename it to .html (after the script has made the .html link).
I might one day automate the above two.
Also if the file extension was .txt then after renaming it to .html you could in the file add <html><body> tags and also add a <br> after every line.
IMPORTANT: the bookmark button names (tags) must not have any spaces e.g. one word only for each tag. Add these manually by editing tags.txt
ALSO: make sure the browser refresh button is accessible, as this may often need to be clicked, for 'script caused changes' to take effect.
BE VERY CAREFUL tinkering and experimenting with bash scripts especially with commands that delete or remove things.
This is a work in progress, the code has been developed over the last 3 months and I now use it with my browser every day.
I am no expert and find out what works by searching the internet for solutions. Stack Overflow is most useful in this respect.
Some of the code could be improved and made more efficient or extra features added, or the structure simplified.
I made use of the features inherent in CSS / Files and Folders / Other Tools where possible and used YAD as the interface to my scripts.
There were many other approaches possible (ie more use of arrays and loops, instead of hardwired, or utilizing the browser database) my approach might not be the best, but I like it and it works for me.
I will be posting this in the Puppy Linux Forum http://murga-linux.com/puppy/ programming section where snippets of code are show-cased and discussed.
Comments and suggestions welcome.
kjdixo
April 23 2016
readme.txt.tar.gz
Description 
gz

 Download 
Filename  readme.txt.tar.gz 
Filesize  2.26 KB 
Downloaded  36 Time(s) 
.bookmarks-05.tar.gz
Description 
gz

 Download 
Filename  .bookmarks-05.tar.gz 
Filesize  82.49 KB 
Downloaded  39 Time(s) 
.bookmarks-04.tar.gz
Description 
gz

 Download 
Filename  .bookmarks-04.tar.gz 
Filesize  82.49 KB 
Downloaded  39 Time(s) 
.bookmarks-03.tar.gz
Description 
gz

 Download 
Filename  .bookmarks-03.tar.gz 
Filesize  82.48 KB 
Downloaded  38 Time(s) 
.bookmarks-02.tar.gz
Description 
gz

 Download 
Filename  .bookmarks-02.tar.gz 
Filesize  82.47 KB 
Downloaded  32 Time(s) 
.bookmarks.tar.gz
Description 
gz

 Download 
Filename  .bookmarks.tar.gz 
Filesize  82.52 KB 
Downloaded  39 Time(s) 
shot3.jpg
 Description   
 Filesize   84.91 KB
 Viewed   396 Time(s)

shot3.jpg

shot2.jpg
 Description   
 Filesize   51.6 KB
 Viewed   396 Time(s)

shot2.jpg

shot1.jpg
 Description   
 Filesize   59.18 KB
 Viewed   397 Time(s)

shot1.jpg

Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Sat 23 Apr 2016, 11:08    Post subject:  

Clicking the blue button alternately sorts the columns by domain, title and time.
Hidden Timestamp Column.
Holding the blue button for 2 seconds reveals the timestamps used to tag and retag.
Visible Columns
Clicking domain (column 1) goes to website.
Clicking title (column 2) opens pdf.
Magnifying glass (column 3) opens 'web page complete' local copy.

I will be writing a summary of how to use it soon.
Until then . . .
A picture says a thousand words.
See attached screenshots of some of the dialogs.
shot12.png
 Description   
 Filesize   163.81 KB
 Viewed   379 Time(s)

shot12.png

shot11.png
 Description   
 Filesize   130.09 KB
 Viewed   376 Time(s)

shot11.png

shot10.png
 Description   
 Filesize   37.52 KB
 Viewed   377 Time(s)

shot10.png

shot9.png
 Description   
 Filesize   64.54 KB
 Viewed   383 Time(s)

shot9.png

shot8.png
 Description   
 Filesize   53 KB
 Viewed   386 Time(s)

shot8.png

shot7.png
 Description   
 Filesize   54.84 KB
 Viewed   387 Time(s)

shot7.png

shot6.png
 Description   
 Filesize   15.08 KB
 Viewed   386 Time(s)

shot6.png

shot5.png
 Description   
 Filesize   14.75 KB
 Viewed   388 Time(s)

shot5.png

shot4.png
 Description   
 Filesize   20.11 KB
 Viewed   390 Time(s)

shot4.png

Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Sun 24 Apr 2016, 05:46    Post subject:  

More details

Pros
1. Pale Moon starts much faster when your hundreds of bookmarks are removed from the Pale Moon Toolbar / Database.
2. I found scrolling through 900 bookmarks on the Pale Moon Toolbar tedious and often unfruitful, this makes finding stuff quicker.
3. Although the Pale Moon bookmarks search (database) was fast and accurate it was not fun to use.
4. This is more fun and quite like a file manager, it can be ordered and structured so you can find stuff quickly.
5. I can search for things using my system (sortable columns is a big help) and using the browser 'find and highlight on page' (CTRL + F).
6. It is integrated with the browser in so much as it is accessible from a toolbar icon and appears in a normal browser tab.
7. You can make it your home page or load it at browser start up if you want.
8. Having an offline repository of all your web pages means you can comfortably read stuff whilst offline.
9. Using it is enjoyable, when you tire of reading web pages then click the video button and find a video in the sortable lists.
10. It is robust, functional and difficult to lose things . . . bookmarks, tags, retags, deletes are all logged in text files and offline pdfs and web pages are never deleted.
11. It is easy to find the time-stamped physical files and delete them manually if you want, and remove lines from the log files using a text editor if necessary.

Cons
1. Needs a fair degree of bravery and determination to set up.
2. Is rigid and repetitive in structure (although that helps you track things down and make changes easily).
3. Comfort and style is important to some people, so it could be better and have more style tweaks (fonts, borders, animations and icons etc.).
4. You cannot use the Pale Moon built-in bookmarks search (database) if you have nothing bookmarked in it . . . I rarely used it.
5. Hyperlinks within pdfs aren't implemented, some web pages don't save very well to pdf and some don't save very well to 'web page complete'.

Other Notes
1. To create the video thumbnails I use imagemagick and for my version . . . the command for convert is convert.im6
2. I have deliberately made the system large to absorb hundreds and thousands of bookmarks.
3. You are not limited to 5 categories, the category mechanism is worth studying and hacking (to create more or less categories) if you want.
4. For future development . . . search functions can be done in JavaScript on wording appearing on the web pages.
5. There are many potential methods for searching files using Bash scripts and other programs and even search within files (search within pdfs).
6. Worth mentioning, I stripped out all JavaScripts from the 'web page complete' folders (using rsync with an exclusion switch for js)
Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Sun 24 Apr 2016, 10:01    Post subject:  

Bookmarking with this system can best be described as a process and to be successful the bookmarking process must be allowed to run and complete.
Ensure all scripts in the sh folder are executable by the user (root in my case) rwx/r/r and all other files are just read/write rw/r/r

Webpage bookmarking

1. Ensure the required web page is displayed in Pale Moon and only one browser instance is running (other tabs don't matter).
2. The script will find and focus the browser window and begin bookmarking, so click the launcher to trigger the script /root/.bookmarks/bm/sh/launcher.sh

Code:

#! /bin/bash
yad --on-top --undecorated --mouse \
--button="category:2" \
--button="buttons:3" \
--button="bookmark:4" \
--button="delete:5" \
--button="retag:6"

ret=$?
if [[ $ret -eq 2 ]]; then
sh -c '/root/.bookmarks/bm/sh/bmcat.sh'
exit 0
fi
if [[ $ret -eq 3 ]]; then
sh -c '/root/.bookmarks/bm/sh/launcher2.sh'
exit 0
fi
if [[ $ret -eq 4 ]]; then
sh -c '/root/.bookmarks/bm/sh/bm.sh'
exit 0
fi
if [[ $ret -eq 5 ]]; then
sh -c '/root/.bookmarks/bm/sh/bmdel.sh'
exit 0
fi
if [[ $ret -eq 6 ]]; then
sh -c '/root/.bookmarks/bm/sh/bmretag.sh'
exit 0
fi


2. Click the bookmark button to trigger the script /root/.bookmarks/bm/sh/bm.sh

Code:

#! /bin/bash
. /root/.bookmarks/bm/txt/tags.txt
dialog=$(yad --on-top --mouse --title="Tags" --width=600 --height=600 --list --checklist --column "Add" --column "Tag" 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)
ret=$?
if [[ $ret -eq 1 ]];then exit 0;fi
dialog=$(echo $dialog | sed 's/|//g' | sed 's/ //g' | sed 's/-//g')
if [[ $dialog = *TRUE$c2* ]];then bm2=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm2/index.html'><img src='../bm2/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c3* ]];then bm3=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm3/index.html'><img src='../bm3/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c4* ]];then bm4=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm4/index.html'><img src='../bm4/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c5* ]];then bm5=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm5/index.html'><img src='../bm5/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c6* ]];then bm6=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm6/index.html'><img src='../bm6/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c7* ]];then bm7=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm7/index.html'><img src='../bm7/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c8* ]];then bm8=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm8/index.html'><img src='../bm8/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c9* ]];then bm9=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm9/index.html'><img src='../bm9/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c10* ]];then bm10=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm10/index.html'><img src='../bm10/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c11* ]];then bm11=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm11/index.html'><img src='../bm11/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c12* ]];then bm12=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm12/index.html'><img src='../bm12/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c13* ]];then bm13=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm13/index.html'><img src='../bm13/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c14* ]];then bm14=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm14/index.html'><img src='../bm14/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c15* ]];then bm15=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm15/index.html'><img src='../bm15/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c16* ]];then bm16=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm16/index.html'><img src='../bm16/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c17* ]];then bm17=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm17/index.html'><img src='../bm17/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c18* ]];then bm18=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm18/index.html'><img src='../bm18/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c19* ]];then bm19=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm19/index.html'><img src='../bm19/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c20* ]];then bm20=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm20/index.html'><img src='../bm20/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c21* ]];then bm21=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm21/index.html'><img src='../bm21/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c22* ]];then bm22=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm22/index.html'><img src='../bm22/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c23* ]];then bm23=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm23/index.html'><img src='../bm23/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c24* ]];then bm24=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm24/index.html'><img src='../bm24/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c25* ]];then bm25=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm25/index.html'><img src='../bm25/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c26* ]];then bm26=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm26/index.html'><img src='../bm26/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE$c27* ]];then bm27=$(echo "<span class='tag'><a onfocus='this.blur()' href='file:///root/.bookmarks/bm27/index.html'><img src='../bm27/favicon.ico'></a></span>");fi
if [[ $dialog = *TRUE* ]];then xdotool search --classname Navigator windowactivate
rm -rf /root/.bookmarks/bm/temp.pdf
sleep 1
xdotool key "ctrl+l"
xdotool key "ctrl+c"
xdotool key "ctrl+p"
xdotool key "Down"
xdotool key "alt+p"
xdotool key "alt+r"
timestamp() {
date +"%Y-%m-%d_%H:%M:%S"
}

while [[ ! -f /root/.bookmarks/bm/temp.pdf ]]; do
sleep 0.1
done
address=$(xclip -selection clipboard -o)
winid=$(xdotool search --classname Navigator)
sleep 1
title=$(xdotool getwindowname $winid | sed -e 's/\( - Pale Moon\)*$//g')
title=$(echo $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

sleep 1
title1=$(echo $title | cut -c 1-64)
title2=$(echo $title1 | sed 's/\//_/g' | sed 's/?/_/g' | sed 's/"/_/g' | sed 's/#/_/g')

domain=$(echo $address | sed 's/www.//g' | awk 'BEGIN {FS="://" }{print $2}' | awk 'BEGIN {FS="/" }{print $1}')
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'><img src='../bm/img/favicon.ico'></a></span>")

if [[ -z $domain ]]; then domain=$(echo "filesystem"); fi

if [[ $dialog = *TRUE$c2* ]];then
dd if=/dev/null of=/root/.bookmarks/bm2/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm2/index.html ) - $( tail -n1 /root/.bookmarks/bm2/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm2/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm2/index.html;
fi

if [[ $dialog = *TRUE$c3* ]];then
dd if=/dev/null of=/root/.bookmarks/bm3/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm3/index.html ) - $( tail -n1 /root/.bookmarks/bm3/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm3/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm3/index.html;
fi

if [[ $dialog = *TRUE$c4* ]];then
dd if=/dev/null of=/root/.bookmarks/bm4/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm4/index.html ) - $( tail -n1 /root/.bookmarks/bm4/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm4/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm4/index.html;
fi

if [[ $dialog = *TRUE$c5* ]];then
dd if=/dev/null of=/root/.bookmarks/bm5/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm5/index.html ) - $( tail -n1 /root/.bookmarks/bm5/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm5/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm5/index.html;
fi

if [[ $dialog = *TRUE$c6* ]];then
dd if=/dev/null of=/root/.bookmarks/bm6/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm6/index.html ) - $( tail -n1 /root/.bookmarks/bm6/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm6/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm6/index.html;
fi

if [[ $dialog = *TRUE$c7* ]];then
dd if=/dev/null of=/root/.bookmarks/bm7/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm7/index.html ) - $( tail -n1 /root/.bookmarks/bm7/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm7/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm7/index.html;
fi

if [[ $dialog = *TRUE$c8* ]];then
dd if=/dev/null of=/root/.bookmarks/bm8/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm8/index.html ) - $( tail -n1 /root/.bookmarks/bm8/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm8/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm8/index.html;
fi

if [[ $dialog = *TRUE$c9* ]];then
dd if=/dev/null of=/root/.bookmarks/bm9/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm9/index.html ) - $( tail -n1 /root/.bookmarks/bm9/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm9/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm9/index.html;
fi

if [[ $dialog = *TRUE$c10* ]];then
dd if=/dev/null of=/root/.bookmarks/bm10/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm10/index.html ) - $( tail -n1 /root/.bookmarks/bm10/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm10/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm10/index.html;
fi

if [[ $dialog = *TRUE$c11* ]];then
dd if=/dev/null of=/root/.bookmarks/bm11/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm11/index.html ) - $( tail -n1 /root/.bookmarks/bm11/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm11/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm11/index.html;
fi

if [[ $dialog = *TRUE$c12* ]];then
dd if=/dev/null of=/root/.bookmarks/bm12/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm12/index.html ) - $( tail -n1 /root/.bookmarks/bm12/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm12/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm12/index.html;
fi

if [[ $dialog = *TRUE$c13* ]];then
dd if=/dev/null of=/root/.bookmarks/bm13/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm13/index.html ) - $( tail -n1 /root/.bookmarks/bm13/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm13/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm13/index.html;
fi

if [[ $dialog = *TRUE$c14* ]];then
dd if=/dev/null of=/root/.bookmarks/bm14/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm14/index.html ) - $( tail -n1 /root/.bookmarks/bm14/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm14/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm14/index.html;
fi

if [[ $dialog = *TRUE$c15* ]];then
dd if=/dev/null of=/root/.bookmarks/bm15/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm15/index.html ) - $( tail -n1 /root/.bookmarks/bm15/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm15/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm15/index.html;
fi

if [[ $dialog = *TRUE$c16* ]];then
dd if=/dev/null of=/root/.bookmarks/bm16/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm16/index.html ) - $( tail -n1 /root/.bookmarks/bm16/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm16/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm16/index.html;
fi

if [[ $dialog = *TRUE$c17* ]];then
dd if=/dev/null of=/root/.bookmarks/bm17/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm17/index.html ) - $( tail -n1 /root/.bookmarks/bm17/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm17/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm17/index.html;
fi

if [[ $dialog = *TRUE$c18* ]];then
dd if=/dev/null of=/root/.bookmarks/bm18/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm18/index.html ) - $( tail -n1 /root/.bookmarks/bm18/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm18/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm18/index.html;
fi

if [[ $dialog = *TRUE$c19* ]];then
dd if=/dev/null of=/root/.bookmarks/bm19/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm19/index.html ) - $( tail -n1 /root/.bookmarks/bm19/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm19/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm19/index.html;
fi

if [[ $dialog = *TRUE$c20* ]];then
dd if=/dev/null of=/root/.bookmarks/bm20/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm20/index.html ) - $( tail -n1 /root/.bookmarks/bm20/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm20/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm20/index.html;
fi

if [[ $dialog = *TRUE$c21* ]];then
dd if=/dev/null of=/root/.bookmarks/bm21/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm21/index.html ) - $( tail -n1 /root/.bookmarks/bm21/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm21/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm21/index.html;
fi

if [[ $dialog = *TRUE$c22* ]];then
dd if=/dev/null of=/root/.bookmarks/bm22/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm22/index.html ) - $( tail -n1 /root/.bookmarks/bm22/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm22/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm22/index.html;
fi

if [[ $dialog = *TRUE$c23* ]];then
dd if=/dev/null of=/root/.bookmarks/bm23/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm23/index.html ) - $( tail -n1 /root/.bookmarks/bm23/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm23/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm23/index.html;
fi

if [[ $dialog = *TRUE$c24* ]];then
dd if=/dev/null of=/root/.bookmarks/bm24/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm24/index.html ) - $( tail -n1 /root/.bookmarks/bm24/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm24/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm24/index.html;
fi

if [[ $dialog = *TRUE$c25* ]];then
dd if=/dev/null of=/root/.bookmarks/bm25/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm25/index.html ) - $( tail -n1 /root/.bookmarks/bm25/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm25/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm25/index.html;
fi

if [[ $dialog = *TRUE$c26* ]];then
dd if=/dev/null of=/root/.bookmarks/bm26/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm26/index.html ) - $( tail -n1 /root/.bookmarks/bm26/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm26/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm26/index.html;
fi

if [[ $dialog = *TRUE$c27* ]];then
dd if=/dev/null of=/root/.bookmarks/bm27/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm27/index.html ) - $( tail -n1 /root/.bookmarks/bm27/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm27/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm27/index.html;
fi

dd if=/dev/null of=/root/.bookmarks/bm0/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm0/index.html ) - $( tail -n1 /root/.bookmarks/bm0/index.html | wc -c) | bc )
echo '<tr><td><p>'"$sorttime"'</p></td><td><a onfocus="this.blur()" target="_blank" href="'"$address"'">'"$domain"'</a></td><td><a onfocus="this.blur()" target="_blank" href="'/root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf'">'"$title1"'</a></td><td>'"$bm"''"$bm1"''"$bm2"''"$bm3"''"$bm4"''"$bm5"''"$bm6"''"$bm7"''"$bm8"''"$bm9"''"$bm10"''"$bm11"''"$bm12"''"$bm13"''"$bm14"''"$bm15"''"$bm16"''"$bm17"''"$bm18"''"$bm19"''"$bm20"''"$bm21"''"$bm22"''"$bm23"''"$bm24"''"$bm25"''"$bm26"''"$bm27"'</td></tr>' >>  /root/.bookmarks/bm0/index.html
echo '</table></div></div></body></html>' >> /root/.bookmarks/bm0/index.html

cp /root/.bookmarks/bm/temp.pdf /root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf
evince -f /root/.bookmarks/bm/pdf/"$time"_"$title2"_"$domain".pdf
printf "%s\n" "$sorttime"_"$time"_"$title"_"$domain"_"$address" >> /root/.bookmarks/bm/txt/log.txt

sleep 1
echo $time | xclip -selection clipboard
sleep 1
xdotool search --classname Navigator windowactivate
sleep 1
xdotool key "ctrl+s";
sleep 1
xdotool key "ctrl+v";
sleep 1
xdotool key "alt+Home";
sleep 1
xdotool key "alt+l";
sleep 1
xdotool key "ctrl+v";
sleep 1
xdotool key "BackSpace";
xdotool key "Return";
xdotool key "Return";
sleep 1
# clears any failed to fetch download error dialogs, usually less than 4.
xdotool search --classname Dialog windowactivate;
xdotool key "Return";
sleep 1
xdotool search --classname Dialog windowactivate;
xdotool key "Return";
sleep 1
xdotool search --classname Dialog windowactivate;
xdotool key "Return";
sleep 1
xdotool search --classname Dialog windowactivate;
xdotool key "Return";
sleep 1
rsync -av --exclude='*.js' /root/$time /root/.bookmarks/bm/wp
rm -rf /root/$time
echo $title | yad --no-buttons --on-top --geometry='900x100' --title $time --text-info
fi


3. The process has started, you are presented with a check box dialog where you can choose which predefined tags to use for the web page.
shot13.jpg
 Description   
 Filesize   45.46 KB
 Viewed   333 Time(s)

shot13.jpg

Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Sun 24 Apr 2016, 10:04    Post subject:  

The native Pale Moon print dialog appears and will save the web page initially to temp.pdf but first you are given a chance to edit or add a title.
The pdf is later copied to to a timestamped .pdf in /root/.bookmarks/bm/pdf/
Sometimes the text box will be blank so copy and paste a title from the web page or write one in.
Now once the pdf is displayed in evince and after you close it . . . please now wait up to ten seconds for xdotool to autosave the web page.
The sequence is
a) Web page saved to timestamped folder in /root/ . . . I did this because xdotool reliably keys into Palemoon's save dialog the 'home' key of your keyboard.
b) Time is allowed for various components of the web page to download and provision is made for closing any Palemoon 'Download Errors'.
c) Wait for the time-stamped script YAD dialog to appear which indicates successful completion of the bookmarking process.
d) During step (c) the timestamped web page in the folder in /root/ is copied minus its javascripts to its final resting place in /root/.bookmarks/bm/wp/
e) Then the timestamped folder in the root directory is erased to prevent the root folder filling up with web pages.
That was part 1 (bookmarking and saving) . . . more instructions and explanations to follow.
Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Sun 24 Apr 2016, 10:08    Post subject:  

The image below is the YAD dialog from 'step (c)' you must wait for.
It indicates successful completion of the script.
shot14.jpg
 Description   
 Filesize   20.51 KB
 Viewed   330 Time(s)

shot14.jpg

Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Sun 24 Apr 2016, 10:39    Post subject:  

Notes
1. During development, in order to target specific windows and dialogs, in some cases I needed to ascertain the windownames / classnames.
I used a very useful terminal command line tool called 'xprop' for this.
Type xprop then enter into a terminal and your cursor will change to a cross hair which you can hover over any window and click it to see what is what.
2. In my bookmarking system all folders and index.html files are ready hard-wired at the start.
There are only 2 folders that get web content added, they are:
/root/.bookmarks/bm/wp/ for 'web page complete'
and
/root/.bookmarks/bm/pdf/ for 'pdfs'
3. There are a fixed number (26) of tag folders each containing only one index.html (and maybe an index.html.bak) and a favicon.ico.
I chose 26 buttons as they fit neatly across my 22 inch monitor screen and also could be used to alphabetically index things.
So for instance folder bm2 could contain a favicon 'A' and folder bm27 could contain a favicon 'Z'.
Why you would want 26 letters as tag buttons I don't know but the possibility is there if required.
Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Sun 24 Apr 2016, 13:47    Post subject:  

Not many comments in my code so here is an explanation of one part of it from the long code snippet above.
Code:

dd if=/dev/null of=/root/.bookmarks/bm0/index.html bs=1 seek=$(echo $(stat --format=%s /root/.bookmarks/bm0/index.html ) - $( tail -n1 /root/.bookmarks/bm0/index.html | wc -c) | bc )

The line above removes the last line of the index.html file, so a new bookmark can be inserted.
Once the new bookmark is inserted, the last line can be re-added.
This is also why I have a lot of html closing tags on one line at the end.
The line below re-adds the closing tags after the newly inserted bookmark.
Code:

echo '</table></div></div></body></html>' >> /root/.bookmarks/bm0/index.html
Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Sun 24 Apr 2016, 14:36    Post subject:  

Video bookmarking

1. Pale Moon does not need to be running for this, but it probably will be as you most likely will be on a YouTube web page.
Click the launcher to trigger the script /root/.bookmarks/bv/sh/launcher.sh

Code:

#! /bin/bash
yad --on-top --undecorated --mouse \
--button="category:2" \
--button="buttons:3" \
--button="bookmark:4" \
--button="delete:5" \
--button="retag:6"

ret=$?
if [[ $ret -eq 2 ]]; then
sh -c '/root/.bookmarks/bm/sh/bmcat.sh'
exit 0
fi
if [[ $ret -eq 3 ]]; then
sh -c '/root/.bookmarks/bv/sh/launcher2.sh'
exit 0
fi
if [[ $ret -eq 4 ]]; then
sh -c '/root/.bookmarks/bv/sh/bv.sh'
exit 0
fi
if [[ $ret -eq 5 ]]; then
sh -c '/root/.bookmarks/bv/sh/bvdel.sh'
exit 0
fi
if [[ $ret -eq 6 ]]; then
sh -c '/root/.bookmarks/bv/sh/bvretag.sh'
exit 0
fi


2. Click the bookmark button to trigger the script /root/.bookmarks/bv/sh/bv.sh

Code:

#!/bin/bash
timestamp() {
date +"%Y-%m-%d_%H:%M:%S"
}
dialog=$(yad --on-top --mouse --title "You Tube Download" --form --field="Paste address")
address=$(echo $dialog)
time=$(echo $(timestamp))
sorttime=$(echo $((0-$(date +%s))))
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
video_title=$(youtube-dl --get-title $address)
video_id=$(youtube-dl --get-id $address)

convert.im6 https://i.ytimg.com/vi/"$video_id"/default.jpg -crop 120x66+0+12 -filter triangle -resize 60x35\! -quality 79% /root/.bookmarks/bv/vtn/"$time"_"$video_id".jpg

video_duration=$(youtube-dl --get-duration $address)
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}}')

. /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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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"'_'"$video_id".mp4'"><img class="tn" src="/root/.bookmarks/bv/vtn/'"$time"'_'"$video_id"'.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_id"_"$video_title" >> /root/.bookmarks/bv/txt/log.txt


3. You are then presented with a YAD text box entry dialog "You Tube Download".
4. Copy and paste a YouTube web page address into the text box, ideally a short 2 minute video just to test the correct functioning.
shot15.png
 Description   
 Filesize   25.73 KB
 Viewed   302 Time(s)

shot15.png

Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Sun 24 Apr 2016, 14:39    Post subject:  

5. A progress dialog appears [Downloading . . . then please wait for save dialog].
6. When the download is complete a tagging dialog appears which displays your previously defined video categories with check boxes. Tag the video.
7. It is a good idea to keep an eye on your task bar net activity indicator to see the youtube-dl program fetching extra data like thumbnail, title and duration etc.
Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Sun 24 Apr 2016, 14:59    Post subject:  

This crops and resizes the YouTube video thumbnail using imagemagick.
The thumbnail I want is tiny, so I cannot tolerate the black borders top and bottom on the YouTube thumbnail . . . so I remove them.
Code:

convert.im6 https://i.ytimg.com/vi/"$video_id"/default.jpg -crop 120x66+0+12 -filter triangle -resize 60x35\! -quality 79% /root/.bookmarks/bv/vtn/"$time"_"$video_id".jpg


This extracts hours, minutes and seconds from the YouTube duration time formatted with colons hh:mm:ss and gets the duration in seconds.
I need the duration in seconds so I can use sortable to sort the videos by duration, which is useful if I don't have time to watch a long video, or if I do want to watch a long video.
Code:

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}}')

Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Sun 24 Apr 2016, 15:52    Post subject:  

Changing the favicon (32x32) in the folder holding the index.html page for a particular tag button, will instantly and globally change all corresponding tag icons in all the bookmarks on all the index.html pages (in folders bm2 thru bm27) because they all refer to that one single favicon you are changing.
I have not yet designed a YAD dialog to do this but it is a task so simple and infrequent that it is probably best to do it manually in your favorite image manipulation program, ie mtpaint or mirage or whatever.
For the time being icon hunting and converting to 32x32 favicons can be done manually.
It might be possible to implement an imagemagick solution for this.
bm5.png
 Description   
 Filesize   21.04 KB
 Viewed   288 Time(s)

bm5.png

bm4.png
 Description   
 Filesize   21.63 KB
 Viewed   292 Time(s)

bm4.png

Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Mon 25 Apr 2016, 11:43    Post subject:  

My script uses the built-in Pale Moon 'print to pdf' dialog.
I use xdotool to automate the saving to pdf.
Code:

rm -rf /root/.bookmarks/bm/temp.pdf
sleep 1
xdotool key "ctrl+l"
xdotool key "ctrl+c"
xdotool key "ctrl+p"
xdotool key "Down"
xdotool key "alt+p"
xdotool key "alt+r"
timestamp() {
date +"%Y-%m-%d_%H:%M:%S"
}

while [[ ! -f /root/.bookmarks/bm/temp.pdf ]]; do
sleep 0.1
done



For this to work properly it needs to be set up once.
I un-installed CUPS so there are no printers and the xdotool auto script will not get confused with the options (it has only one choice - print to file).
Please see the screenshot below which is from the Pale Moon [File > Print] dialog you will need to set yours to the same:
1. 'Print to File'.
2. Name temp.pdf
3. Save in folder bm
4. Output format PDF
5. Copies 1
shot16.jpg
 Description   
 Filesize   34.14 KB
 Viewed   267 Time(s)

shot16.jpg

Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Mon 25 Apr 2016, 16:31    Post subject:  

The screenshot below illustrates the general file and folder layout and shows some of the important files.
It helps when looking at code to know exactly where everything is.
I have tried to keep files with similar file extensions grouped together in folders.

wp = web pages (web page complete).
txt = text files (log files)
sh = bash scripts
pdf = pdf files
img = images (wallpaper .jpg files and other images)
css = cascading style sheets

All this helps to keep it ordered, neat and uncluttered.
At one time all the files were mixed together in one folder, I prefer it like this.
shot17.jpg
 Description   
 Filesize   33.68 KB
 Viewed   255 Time(s)

shot17.jpg

Back to top
View user's profile Send private message 
kjdixo

Joined: 13 Sep 2009
Posts: 121

PostPosted: Mon 25 Apr 2016, 19:08    Post subject:  

The Big Picture
See image below = bookmark and video bookmark folders.
bm0 and bv0 are special, they contain the main index pages where every bookmark or video bookmark is listed.
bm1 and bv1 folders do not exist.
[bm2 to bm27] are the 26 bookmark button folders, they each contain a favicon and an index.html
[bv2 to bv27] are the 26 video bookmark button folders, they each contain a favicon and an index.html
All 52 buttons can be made either hidden or visible.
The 52 folders only function as tagging, button and link listing repositories.

The folders bm and bv are where the script and main storage resides.
All web pages are stored in /root/.bookmarks/bm/wp/ as timestamped 'web page completes'.
All pdfs are stored in /root/.bookmarks/bm/pdf/ as timestamped .pdf files.

All videos are stored in /root/.bookmarks/bv/vid/ as timestamped .mp4 files.
All video thumbnails are stored in /root/.bookmarks/bv/vtn/ as timestamped .jpg files.
shot18.jpg
 Description   
 Filesize   53.19 KB
 Viewed   236 Time(s)

shot18.jpg

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 3 [41 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2182s ][ Queries: 12 (0.0052s) ][ GZIP on ]