Closed pumbinha closed 1 month 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.
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:
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.
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.
I tried then creating a new shell script with all the commands:
But same in this case I'm getting a different error...
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 👍
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.
FileNotFoundError: [Errno 2] No such file or directory: 'cookies.txt'
StaleElementReferenceException
is apparently a common error that happens when elements move around or get destroyed and recreated. Things like the page resizing etc. Which makes the reference to the element we were targetting become invalid since well it got destroyed.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!
@pumbinha Any luck?
Hi @DreamingRaven ,
sorry, yesterday I wasn't at home and I was not able to test it. I tried some minutes ago and it works like a charm, don't know the reason but maybe this extra seconds made the difference!
Thanks a lot!!
Cheers
Very nice! I will try to make a more permanent fix that is a little bit cleaner in future. I will close this issue as complete for now, feel free to re-open it if there is still an issue with your download.
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:
And now with anything containing the text ".zip"
What am I doing wrong?