UltimaScraper icon indicating copy to clipboard operation
UltimaScraper copied to clipboard

Run into a "IsADirectoryError" when archiving after most recent update

Open ElusiveZatchmo opened this issue 6 years ago • 30 comments

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!

ElusiveZatchmo avatar Dec 12 '19 04:12 ElusiveZatchmo

What path are you downloading to?

UltimaHoarder avatar Dec 12 '19 04:12 UltimaHoarder

~/onlyfans

ElusiveZatchmo avatar Dec 12 '19 05:12 ElusiveZatchmo

Did you fill in "directory" in the config?

UltimaHoarder avatar Dec 12 '19 06:12 UltimaHoarder

I did

ElusiveZatchmo avatar Dec 14 '19 06:12 ElusiveZatchmo

apologies here's the full directory in error: IsADirectoryError: [Errno 21] Is a directory: '~/Plex/Porn//onlyfans/{username}/Posts/Images/'

ElusiveZatchmo avatar Dec 14 '19 06:12 ElusiveZatchmo

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 avatar Dec 14 '19 07:12 ElusiveZatchmo

@ElusiveZatchmo what's the config directory?

UltimaHoarder avatar Dec 14 '19 07:12 UltimaHoarder

"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 avatar Dec 14 '19 07:12 ElusiveZatchmo

@ElusiveZatchmo Try using \\ instead of /

\\media\\sdw1\\holonet81\\Plex\\Porn

UltimaHoarder avatar Dec 14 '19 07:12 UltimaHoarder

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

ElusiveZatchmo avatar Dec 14 '19 07:12 ElusiveZatchmo

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.

UltimaHoarder avatar Dec 14 '19 07:12 UltimaHoarder

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 avatar Dec 14 '19 07:12 ElusiveZatchmo

@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.

UltimaHoarder avatar Dec 14 '19 08:12 UltimaHoarder

I'm still getting the same error :/

IsADirectoryError: [Errno 21] Is a directory: '/media/sdw1/holonet81/Plex/Porn/onlyfans/{username}/Posts/Images/'

ElusiveZatchmo avatar Dec 14 '19 08:12 ElusiveZatchmo

@ElusiveZatchmo what is your file_name_format in the config

UltimaHoarder avatar Dec 14 '19 08:12 UltimaHoarder

"file_name_format": "{username} {date} - {text} ({file_name}).{ext}" "date_format": "%Y-%m-%d"

and this setup had been working for me prior

ElusiveZatchmo avatar Dec 14 '19 19:12 ElusiveZatchmo

Just use {file_name}.{ext} Should work I think

UltimaHoarder avatar Dec 14 '19 19:12 UltimaHoarder

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

ElusiveZatchmo avatar Dec 14 '19 20:12 ElusiveZatchmo

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?

ElusiveZatchmo avatar Dec 14 '19 20:12 ElusiveZatchmo

yeah something is happening in {text}. I set the length to '50' and it stopped having this particular problem

ElusiveZatchmo avatar Dec 14 '19 21:12 ElusiveZatchmo