kent-lee / pixiv-scraper

personal project for downloading artworks from Pixiv
39 stars 5 forks source link

Crash while trying to log in #4

Open Muha0644 opened 2 years ago

Muha0644 commented 2 years ago

So basically when I tried to run python main.py artwork, it crashed. This is the error it threw:

Traceback (most recent call last):
  File "/home/muha0644/pixiv-scraper/main.py", line 67, in <module>
    main()
  File "/home/muha0644/pixiv-scraper/main.py", line 46, in main
    download_users(api, config, args.option)
  File "/home/muha0644/pixiv-scraper/main.py", line 9, in download_users
    api.login(config.username, config.password)
  File "/home/muha0644/pixiv-scraper/lib/pixiv.py", line 33, in login
    post_key = re.search(r"post_key\" value=\"(.*?)\">", res.text)[1]
TypeError: 'NoneType' object is not subscriptable

The fix was simple, I just removed the [1] from that line and it seems to work, although that is because it doesn't log you in... I am using Arch Linux, and everything is updated to the latest version as of posting this issue.

AK3847 commented 6 months ago

Thanks for the quick fix, was getting the same error when running on windows 11.