how to resume download in wget which is integrated with firefox via flashgot

I use wget as a downloader. It is an excellent, outstanding application. I integrated it with Firefox using Flashgot.

How can I resume a download which was stopped by a CTRL+C key press or a shutdown in this configuration of wget?


Solution 1:

I does not need any other download manager if i could pause and resume download

You started a file download in wget using flashgot plugin. As wget didn't remember last activity (and you are not from terminal and no bash history) normally you can't resume the download unless you provide a correct URI with -c in wget.

case 1: Download cancel by Ctrl C
Open with a text editor /tmp/flashgot.*******.default/flashgot-*.fgt
At the end of file you can see like

"wget" --trust-server-names -c -O jre-7u21-linux-x64.rpm --directory-prefix=/home/totti/Downloads --referer=http://java.com/en/download/linux_manual.jsp\?locale=en --load-cookies=/tmp/flashgot.7gavixy1.default/cookies --header=Cookie:s_vi=[CS]v1\|28BA8A90050109CA-6000011540153427[CE]\;\ --user-agent=Mozilla/5.0\ (X11\;\ Ubuntu\;\ Linux\ i686\;\ rv:16.0)\ Gecko/20100101\ Firefox/16.0 http://sdlc-esd.sun.com/ESD6/JSCDL/jdk/7u21-b11/jre-7u21-linux-x64.rpm\?AuthParam=1366627766_80a413ae29c4b4d2e12ac7e334d61847\&GroupName=JSC\&FilePath=/ESD6/JSCDL/jdk/7u21-b11/jre-7u21-linux-x64.rpm\&File=jre-7u21-linux-x64.rpm\&BHost=javadl.sun.com

either copy the whole parameter and pass it to wget as wget --trust-server-names -c -O jre-7u21-linux-x64.rpm --directory-prefix=/home/totti/Downloads --referer=http://java.com/en/download/linux_manual.jsp\?locale=en --load-cookies=/tmp/flashgot.7gavixy1.default/cookies --header=Cookie:s_vi=\[CS\]v1\|28BA8A90050109CA-6000011540153427\[CE\]\;\ --user-agent=Mozilla/5.0\ \(X11\;\ Ubuntu\;\ Linux\ i686\;\ rv:16.0\)\ Gecko/20100101\ Firefox/16.0 http://sdlc-esd.sun.com/ESD6/JSCDL/jdk/7u21-b11/jre-7u21-linux-x64.rpm\?AuthParam=1366627766_80a413ae29c4b4d2e12ac7e334d61847\&GroupName=JSC\&FilePath=/ESD6/JSCDL/jdk/7u21-b11/jre-7u21-linux-x64.rpm\&File=jre-7u21-linux-x64.rpm\&BHost=javadl.sun.com
or just use wget -c URI

case 2: Shutdown
This is a bad thing as /tmp is cleared every shutdown. You have to find the URI manually. Another option is, before start downloading change temp dir for flashgot from preference -> advanced -> temp directory to a persistent folder (say ~/tmp).

Updates:
403 forbidden error
Because some URI are dynamically generated. So after some time it expire(after closing connection to the site). In such cases you have to obtain a new URI and download can be resumed using wget -c URI. Some cases the file name are also dynamic (or no file name at all), so -o filenameofexistingfile option is also needed.
Note that wget is a download manager not a video downloader. So use of a video downloader such as flareget JDownloader or plugin for your browser such as savefromnet, video download helper is prefered. Because they automate the process of obtaining new URI from the URL. See question how to download youtube video (search) for easyly download videos.

Solution 2:

Wget can resume downloading partially-downloaded files with -c option. Flashgot by default calls wget with -c option so it's already enabled. You can check it in System Monitor while wget is downloading:

enter image description here

Wget will only be able to resume download if the server you're downloading form supports it and partially-downloaded file resides in the same directory where wget is downloading. For more details on this:

man wget

For URL list support checkout this article: Make Wget cater to your needs

On a side note, I will suggest you to give a try to Download Them All. It has all the features you can ask for in a download manager.