Open nielsabels opened 4 years ago
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!
and we'll verify it.
ℹ️ Googlers: Go here for more info.
@googlebot I signed it!
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.
. If the bot doesn't comment, it means it doesn't think anything has changed.
ℹ️ Googlers: Go here for more info.
Hi,
the screenshot method in navToEnd is pretty gross, and I was hoping someday to get rid of it. I was thinking maybe now that chromedp.RunResponse (which I've already started to use in gphotos-cdp) exists, it could help with that. Would you be interested in investigating that?
Hi there!
Thanks a lot for considering my pull request and offering me a chance to implement a more robust method to run to the end of the gallery.
However, I think that that would take quite some investment from my side and at the moment I'm not really looking into developing skills into the chromedp
area. I created the PR because I do want to give back to the community and therefore am submitting my - probably pretty crude - bugfix.
So at the moment I'm not interested in that - but thanks again for the offer. I'm willing to amend/fix anything about this PR though. Please give a shout if there's anything else I can do.
Issue
In my efforts to run this tool to export my Google Photos library, I ran into some issues. I found that the tool was not able to find the last picture in my library successfully, and resorted to hit
right-arrow
continually until it would reach the end of the library.Background
My library has a vast amount of images and videos, and given some transient errors while navigating, I figured the script would never find the oldest picture (it would have taken days/weeks). Through reading the source code I found out that this is actually not the intended behavior. The script actually hits
page-down
andend
on the landing page of the library, and finds the oldest photo, after which it navigates to the left until it's done exporting.Implementation
I've made the way the script determines whether the end of the gallery has been reached a little bit more rigid. For your convenience, I've put a console log below these messages so you can clearly see the effect this change has. I've masked the ids a bit (I have no idea whether they are sensitive), but reading the last line for both outputs clearly leads to different ids. You can also see that for that particular run, there were 2 false positives until it actually hit the end of my gallery.
I hope this submitted code is in line with your coding standards/preferences. Let me know in case there is anything I can adjust.
Console logs
normal run
with the supplied fix