Voldrix / onlyfans-dl-2

OnlyFans content downloader v2
GNU General Public License v3.0
155 stars 22 forks source link

Fails to download paid content by messages #5

Closed gamer13766 closed 3 years ago

gamer13766 commented 3 years ago

Running the script for a user where they have sent me a message and I've paid for the content in the DM

Traceback (most recent call last): File "D:\OnlyFans\profiles\onlyfans-dl.py", line 186, in <module> get_content("purchased", "/posts/paid") File "D:\OnlyFans\profiles\onlyfans-dl.py", line 142, in get_content if MEDIATYPE == "purchased" and post["fromUser"]["username"] != PROFILE: KeyError: 'fromUser'

Everything else appears to work fine though

Voldrix commented 3 years ago

Okay I think I see the issue there, I'll fix this tomorrow when I've got a minute.

Voldrix commented 3 years ago

Alright the purchased posts should be downloading properly now. Let me know if you still have an issue.

gamer13766 commented 3 years ago

Okay so it works...kinda. If I run the single "python onlyfans-dl.py name" from CMD, it works fine. But it throws this error when I run my script that just repeats python onlyfans-dl.py name1 python onlyfans-dl.py name2 python onlyfans-dl.py name3 as part of a batch file (just for each downloading). But this is on me to fix now, so thank you for your work.

Voldrix commented 3 years ago

I just added a commit that allows you to download multiple profiles at a time, so it might save you from having to put it in a loop.

gamer13766 commented 3 years ago

Nice one. Just tried it and had the same issue however. Downloads the first one and then errors.

D:\OnlyFans\profiles>python dlof.py all
user exists.
Downloading new media, skipping pre-existing.
Found 576 posts
Downloaded 0 new posts
Found 8 archived
Downloaded 0 new archived
Found 1 messages
Downloaded 0 new messages
Found 88 purchased
Traceback (most recent call last):
  File "D:\OnlyFans\profiles\dlof.py", line 229, in <module>
    get_content("purchased", "/posts/paid")
  File "D:\OnlyFans\profiles\dlof.py", line 178, in get_content
    if MEDIATYPE == "purchased" and post["fromUser"]["username"] != PROFILE:
KeyError: 'fromUser'

It then stops here.

I've re-downloaded the script and set it up again, and re-done the pip install requests. Really not sure what I'm missing here now though.

Voldrix commented 3 years ago

Although I wasn't able to reproduce the error, I put an extra check for that array element that should prevent that error. Let me know if the purchased objects download now or if you get a different error.

gamer13766 commented 3 years ago

Nice work my dude, that looks to have sorted it.

Bit of a weird one though, I set up the script on a Ubuntu machine and it threw the same error. All working now though!

When you specify the "all" flag, how does it sort each profile? Most recently subscribed to?

Voldrix commented 3 years ago

For the API call to get the list of all subscribed profiles, I didn't explicitly set an order, so it uses the default one which is just order = descending, so I'm not sure what order that refers to.

gamer13766 commented 3 years ago

No worries, just looking at the profiles as the script runs, doesn't seem to be in any order that I recognise.

Happy to close this now.