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

[BUG] TypeError: 'NoneType' object is not subscriptable #495

Closed
JackalvonX opened this issue Jul 19, 2021 · 0 comments
Closed

[BUG] TypeError: 'NoneType' object is not subscriptable #495

JackalvonX opened this issue Jul 19, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@JackalvonX
Copy link

  • [x ] I am reporting a bug.
  • [x ] I am running the latest version of BDfR
  • [x ] I have read the Opening an issue

Description

When downloading your upvoted posts the program exits with error "TypeError: 'NoneType' object is not subscriptable" if it comes across a gallery post that has been removed. An example of a removed post that causes this is: https://www.reddit.com/gallery/n0pyzp . See logs.

The only workaround I've found is to go to that post and remove your upvote from it. I found a similar issue here: #214 .

Command

python3 -m bdfr download --authenticate --user me --upvoted --time-format %Y%m%d --file-scheme "{DATE}-{TITLE}-[{POSTID}]" --folder-scheme Upvoted --no-dupes "D:\r.Realmlist\Variety Pack\[Reddit]"

Environment (please complete the following information):

  • OS: Windows 10 Pro Version 21H1 Build 19043.1083
  • Python version: 3.9.6

Logs

[2021-07-18 20:20:49,539 - bdfr.downloader - DEBUG] - Attempting to download submission n0zmjm
[2021-07-18 20:20:49,539 - bdfr.downloader - DEBUG] - Using Direct with url https://i.imgur.com/uIxxCdk.jpg
[2021-07-18 20:20:49,838 - bdfr.downloader - DEBUG] - Written file to D:\r.Realmlist\Variety Pack\[Reddit]\Upvoted\20210429-Black Widow (White) by Xkalty-[n0zmjm].jpg
[2021-07-18 20:20:49,838 - bdfr.downloader - DEBUG] - Hash added to master list: 9d0b436042e522796f0a1f4edf330cbc
[2021-07-18 20:20:49,838 - bdfr.downloader - INFO] - Downloaded submission n0zmjm from cosplaygirls
[2021-07-18 20:20:49,840 - bdfr.downloader - DEBUG] - Attempting to download submission n0dp1b
[2021-07-18 20:20:49,840 - bdfr.downloader - DEBUG] - Using Gallery with url https://www.reddit.com/gallery/n0dp1b
[2021-07-18 20:20:50,220 - bdfr.file_name_formatter - Level 9] - Formatting filename with index 1
[2021-07-18 20:20:50,222 - bdfr.file_name_formatter - Level 9] - Formatting filename with index 2
[2021-07-18 20:20:50,225 - bdfr.file_name_formatter - Level 9] - Formatting filename with index 3
[2021-07-18 20:20:50,226 - bdfr.file_name_formatter - Level 9] - Formatting filename with index 4
[2021-07-18 20:20:50,228 - bdfr.file_name_formatter - Level 9] - Formatting filename with index 5
[2021-07-18 20:20:50,230 - bdfr.file_name_formatter - Level 9] - Formatting filename with index 6
[2021-07-18 20:20:50,232 - bdfr.file_name_formatter - Level 9] - Formatting filename with index 7
[2021-07-18 20:20:50,234 - bdfr.file_name_formatter - Level 9] - Formatting filename with index 8
[2021-07-18 20:20:50,283 - bdfr.downloader - DEBUG] - Written file to D:\r.Realmlist\Variety Pack\[Reddit]\Upvoted\20210428-Coralea Jade as Mikasa Ackerman-[n0dp1b]_1.jpg
[2021-07-18 20:20:50,284 - bdfr.downloader - DEBUG] - Hash added to master list: 317ea5bbaa2f2671dcb463ad9f92bb6e
[2021-07-18 20:20:50,341 - bdfr.downloader - DEBUG] - Written file to D:\r.Realmlist\Variety Pack\[Reddit]\Upvoted\20210428-Coralea Jade as Mikasa Ackerman-[n0dp1b]_2.jpg
[2021-07-18 20:20:50,341 - bdfr.downloader - DEBUG] - Hash added to master list: 993abbdd204239d27ea53f75ca90d76f
[2021-07-18 20:20:50,376 - bdfr.downloader - DEBUG] - Written file to D:\r.Realmlist\Variety Pack\[Reddit]\Upvoted\20210428-Coralea Jade as Mikasa Ackerman-[n0dp1b]_3.jpg
[2021-07-18 20:20:50,376 - bdfr.downloader - DEBUG] - Hash added to master list: 4964de268067d731136df2ef0bce484d
[2021-07-18 20:20:50,416 - bdfr.downloader - DEBUG] - Written file to D:\r.Realmlist\Variety Pack\[Reddit]\Upvoted\20210428-Coralea Jade as Mikasa Ackerman-[n0dp1b]_4.jpg
[2021-07-18 20:20:50,416 - bdfr.downloader - DEBUG] - Hash added to master list: 355bd7afa6c44c382ef259f3fc6bb9f9
[2021-07-18 20:20:50,661 - bdfr.downloader - DEBUG] - Written file to D:\r.Realmlist\Variety Pack\[Reddit]\Upvoted\20210428-Coralea Jade as Mikasa Ackerman-[n0dp1b]_5.jpg
[2021-07-18 20:20:50,661 - bdfr.downloader - DEBUG] - Hash added to master list: 473b74abacea5e2482926a30f220db44
[2021-07-18 20:20:50,713 - bdfr.downloader - DEBUG] - Written file to D:\r.Realmlist\Variety Pack\[Reddit]\Upvoted\20210428-Coralea Jade as Mikasa Ackerman-[n0dp1b]_6.jpg
[2021-07-18 20:20:50,714 - bdfr.downloader - DEBUG] - Hash added to master list: f4a14d20906d4b5062c188a2522cd164
[2021-07-18 20:20:50,783 - bdfr.downloader - DEBUG] - Written file to D:\r.Realmlist\Variety Pack\[Reddit]\Upvoted\20210428-Coralea Jade as Mikasa Ackerman-[n0dp1b]_7.jpg
[2021-07-18 20:20:50,783 - bdfr.downloader - DEBUG] - Hash added to master list: d37eb28988079397871e76d9319ba26c
[2021-07-18 20:20:50,817 - bdfr.downloader - DEBUG] - Written file to D:\r.Realmlist\Variety Pack\[Reddit]\Upvoted\20210428-Coralea Jade as Mikasa Ackerman-[n0dp1b]_8.jpg
[2021-07-18 20:20:50,817 - bdfr.downloader - DEBUG] - Hash added to master list: c6bb7a27c1da11d232dccbf7780703bb
[2021-07-18 20:20:50,817 - bdfr.downloader - INFO] - Downloaded submission n0dp1b from cosplaygirls
[2021-07-18 20:20:50,818 - bdfr.downloader - DEBUG] - Attempting to download submission n0pyzp
[2021-07-18 20:20:50,818 - bdfr.downloader - DEBUG] - Using Gallery with url https://www.reddit.com/gallery/n0pyzp
[2021-07-18 20:20:50,818 - root - ERROR] - Downloader exited unexpectedly
Traceback (most recent call last):
  File "C:\Users\Steve\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\bdfr\__main__.py", line 81, in cli_download
    reddit_downloader.download()
  File "C:\Users\Steve\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\bdfr\downloader.py", line 45, in download
    self._download_submission(submission)
  File "C:\Users\Steve\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\bdfr\downloader.py", line 73, in _download_submission
    content = downloader.find_resources(self.authenticator)
  File "C:\Users\Steve\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\bdfr\site_downloaders\gallery.py", line 23, in find_resources
    image_urls = self._get_links(self.post.gallery_data['items'])
TypeError: 'NoneType' object is not subscriptable
@JackalvonX JackalvonX added the bug Something isn't working label Jul 19, 2021
@Serene-Arc Serene-Arc self-assigned this Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants