UltimaScraper icon indicating copy to clipboard operation
UltimaScraper copied to clipboard

TypeError: argument of type 'NoneType' is not iterable

Open jeremfg opened this issue 6 years ago • 3 comments

Happens with the HEAD of master, as of 2020-07-30 (a1837bf71c26ed859ebafe53b7922127dea4060c) As seen from the trace, this is reproducible with free account livingwithaplaymate. However I realize this happens in messages, so might be difficult to reproduce.

FOUND: K:\Users\Jeremie\Private\Scraping\OnlyFans\OnlyFans\livingwithaplaymate\Posts\Free\Videos
Type: Archived
Scraping [photo]. Should take less than a minute.
Scraping [video | stream | gif]. Should take less than a minute.
Scraping [audio]. Should take less than a minute.
Type: Messages
Scraping [photo]. Should take less than a minute.
2020-07-30 00:01:34,760 ERROR errors argument of type 'NoneType' is not iterable
Traceback (most recent call last):
  File "K:\Users\Jeremie\Private\Scraping\OnlyFans\tool\datascraper\main_datascraper.py", line 221, in start_datascraper
    result = x.start_datascraper(
  File "K:\Users\Jeremie\Private\Scraping\OnlyFans\tool\modules\onlyfans.py", line 100, in start_datascraper
    results = prepare_scraper(
  File "K:\Users\Jeremie\Private\Scraping\OnlyFans\tool\modules\onlyfans.py", line 432, in prepare_scraper
    xmessages(link)
  File "K:\Users\Jeremie\Private\Scraping\OnlyFans\tool\modules\onlyfans.py", line 409, in xmessages
    if "list" in y:
TypeError: argument of type 'NoneType' is not iterable

jeremfg avatar Jul 30 '20 04:07 jeremfg

Yeah, the error is specific to you. If you've got vscode, you'd have to add a break point on line 409 and read the response of the variable y. It seems like it may be an invalid response.

UltimaHoarder avatar Jul 30 '20 12:07 UltimaHoarder

It means that the data variable is passing None (which is type NoneType), its equivalent for nothing. So it can't be iterable as a list, as you are trying to do.

Code4Win avatar Aug 01 '20 18:08 Code4Win

It means that the data variable is passing None (which is type NoneType), its equivalent for nothing. So it can't be iterable as a list, as you are trying to do.

That's not a fix... You're basically telling the script not to scrape mass messages even if it returns valid data instead of a None.

The None needs to be handled with an if not y:

UltimaHoarder avatar Aug 02 '20 21:08 UltimaHoarder