whats-happening-rightnow / justfor.fans.ripper

23 stars 16 forks source link

Working version #4

Open edwardsdean opened 2 years ago

edwardsdean commented 2 years ago

i have noticed some files get stuck downloading but for the most part it is working now

original-copy commented 1 year ago

@edwardsdean, getting this error. I tried playing around with the code but cannot resolve it. Any thoughts?

Traceback (most recent call last): File "Z:\JustForFans\app.py", line 199, in parse_and_get(html_text) File "Z:\JustForFans\app.py", line 169, in parse_and_get photo_save(thispost) File "Z:\JustForFans\app.py", line 39, in photo_save imgsrc = img.attrs['src'] KeyError: 'src'

nstern2 commented 1 year ago

I also get the same KeyError: 'src" error.

edwardsdean commented 1 year ago

i currently dont have any subscriptions on JustFor Fans, so i will be unable to work on it

original-copy commented 1 year ago

i currently dont have any subscriptions on JustFor Fans, so i will be unable to work on it

No problem. Thanks for letting us know.

radunicorn commented 1 year ago

The KeyError: 'src' is because part of image galleries have the image url inside parameter "data-lazy" instead of src. You can get rid of this problem by replacing the code line

    imgsrc = img.attrs['src']

with something like

    if 'src' in img.attrs:
        imgsrc = img.attrs['src']
    elif 'data-lazy' in img.attrs:
        imgsrc = img.attrs['data-lazy']
    else:
        print("no image source, skipping")
        continue
edwardsdean commented 1 year ago

The KeyError: 'src' is because part of image galleries have the image url inside parameter "data-lazy" instead of src. You can get rid of this problem by replacing the code line

    imgsrc = img.attrs['src']

with something like

    if 'src' in img.attrs:
        imgsrc = img.attrs['src']
    elif 'data-lazy' in img.attrs:
        imgsrc = img.attrs['data-lazy']
    else:
        print("no image source, skipping")
        continue

I have added this change to my branch, but am still unable to test it working, let me know if this works now

nstern2 commented 1 year ago

That code does work but you need to delete the imgsrc = img.attrs['src'] line for it to work properly.

edwardsdean commented 1 year ago

Which line is this? the only line with that is in the if block

waswosi commented 1 year ago

It works fine. But if i start downloading a particular profile as described with userid and hashtag it will downloadload the other profiles I'm subscribed to, too. But I want to download only one particular profile. What I do wrong?

veenx0704 commented 1 year ago

It works fine. But if i start downloading a particular profile as described with userid and hashtag it will downloadload the other profiles I'm subscribed to, too. But I want to download only one particular profile. What I do wrong?

It solved the problem for me when I "unfollow" the other creators.