AttributeError: 'NoneType' object has no attribute 'replace'
Same as #1009 which has been closed I am now seeing this today from model "mollynextdoor" which I had previously been scraping fine.
Scrape Processing
Name: mollynextdoor
Type: Profile
Type: Stories
Scrape Attempt: 1/100
Processing Scraped Stories
, 1246.82it/s][0m
Processing metadata.
Finished processing metadata.
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
Renaming files.
0%|[35m [0m| 0/2 3184.74it/s][0m
Type: Posts
Scrape Attempt: 1/100
Type: Archived Posts
Processing Scraped Posts
0%|[35m [0m| 0/41 [00:00<?, ?it/s][0mTraceback (most recent call last):
File "Misc/OnlyFans/start_ofd.py", line 60, in <module>
loop.run_until_complete(main())
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "Misc/OnlyFans/start_ofd.py", line 44, in main
api = await main_datascraper.start_datascraper(
File "Misc/OnlyFans/datascraper/main_datascraper.py", line 93, in start_datascraper
await main_helper.process_names(
File "Misc/OnlyFans/helpers/main_helper.py", line 939, in process_names
result = await module.start_datascraper(authed, username, site_name)
File "Misc/OnlyFans/modules/onlyfans.py", line 160, in start_datascraper
await prepare_scraper(authed, site_name, item)
File "Misc/OnlyFans/modules/onlyfans.py", line 823, in prepare_scraper
unrefined_set = await tqdm.gather(tasks, **settings)
File "/usr/local/lib/python3.9/site-packages/tqdm/asyncio.py", line 79, in gather
res = [await f for f in cls.as_completed(ifs, loop=loop, timeout=timeout,
File "/usr/local/lib/python3.9/site-packages/tqdm/asyncio.py", line 79, in <listcomp>
res = [await f for f in cls.as_completed(ifs, loop=loop, timeout=timeout,
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py", line 614, in _wait_for_one
return f.result() # May raise f.exception().
File "/usr/local/lib/python3.9/site-packages/tqdm/asyncio.py", line 76, in wrap_awaitable
return i, await f
File "Misc/OnlyFans/modules/onlyfans.py", line 1168, in media_scraper
file_path = await main_helper.reformat(prepared_format, filename_format)
File "Misc/OnlyFans/helpers/main_helper.py", line 648, in reformat
text = clean_text(text)
File "Misc/OnlyFans/helpers/main_helper.py", line 104, in clean_text
string = string.replace(m, " ").strip()
AttributeError: 'NoneType' object has no attribute 'replace'
For the record I added a couple of lines to bypass this:-
def clean_text(string, remove_spaces=False):
if string == None:
string = "Hacked it"
matches = ["\n", "<br>"]
The post_id in SQL is 176193441. There is 3 vids in there Media IDs (2177060780, 2177060771, 2177060762) although not entirely sure what tripped up the clean_text function right now ?
It's odd they are showing up on my home page as PPV and unlockable but I haven't paid and I can view them ? And with that hack the scraper has pulled them. LOL.
For the record I added a couple of lines to bypass this:-
def clean_text(string, remove_spaces=False): if string == None: string = "Hacked it" matches = ["\n", "<br>"]The post_id in SQL is
176193441. There is 3 vids in there Media IDs (2177060780, 2177060771, 2177060762) although not entirely sure what tripped up theclean_textfunction right now ?
Where do you add this?