Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'NoneType' object is not subscriptable #11

Open
blairg23 opened this issue May 3, 2021 · 3 comments
Open

TypeError: 'NoneType' object is not subscriptable #11

blairg23 opened this issue May 3, 2021 · 3 comments

Comments

@blairg23
Copy link

blairg23 commented May 3, 2021

When running the program normally, based on the documentation.

OS: Windows 10
Python 3.8
Using GitBash as my terminal

Running for the following users:

{
    "save_directory": "./art",
    "users": [
        "kuvshinov-ilya",
        "guweiz",
        "dominaart",
        "grooooovy",
        "ilikeyoursensitivity",
        "nababa",
        "ni-nig",
        "polkin",
        "raichiyo33",
        "rossdraws",
        "sharpwriter",
        "tsuaii",
        "viccolatte",
        "wlop",
        "trungbui42"
    ]
}

Error Code:

$ python main.py artwork

there are 15 users

download artworks for user kuvshinov-ilya

Traceback (most recent call last):
  File "main.py", line 54, in <module>
    main()
  File "main.py", line 40, in main
    download_users(api, config, args.option)
  File "main.py", line 11, in download_users
    result = api.save_users_artworks(config.users, config.save_dir)
  File "H:\Dropbox\Projects\Python\scrapers\deviantart-scraper\lib\deviantart.py", line 204, in save_users_artworks
    files = self.save_user_artworks(user, dir_path)
  File "H:\Dropbox\Projects\Python\scrapers\deviantart-scraper\lib\deviantart.py", line 180, in save_user_artworks
    files = pool.map(partial(self.save_artwork, dir_path), artworks)
  File "C:\Users\<username>\AppData\Local\Programs\Python\Python38-32\lib\multiprocessing\pool.py", line 364, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "C:\Users\<username>\AppData\Local\Programs\Python\Python38-32\lib\multiprocessing\pool.py", line 771, in get
    raise self._value
  File "C:\Users\<username>\AppData\Local\Programs\Python\Python38-32\lib\multiprocessing\pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "C:\Users\<username>\AppData\Local\Programs\Python\Python38-32\lib\multiprocessing\pool.py", line 48, in mapstar
    return list(map(*args))
  File "H:\Dropbox\Projects\Python\scrapers\deviantart-scraper\lib\deviantart.py", line 154, in save_artwork
    download_url = self._download_url(artwork)
  File "H:\Dropbox\Projects\Python\scrapers\deviantart-scraper\lib\deviantart.py", line 110, in _download_url
    return re.search(r'href="(https://www.deviantart.com/download/.+?)"', html)[1]
TypeError: 'NoneType' object is not subscriptable

@BachoSeven
Copy link

I'm also seeing the type error on Linux(arch)

@mitar
Copy link

mitar commented Nov 6, 2021

It seems download link is not available anymore if you just blindly fetch the HTML. So regex trying to find it does not work anymore. I think there is some protection in place.

@mitar
Copy link

mitar commented Nov 6, 2021

I made this MR: #12 but I think it is best to simply use https://github.com/mikf/gallery-dl, which seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants