[PYTHON] [Small story] Download the image of Ghibli immediately

* It's not a big deal. It is a "small story" only for now. </ font>

Images of scenes from several works are now available for download on the Studio Ghibli site.

From this month, we will start providing scene photos of Studio Ghibli works

I thought I would download it because there are various uses such as backgrounds such as zoom and AI style conversion, but it was troublesome to download each one by hand, so I wrote it in Python.

Source

import urllib

works = ["marnie", #When Marnie Was There
         "kaguyahime", #The story of Princess Kaguya
         "kazetachinu", #The Wind Rises
         "kokurikozaka", #From Coquelicot-zaka
         "karigurashi", #Borrower Arrietty
         "ponyo", #Ponyo on the cliff
         "ged", #Tales from Earthsea
         "chihiro"] #Spirited Away

url_base = "http://www.ghibli.jp/gallery/"
local_base = "C:/Users/hogehoge/Desktop/ghibli/"
ext = ".jpg "

for work in works:
    for i in range(50):
        name = work + str(i+1).zfill(3)
        url = url_base + name + ext
        local = local_base + name + ext
        
#        print(url)
#        print(local)

        urllib.request.urlretrieve(url,local)

Yes. It is a power technique. The title of the work should be scraped, but the number was small (8 works), so I made it by hand. When there are more, let's scrape properly. It seems that you should hook it with "class =" panelarea "" and extract it from the href character string.

  • If you feel like it, you may rewrite the source at a later date.

Notes

It says, "Please use it freely within the range of common sense." So let's use it within the range of common sense.

Recommended Posts

[Small story] Download the image of Ghibli immediately
The story of sys.path.append ()
Image processing? The story of starting Python for
The story of building Zabbix 4.4
[Apache] The story of prefork
The story of Python and the story of NaN
The story of participating in AtCoder
The story of the "hole" in the file
[Memo] Small story of pandas, numpy
Judge the extension and download the image
The story of remounting the application server
The story of writing a program
Download the top n Google image searches
The story of trying to reconnect the client
The story of verifying the open data of COVID-19
The story of adding MeCab to ubuntu 16.04
The story of making Python an exe
The story of making an immutable mold
The story of manipulating python global variables
The story of trying deep3d and losing
The story of deciphering Keras' LSTM model.predict
The story of blackjack A processing (python)
The story of pep8 changing to pycodestyle
The story of doing deep learning with TPU
Download the image from the text file containing the URL
I tried to correct the keystone of the image
The story of making a lie news generator
The story of finding the optimal n in N fist
The story of reading HSPICE data in Python
The story of trying Sourcetrail × macOS × VS Code
[Small story] Test image generation with Python / OpenCV
The story of moving from Pipenv to Poetry
Download the wind data of the Japan Meteorological Agency
[Python + OpenCV] Whiten the transparent part of the image
A story about improving the program for partial filling of 3D binarized image data
Image of closure
The story of launching a Minecraft server from Discord
A story that reduces the effort of operation / maintenance
Extract the table of image files with OneDrive & Python
The story of Python without increment and decrement operators.
The story of stopping the production service with the hostname command
The story of replacing Nvidia GTX 1650 with Linux Mint 20.1.
The story of building the fastest Linux environment in the world
The story of Hash Sum mismatch caused by gcrypto20
The story of sharing the pyenv environment with multiple users
Get the image of "Suzu Hirose" by Google image search.
The story of making a music generation neural network
The story of FileNotFound in Python open () mode ='w'
Story of image analysis of PDF file and data extraction
A story about changing the master name of BlueZ
The story that the return value of tape.gradient () was None
Zip 4 Gbyte problem is a story of the past
A story that analyzed the delivery of Nico Nama.
AttributeError: The story of solving module'tensorflow' has no attribute'log'.
The story of automatic language conversion of TypeScript / JavaScript / Python
The story of wanting to buy Ring Fit Adventure
The story of using circleci to build manylinux wheels