Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
Out of question's scope but related. Have you tried Downloadthem all extension ? You dont need anything else. –  mac Apr 25 '13 at 6:46
    
If you mean 'Downthemall', then i tried it. It is nothing compared to wget. –  001neeraj Apr 25 '13 at 6:56

2 Answers 2

up vote 7 down vote accepted
+50

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.

share|improve this answer
    
It perfectly worked for me. I have been seeking for this answer for two months. Thank you very much.. Can i clarify one more doubt with your help? ie; Why can't i use wget's command line arguments which was taken by the command : xargs -0 echo < /proc/<pid_of_wget>/cmdline –  001neeraj Apr 23 '13 at 4:57
    
Also, why ther are flashgot-1.fgt, flashgot-2.fgt, flashgot-3.fgt, etc in that folder?? –  001neeraj Apr 23 '13 at 5:12
    
One more..I changed the tmp folder as you suggested. But some times it shows: ERROR 403: Forbidden (usually after a restart) –  001neeraj Apr 23 '13 at 7:06
    
Comment 1: Why u can't use ? question not clear. May be the URI contain special char that interfere with terminal. –  totti Apr 25 '13 at 9:27
    
Comment 2: flashgot-1.fgt for 1'st download by flashgot, flashgot-2.fgt is the 2nd. So the last one will be the one u want. Search ffrom last. –  totti Apr 25 '13 at 9:28

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.

share|improve this answer
    
1.I don't like to use DTA, because i had already used it. In my opinion wget is the best. I have installed many GUIs for wget including gwget. None of them are up to the mark. –  001neeraj Apr 20 '13 at 18:41
    
2. I can resume my download if i started wget my own by starting a terminal and type the commands(Whenever i need to resume, just re-enter those line in terminal). But, in the above situation, i don't know the URL associated with it and argument used. –  001neeraj Apr 20 '13 at 18:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.