DreamingRaven / patreon-link-dl

Enables downloading mass patreon links for paid for content in a fair and reasonable manner to the service.
Open Software License 3.0
3 stars 0 forks source link

Unable to download any file #1

Open pumbinha opened 2 days ago

pumbinha commented 2 days ago

When executing the python script it never finds any file to download, I've tried changing the regex but it doesn't matter, it never finds anything:

Here's with the default filter:

image

And now with anything containing the text ".zip"

image

What am I doing wrong?

DreamingRaven commented 2 days ago

Hmm this means for one reason or another none of the links on the page are matching the given regex. This could be because:

Have you tried running pld login, it should give you a brief window to login to patreon so when it next requests the page it gets the full page rather than a login page? You can also try the link directly in this temporary browser to see what it sees.

So for instance if I go to that page no links are present so no regex matches will be found since I don't have access any more.

DreamingRaven commented 2 days ago

Like this, if not logged in, it can still fetch the page itself, but no links will be present so it won't find anything: page

pumbinha commented 2 days ago

Hi, thanks for your help :-)

There might be something different in the way I execute the script. First of all I tried authenticating with Google but it was rejected because of Google security policies.

image

Then I used e-mail with code (because I don't have a real account in patreon, but a linked one with google). Then I received the code and I can log-in. Then the browser closes and opens again and access the home page of patreon and redirects to the page with the links, which I can see, so the auth cookie is there and it looks it's working.

image

I tried then creating a new shell script with all the commands:

image

But same in this case I'm getting a different error...

image

Any clue? Is it because I don't have a "normal" account? Can you try to log in getting the verification code instead?

Thanks, much appreciated 👍

DreamingRaven commented 13 hours ago

Hmm, interesting. I can see the line from your logs that is causing the issue: https://github.com/DreamingRaven/patreon-link-dl/blob/0c17df336112cdd996dd506b23ef835678e3f4ed/pld/pld.py#L104 I will do something suboptimal and break that list comprehension up for the sake of making it easier to debug. I dont have access to cze pekus page anymore but I am testing against https://www.patreon.com/posts/44502678 with baileywiki atm to see if I can reproduce your issue. Thus far I am having issues replicating this, but I have made some prospective changes you might want to git pull, reinstall, and try again.

What I have found is.

So what I have done is I have broken up the list comprehension into a much uglier for loop with try except within. This allows me to catch the StaleElementReferenceException that you are generating and ignore it for now, so at least your other downloads can continue, assuming they don't all get destroyed by the page changing.

I'm not sure what is causing the page to refresh or change its contents when you load it, but it never did for me, are you changing the browser in some way as it's trying to download pages? Maybe I am not waiting enough time for the full page to load before trying to extract the links is the only other thing I can think could cause this. So I have added a 3-second delay, as a stopgap, to see if it works for you. Let me know how it goes!

TLDR: added delay, and exception catching, so you can hopefully download links. Please git pull, reinstall and try again to see if it fixes your issue!