Run into a "IsADirectoryError" when archiving after most recent update
I just recently updated and after it downloads from one account, when it moves to the next, I get the following error after it archives all the images:
Traceback (most recent call last):
File "StartDatascraper.py", line 112, in <module>
x.download_media(*arg)
File "~/OnlyFans/modules/onlyfans.py", line 334, in download_media
pool.starmap(download, product(
File "~/python3/lib/python3.8/multiprocessing/pool.py", line 372, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
File "~/python3/lib/python3.8/multiprocessing/pool.py", line 768, in get
raise self._value
File "~/python3/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "~/python3/lib/python3.8/multiprocessing/pool.py", line 51, in starmapstar
return list(itertools.starmap(args[0], args[1]))
File "~/OnlyFans/modules/onlyfans.py", line 319, in download
with open(download_path, 'wb') as f:
IsADirectoryError: [Errno 21] Is a directory: '/directory/'
I'm not sure what happened or what I need to change/edit. Any thoughts/help would be greatly appreciated. Thanks!
What path are you downloading to?
~/onlyfans
Did you fill in "directory" in the config?
I did
apologies here's the full directory in error: IsADirectoryError: [Errno 21] Is a directory: '~/Plex/Porn//onlyfans/{username}/Posts/Images/'
I'm finding I only run into this error when I enable the auto options in the config file, if I run:
(echo -e "0"; echo -e "c"; echo -e "c") | python3 StartDatascraper.py
I don't get that error at all
@ElusiveZatchmo what's the config directory?
"directory": "/media/sdw1/holonet81/Plex/Porn"
Okay, so here's some other info. I'm currently following 2 accounts on OnlyFans and am trying to scrape everything from both. Whenever I try to grab everything from both it grabs everything from the first profile, but throws that error that I've been getting after completing the images of the second profile. If I manually scrape for images and then run it again scrapping for videos, it grabs all that from both without an issue.
@ElusiveZatchmo Try using \\ instead of /
\\media\\sdw1\\holonet81\\Plex\\Porn
IsADirectoryError: [Errno 21] Is a directory:
\\media\\sdw1\\holonet81\\Plex\\Porn//onlyfans/{username}/Posts/Images/'
And on top of that, I have no idea where those downloaded to, because Linux is telling me that doesn't exist
Full error:
Traceback (most recent call last):
File "/media/sdw1/holonet81/OnlyFans/StartDatascraper.py", line 112, in <module>
x.download_media(*arg)
File "/media/sdw1/holonet81/OnlyFans/modules/onlyfans.py", line 334, in download_media
pool.starmap(download, product(
File "/media/sdw1/holonet81/python3/lib/python3.8/multiprocessing/pool.py", line 372, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
File "/media/sdw1/holonet81/python3/lib/python3.8/multiprocessing/pool.py", line 768, in get
raise self._value
File "/media/sdw1/holonet81/python3/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/media/sdw1/holonet81/python3/lib/python3.8/multiprocessing/pool.py", line 51, in starmapstar
return list(itertools.starmap(args[0], args[1]))
File "/media/sdw1/holonet81/OnlyFans/modules/onlyfans.py", line 319, in download
with open(download_path, 'wb') as f:
IsADirectoryError: [Errno 21] Is a directory: '\\media\\sdw1\\holonet81\\Plex\\Porn//onlyfans/{username}/Posts/Images/'
Traceback (most recent call last):
File "/media/sdw1/holonet81/OnlyFans/StartDatascraper.py", line 112, in <module>
x.download_media(*arg)
File "/media/sdw1/holonet81/OnlyFans/modules/onlyfans.py", line 334, in download_media
pool.starmap(download, product(
File "/media/sdw1/holonet81/python3/lib/python3.8/multiprocessing/pool.py", line 372, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
File "/media/sdw1/holonet81/python3/lib/python3.8/multiprocessing/pool.py", line 768, in get
raise self._value
File "/media/sdw1/holonet81/python3/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/media/sdw1/holonet81/python3/lib/python3.8/multiprocessing/pool.py", line 51, in starmapstar
return list(itertools.starmap(args[0], args[1]))
File "/media/sdw1/holonet81/OnlyFans/modules/onlyfans.py", line 319, in download
with open(download_path, 'wb') as f:
IsADirectoryError: [Errno 21] Is a directory: '\\media\\sdw1\\holonet81\\Plex\\Porn//onlyfans/{username}/Posts/Images/'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/media/sdw1/holonet81/OnlyFans/StartDatascraper.py", line 125, in <module>
input()
EOFError: EOF when reading a line
Hmm seems that UNIX uses forward slashes instead of backslashes then. In the script, I'm probably telling it somewhere to use a backslash so I'll look into it.
One thing I noticed is this
IsADirectoryError: [Errno 21] Is a directory: '~/Plex/Porn//onlyfans/{username}/Posts/Images/'
Porn//onlyfans
There are two forward slashes. Could be the reason why.
maybe. I noticed it added three there if I ended the directory list in config with a trailing '/' Somewhere in the scraper script it's adding a '/' there for some reason
@ElusiveZatchmo gonna push the commit within 5 minutes. It's the same config so you can just copy and paste your original config over.
It's been pushed now.
I'm still getting the same error :/
IsADirectoryError: [Errno 21] Is a directory: '/media/sdw1/holonet81/Plex/Porn/onlyfans/{username}/Posts/Images/'
@ElusiveZatchmo what is your file_name_format in the config
"file_name_format": "{username} {date} - {text} ({file_name}).{ext}"
"date_format": "%Y-%m-%d"
and this setup had been working for me prior
Just use {file_name}.{ext} Should work I think
It doesn't have that issue though when I try to scrape just images or just videos though. I'll give it a try and report back
So that worked, it just becomes an organizational nightmare, lol. What in my "file_name_format" is breaking this? Maybe there's illegal characters being picked up in "{text}". Is there a way to potentially strip those out?
yeah something is happening in {text}. I set the length to '50' and it stopped having this particular problem