@@ -0,0 +1,2063 @@
+#-*- coding: utf-8 -*-%0Aimport urllib2%0Aimport bs4%0Aimport os%0Aimport sys%0Aimport time%0Aimport datetime%0Aimport re%0Areload(sys)%0Asys.setdefaultencoding('utf-8')%0A%0A%0A%0Atarget = sys.argv%5B1%5D%0Aimg_list = %5B%5D%0Ainittime = time.strftime(%22%25Y-%25m-%25d-%25H-%25M-%25S%22, time.localtime())%0A%0Adef get_title(url):%0A    req = urllib2.Request(target, headers=%7B'User-Agent' : %22Magic Browser%22%7D)%0A    content = urllib2.urlopen(req)%0A    soup = bs4.BeautifulSoup(content)%0A    title = soup.title.string%0A    return title%0A%0Adef download_images(title):%0A    print %22Downloading images...%22%0A    for link in img_list:%0A        time.sleep(1.5)%0A        os.system('wget %22%25s%22 -P %22%25s/%22'%25(link,inittime))%0A    print %22Image Downloading Complete.%22%0A    print %22%25d images fetched.%22%25(len(img_list))%0A    os.system('mv %22%25s/%22 %22%25s/%22'%25(inittime, title))%0A%0A    print '%5Cn7z a %22%25s.zip%22 %22%25s/%22%5Cn'%25(title, title)%0A%0A    os.system('7z a %22%25s.zip%22 %22%25s/%22'%25(title, title))%0A    print %22File zip archiving completed.%22%0A    os.system('rm -r %22%25s/%22'%25(title))%0A    print %22Temporal folder erased.%22%0A    print %22Done!%22%0A%0A%0Adef get_html_content(url):%0A    global img_list%0A    req = urllib2.Request(url, headers=%7B'User-Agent' : %22Magic Browser%22%7D)%0A    content = urllib2.urlopen(req)%0A    soup = bs4.BeautifulSoup(content)%0A    %0A%0A    print %22Received a HTML content from %25s%22 %25(url)%0A    img_link = soup.findAll('img')%5B4%5D.get('src')%0A    img_list.append(img_link)%0A    print %22Image url added from %25s%22 %25(img_link)%0A    %0A    for link in soup.find_all('a'):%0A        try:%0A            check = link.find_all('img')%5B0%5D.get('src')%0A        except:%0A            pass%0A        else:%0A            if link.find_all('img')%5B0%5D.get('src') == 'http://ehgt.org/g/n.png':%0A    %09%09    if link.get('href') != url:%0A                        get_html_content(link.get('href'))%0A    %09%09    else:%0A                        print %22End of gallery:%25s%22%25url%0A                        download_images(get_title(target))%0A                        print(%22--- %25s seconds elapsed---%22 %25(time.time() - start_time))%0A                        exit()%0A            else:%0A                pass%0Astart_time = time.time()%0Aget_html_content(target)%0A

Create zcralwer.py