def __init__(self,log=1): self.log=log self.flock=lib_TheardPool2.getlock()
def __init__(self, log=1): self.log = log self.flock = lib_TheardPool2.getlock()
import pycurl import os import sys import StringIO import urllib2 import lib_TheardPool2 import lib_func import shutil import gzip import urlparse import re import math flock=lib_TheardPool2.getlock() curlopts={pycurl.USERAGENT:"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0",\ pycurl.HTTPHEADER:["Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",\ "Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",\ "Accept-Encoding: gzip, deflate",\ "Connection: keep-alive"] } class bmdownload: """blackmoon download class""" def __init__(self,log=1): self.log=log self.flock=lib_TheardPool2.getlock() def download(self,address,savepath,savename="",opts={},thread=1): if not address: lib_func.printstr("You should input vaild urls",2) return
import pycurl import os import sys import StringIO import urllib2 import lib_TheardPool2 import lib_func import shutil import gzip import urlparse import re import math flock = lib_TheardPool2.getlock() curlopts={pycurl.USERAGENT:"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0",\ pycurl.HTTPHEADER:["Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",\ "Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",\ "Accept-Encoding: gzip, deflate",\ "Connection: keep-alive"] } class bmdownload: """blackmoon download class""" def __init__(self, log=1): self.log = log self.flock = lib_TheardPool2.getlock() def download(self, address, savepath, savename="", opts={}, thread=1): if not address: lib_func.printstr("You should input vaild urls", 2)