pixiv downloader 20120224

Change log:

  • Fix filename sanitazion, replace tab character with space as reported by asm_demon.
  • Source code formatting.
  • Fix sanitizeFilename method for non-windows os as reported by Joe.
  • Fix Mechanize ‘req._tunnel_host = None’ if no proxy used as reported by Joe.
  • Add new filenameFormat metatag as requested by Yanoflies.
    • %works_date%   ==> works date, complete with time.
    • %works_date_only% ==> only the works date.
    • %works_res%    ==> image resolution, will be containing the page count if manga.
    • %works_tools%  ==> tools used for the image.
  • Update unittest.

Download link here, source code here or in my github.

20 thoughts on “pixiv downloader 20120224”

  1. Hello, I’d like to know if there is any way for you to implement a feature like this:

    I’d like to download x tag to x folder, and on the same instance, to download y tag to y folder. Normally what I do is just run two instances, but I’d like to ask just in case.

    1. On the same time will be quite hard because the program need to track what is the current tag and the tag-path list to check.
      If sequentiality (tag x done, continue with tag y, using tags.txt), probably can make it, but need some format changes in the tags.txt to differentiate the tag to search and the path name, or I can just make the search tags as the root path name.

      1. Even sequentiality would be fine. It’s mostly something to not have to run multiple instances.

  2. Hi there, small issue with the Title/Caption option:


    Input: 9
    Title/Caption: test
    Start Page (default=1):
    End Page (default=0, 0 for no limit):
    Start Date [YYYY-MM-DD]:
    End Date [YYYY-MM-DD]:
    Traceback (most recent call last):
    File “PixivUtil2.py”, line 1208, in main
    File “PixivUtil2.py”, line 954, in menuDownloadByTitleCaption
    TypeError: processTags() got an unexpected keyword argument ‘wildcard’
    press enter to exit.



  3. Could you add command line option that allows downloader to start hidden? So something like bat file “pixivutil2.exe -s 4 -c -x” in autorun will make it update listed users and shut down without alerting or distracting users. When cookie is walid/pass is in config file. Obviously, if it could not log in, it should notify user.

    1. Just create a file named list.txt containing the member_id on the folder where PixivUtil extracted. See readme.txt for more details.

  4. Hi I am having a little issue here regarding list download, this is my error:

    Found 1 items.
    Processing Member Id: 118535
    Reading config file… done.
    Page 1
    Member Name : 夏の紅茶
    Member Avatar: http://img11.pixiv.net/profile/triton_kabura/2479656.png
    Member Token : triton_kabura
    Start downloading…Traceback (most recent call last):
    File “PixivUtil2.py”, line 131, in downloadImage
    File “os.pyc”, line 150, in makedirs
    File “os.pyc”, line 150, in makedirs
    File “os.pyc”, line 150, in makedirs
    File “os.pyc”, line 150, in makedirs
    File “os.pyc”, line 150, in makedirs
    File “os.pyc”, line 150, in makedirs
    File “os.pyc”, line 150, in makedirs
    File “os.pyc”, line 150, in makedirs
    File “os.pyc”, line 157, in makedirs
    WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: u’K:\K:’
    1 2

    And my list file which just has a single entry:

    118535 “K:DOWNLOADSPIXIVLIST118535_natsu_no_kocha”


      1. Hi thanks for the quick response.

        I’ve another issue here, I’m trying to run pixivutil via the command prompt + arguments e.g.:

        “K:PixivutilPixivUtil2.exe” -s 3 TAG1 TAG2

        And this is the error message I’ve got:

        logging in
        Trying to log with saved cookie
        Traceback (most recent call last):
        File “PixivUtil2.py”, line 1195, in main
        File “PixivUtil2.py”, line 939, in menuDownloadByTags
        UnboundLocalError: local variable ‘wildcard’ referenced before assignment
        press enter to exit.

        The reason I’m doing this is that I’m having several batch files running for different collection of tags scheduled to run at different times. I wasn’t aware of the addition of the wildcard and/or start-end date range and suspect that it was causing this. It was a huge leap for me from version 20111028, which works fine for me.

  5. Thank you very much. Really appreciate the addition, this is an invaluable little piece of program.

  6. Thanks for all the hard work!

    I was wondering if you could put an option to do a reverse-order download? I have over 500 artists bookmarked on pixiv (which makes your program invaluable); sometimes I don’t have the time to go through all the pictures an artist has. I’ve been using the checkupdatedlimit line in config.ini to speed up the download, but this only checks from the most recent pictures. Is it possible to start from the oldest picture and work your way up in reverse?


  7. i want to ask, how i can download from 3dbooru, because its always show 403: Forbidden ?

  8. It worked ! I mean the things you suggested first…
    Actually i was working with a different list, from a different downloadlistdirectory path, after i noticed it and made the changes it worked 🙂 (i didn’t use the -1 trick)
    Thanks for the patience!

  9. Hi there! i have a little problem downloading from the list (list.txt), the following message appears every time i try to execute input number 4:

    “Processing from list file
    Error at processList: <, ValueError<"invalid lit
    eral for int with base 10: ´´”,>, >
    Traceback :
    File “PixivUtil2.py” line 1189, in main
    File “PixivUtil2.py” line 951, in menuDownLoadFromList
    File “PixivUtil2.py” line 284, in processList
    File “PixivModel.pyc” line 296, in parseList
    ValueError: invalid literal for int with base 10: ´´
    press enter to exit.”

    It’s been a long time since i last used pixivutil, and maybe i’m making a mistake, could you please help me? the config.ini is configured in the following way:

    proxyaddress =
    useproxy = False
    useragent = Mozilla/5.0 (X11; U; Unix i686; en-US; rv: Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1
    debughttp = False
    userobots = True
    filenameformat = %artist% (%member_id%)%image_id% – %title%
    timeout = 60
    uselist = False
    processfromdb = False
    overwrite = False
    tagsseparator = ,
    daylastupdated = 0
    rootdirectory = C:UsersPcDocumentsTextPixiv
    retry = 3
    retrywait = 5
    createdownloadlists = True
    downloadlistdirectory = C:UsersPcDocumentsTextPixivdownloadlistdirectory
    irfanviewpath = C:Program FilesIrfanView
    startirfanview = False
    startirfanslide = False
    alwayscheckfilesize = False
    checkupdatedlimit = 0
    downloadavatar = True
    createmangadir = False

    Aside from that, thanks for the hard work on these life-saving app!

      1. Tried that too, here’s my list:


        #other members id


        Is it necessary to put the directory for each id or is there a specific way (through the app) to create the list.txt file?

        1. No, mine is only containing the member id (only number), try to use number in the first line, or maybe just put -1 for the first line.

Comments are closed.