Hey sorry had to step out.
So what i think would be the easiest would be to have the "wget section" instead point back to the orginal /usr/lib/apt/methods/http.save.
So any one can tell me what to put.
Code:
#!/usr/bin/python
import httplib
import urlparse
import sys
import os
url=urlparse.urlsplit(sys.argv[1])
conn = httplib.HTTP(url[1])
conn.putrequest("HEAD", url[2])
conn.putheader("HOST",url[1]);
conn.endheaders();
errcode,errmsg,headers = conn.getreply()
#f = open("/tmp/test.log","a")
#f.write("File : " + url[1] + " " + url[2] + "\n");
#f.write("Status Code : " + str(errcode) + "\n")
if (errcode!=200 and errcode!=301) :
if (errcode==404):
sys.exit(15)
sys.exit(errcode)
try:
size = int(headers["Content-Length"])
except KeyError:
size = 101*1024
#f.write("Size : " + str(size) + "\n");
if (size<=(100*1024)):
# f.write("wget " + url[2] + " " + str(size)+"\n")
os.system("wget -c -O " + sys.argv[2] + " " + sys.argv[1])
else :
count = int(size)/(10*1024)
if (count>50):
count=50
# f.write("axel " + url[2] + "\n" )
os.system("axel -n " + str(count) + " -o " + sys.argv[2] + " " + sys.argv[1])
#f.close()
Bookmarks