Skip to content

Commit

Permalink
爬取中文版书籍图片
Browse files Browse the repository at this point in the history
  • Loading branch information
tkchu committed Dec 16, 2016
1 parent 7960a8a commit 86b2c24
Show file tree
Hide file tree
Showing 207 changed files with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions douban.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- coding:utf8 -*-
"""
获取douban上某书籍的封面图片
"""

import re
import urllib2
import csv

IMAGE_PATH = "./images-zh-cn/"

def get_image_from_douban(book_url, image_filename):
print book_url
response = urllib2.urlopen(book_url)
html = response.read()
re_image_url = r"https://img\d\.doubanio\.com/lpic/s\d*\.jpg"
image_url = re.search(re_image_url, html).group()
with open(image_filename, 'w') as ft:
response = urllib2.urlopen(image_url)
image = response.read()
ft.write(image)

if __name__ == '__main__':
with open("zh-cn.csv", 'r') as ff:
spamreader = csv.reader(ff, delimiter=',')
for line in spamreader:
print line
indexString, _, _, _, _, _, douban_url = line
if re.match(r'^https?:/{2}\w.+$', douban_url):
image_filename = IMAGE_PATH + indexString + ".jpg"
get_image_from_douban(douban_url, image_filename)
Binary file added images-zh-cn/3denginedesignvirtualglobes.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/3dgameenginearchitecture.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/3dgpdx12.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/3dgpforkids.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/3dmathprimer2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/CC-BY-SA_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/advancedgi2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/advancedgp.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/advancedprogunixenv3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/adventuresinminecraft.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/agilesoftwaredev.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/agumentedreality.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/aiforgames2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/aiforgd.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/aigpwisdom.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/aigpwisdom2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/aigpwisdom3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/aigpwisdom4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/aima3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/algorithms4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/androidndkgdcookbook.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/apidesignforcpp.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/beginninggp.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/behavioralmathforgameai.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/blinn1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images-zh-cn/blinn2.jpg
Binary file added images-zh-cn/blinn3.jpg
Binary file added images-zh-cn/blueprintsvisualscripting.jpg
Binary file added images-zh-cn/boostcpplibraries2.jpg
Binary file added images-zh-cn/buildingfpsgameunity.jpg
Binary file added images-zh-cn/caaqa5.jpg
Binary file added images-zh-cn/cgpp3.jpg
Binary file added images-zh-cn/characteranimation.jpg
Binary file added images-zh-cn/cleancode.jpg
Binary file added images-zh-cn/clrs3.jpg
Binary file added images-zh-cn/clrviacsharp4.jpg
Binary file added images-zh-cn/cocos2dxbyexample2.jpg
Binary file added images-zh-cn/codecomplete2.jpg
Binary file added images-zh-cn/codinggamesinscratch.jpg
Binary file added images-zh-cn/collisiondetection3denv.jpg
Binary file added images-zh-cn/computationalgeometry.jpg
Binary file added images-zh-cn/computationalscieng.jpg
Binary file added images-zh-cn/computeranimation3.jpg
Binary file added images-zh-cn/concretemaths2.jpg
Binary file added images-zh-cn/cppcodingstandard.jpg
Binary file added images-zh-cn/cppconcurrencyinaction.jpg
Binary file added images-zh-cn/cppprimer5.jpg
Binary file added images-zh-cn/cppstandardlibrary2.jpg
Binary file added images-zh-cn/cpptemplates.jpg
Binary file added images-zh-cn/crossplatformgp.jpg
Binary file added images-zh-cn/csapp3.jpg
Binary file added images-zh-cn/csharpindepth3.jpg
Binary file added images-zh-cn/designinguxgamedevtools.jpg
Binary file added images-zh-cn/designpatterns.jpg
Binary file added images-zh-cn/digitalimageprocessing3.jpg
Binary file added images-zh-cn/divgradcurl4.jpg
Binary file added images-zh-cn/effectivecpp3.jpg
Binary file added images-zh-cn/effectivemoderncpp.jpg
Binary file added images-zh-cn/effectivestl.jpg
Binary file added images-zh-cn/elementsofprogramming.jpg
Binary file added images-zh-cn/essentialmaths3.jpg
Binary file added images-zh-cn/exceptionalcpp.jpg
Binary file added images-zh-cn/exceptionalcppstyle.jpg
Binary file added images-zh-cn/fluidsimulationforcg2.jpg
Binary file added images-zh-cn/foundationsgedmath.jpg
Binary file added images-zh-cn/frommathtogeneric.jpg
Binary file added images-zh-cn/fundamentalscg4.jpg
Binary file added images-zh-cn/gameaipro.jpg
Binary file added images-zh-cn/gameaipro2.jpg
Binary file added images-zh-cn/gameaudioprogramming.jpg
Binary file added images-zh-cn/gamecodingcomplete4.jpg
Binary file added images-zh-cn/gamedevtools.jpg
Binary file added images-zh-cn/gameenginearchitecture2.jpg
Binary file added images-zh-cn/gameenginedesign2.jpg
Binary file added images-zh-cn/gameenginegems1.jpg
Binary file added images-zh-cn/gameenginegems2.jpg
Binary file added images-zh-cn/gameenginegems3.jpg
Binary file added images-zh-cn/gameik.jpg
Binary file added images-zh-cn/gamephysics2.jpg
Binary file added images-zh-cn/gamephysicsenginedev2.jpg
Binary file added images-zh-cn/gamephysicspearls.jpg
Binary file added images-zh-cn/gameprogrammingpatterns.jpg
Binary file added images-zh-cn/gamescriptingmastery.jpg
Binary file added images-zh-cn/garbagecollectionhandbook.jpg
Binary file added images-zh-cn/geometricalgebra.jpg
Binary file added images-zh-cn/geometrictools.jpg
Binary file added images-zh-cn/gettingstartedcppaudio.jpg
Binary file added images-zh-cn/glassenernotebook1.jpg
Binary file added images-zh-cn/glassenernotebook2.jpg
Binary file added images-zh-cn/glsl3.jpg
Binary file added images-zh-cn/gpalgorithmstechniques.jpg
Binary file added images-zh-cn/gpgems.jpg
Binary file added images-zh-cn/gpgems2.jpg
Binary file added images-zh-cn/gpgems3.jpg
Binary file added images-zh-cn/gpgems4.jpg
Binary file added images-zh-cn/gpgems5.jpg
Binary file added images-zh-cn/gpgems6.jpg
Binary file added images-zh-cn/gpgems7.jpg
Binary file added images-zh-cn/gpgems8.jpg
Binary file added images-zh-cn/gpgemsbest.jpg
Binary file added images-zh-cn/gpgoldenrules.jpg
Binary file added images-zh-cn/gpgpu.jpg
Binary file added images-zh-cn/gpugems.jpg
Binary file added images-zh-cn/gpugems2.jpg
Binary file added images-zh-cn/gpugems3.jpg
Binary file added images-zh-cn/gpupro.jpg
Binary file added images-zh-cn/gpupro2.jpg
Binary file added images-zh-cn/gpupro3.jpg
Binary file added images-zh-cn/gpupro4.jpg
Binary file added images-zh-cn/gpupro5.jpg
Binary file added images-zh-cn/gpupro6.jpg
Binary file added images-zh-cn/gpupro7.jpg
Binary file added images-zh-cn/graphicsgems.jpg
Binary file added images-zh-cn/graphicsgems2.jpg
Binary file added images-zh-cn/graphicsgems3.jpg
Binary file added images-zh-cn/graphicsgems4.jpg
Binary file added images-zh-cn/graphicsgems5.jpg
Binary file added images-zh-cn/graphicsprogrammingmethods.jpg
Binary file added images-zh-cn/graphicsshaders2.jpg
Binary file added images-zh-cn/hackersdelight2.jpg
Binary file added images-zh-cn/headfirstdesignpatterns.jpg
Binary file added images-zh-cn/helpyoukidswithcomputercoding.jpg
Binary file added images-zh-cn/imperfectcpp.jpg
Binary file added images-zh-cn/insidecppobjectmodel.jpg
Binary file added images-zh-cn/introtogdprodev.jpg
Binary file added images-zh-cn/inventgamepython3.jpg
Binary file added images-zh-cn/isosurfaces.jpg
Binary file added images-zh-cn/languageimplpatterns.jpg
Binary file added images-zh-cn/learninguegd.jpg
Binary file added images-zh-cn/learntoprogramwithminecraft.jpg
Binary file added images-zh-cn/learntoprogramwithscratch.jpg
Binary file added images-zh-cn/linuxnetworkinternals.jpg
Binary file added images-zh-cn/linuxsystemprog2.jpg
Binary file added images-zh-cn/lod.jpg
Binary file added images-zh-cn/luaprogramminggems.jpg
Binary file added images-zh-cn/magiccg.jpg
Binary file added images-zh-cn/makinggamespython.jpg
Binary file added images-zh-cn/massivelymultiplayergd.jpg
Binary file added images-zh-cn/massivelymultiplayergd2.jpg
Binary file added images-zh-cn/math3dcpcg3.jpg
Binary file added images-zh-cn/moderncppdesign.jpg
Binary file added images-zh-cn/modernx86assembly.jpg
Binary file added images-zh-cn/moreeffectivecpp.jpg
Binary file added images-zh-cn/moreeffectivecpp3.jpg
Binary file added images-zh-cn/moreexceptionalcpp.jpg
Binary file added images-zh-cn/mos4.jpg
Binary file added images-zh-cn/multiplayergp.jpg
Binary file added images-zh-cn/mvcsharpstepbystep8.jpg
Binary file added images-zh-cn/mythicalmanmonth2.jpg
Binary file added images-zh-cn/natureofcode.jpg
Binary file added images-zh-cn/npcg.jpg
Binary file added images-zh-cn/npr.jpg
Binary file added images-zh-cn/ogles3guide2.jpg
Binary file added images-zh-cn/oglguide9.jpg
Binary file added images-zh-cn/oglinsights.jpg
Binary file added images-zh-cn/oglsuper7.jpg
Binary file added images-zh-cn/ooadwa3.jpg
Binary file added images-zh-cn/optimizedcpp.jpg
Binary file added images-zh-cn/pbrt3.jpg
Binary file added images-zh-cn/pdis.jpg
Binary file added images-zh-cn/physicsbasedanimation.jpg
Binary file added images-zh-cn/physicsforgamedevelopers2.jpg
Binary file added images-zh-cn/physicsforgameprogrammers.jpg
Binary file added images-zh-cn/physicsmodeling.jpg
Binary file added images-zh-cn/polygonmeshprocessing.jpg
Binary file added images-zh-cn/practiald3d11.jpg
Binary file added images-zh-cn/practicalaugmentedreality.jpg
Binary file added images-zh-cn/practiceofprogramming.jpg
Binary file added images-zh-cn/productionvolumerendering.jpg
Binary file added images-zh-cn/proggameaibyexample.jpg
Binary file added images-zh-cn/progposixthreads.jpg
Binary file added images-zh-cn/programminginlua4.jpg
Binary file added images-zh-cn/raytracingfromgroundup.jpg
Binary file added images-zh-cn/realtimeshadows.jpg
Binary file added images-zh-cn/refactoring.jpg
Binary file added images-zh-cn/rt3dcharacteranimation.jpg
Binary file added images-zh-cn/rt3drendering.jpg
Binary file added images-zh-cn/rtcameras.jpg
Binary file added images-zh-cn/rtcollisiondetection.jpg
Binary file added images-zh-cn/rtr3.jpg
Binary file added images-zh-cn/rtvolumegraphics.jpg
Binary file added images-zh-cn/scratchjr.jpg
Binary file added images-zh-cn/sicp2.jpg
Binary file added images-zh-cn/superscratchprogadv.jpg
Binary file added images-zh-cn/taofluidanimation.jpg
Binary file added images-zh-cn/tcpipillustratedv1_2.jpg
Binary file added images-zh-cn/tcpipillustratedv2.jpg
Binary file added images-zh-cn/tcpipillustratedv3.jpg
Binary file added images-zh-cn/tcpl2.jpg
Binary file added images-zh-cn/tcpppl4.jpg
Binary file added images-zh-cn/texturingmodeling3.jpg
Binary file added images-zh-cn/tricks3dgpgurus.jpg
Binary file added images-zh-cn/umldistilled3.jpg
Binary file added images-zh-cn/umluserguide2.jpg
Binary file added images-zh-cn/unity5gameoptimization.jpg
Binary file added images-zh-cn/unityaigp2.jpg
Binary file added images-zh-cn/unityinaction.jpg
Binary file added images-zh-cn/unityvrprojects.jpg
Binary file added images-zh-cn/unixnetworkprogv1_3.jpg
Binary file added images-zh-cn/unixnetworkprogv2_2.jpg
Binary file added images-zh-cn/vectorgamemathprocessors.jpg
Binary file added images-zh-cn/videogameoptimization.jpg
Binary file added images-zh-cn/visualizingquaternions.jpg
Binary file added images-zh-cn/vulkanguide.jpg
Binary file added images-zh-cn/windowsgp2.jpg
Binary file added images-zh-cn/workingeffectivelylegacycode.jpg

0 comments on commit 86b2c24

Please sign in to comment.