question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--only-print-filenames option displays filenames of files that have already been downloaded

See original GitHub issue

Hi,

I’ve noticed that if you use the --only-print-filenames option to display the list of files that will be downloaded, it shows files which are already on disk:

/ $ /usr/bin/icloudpd --directory /home/user/iCloud --cookie-directory /config --username notmy@email.com --folder-structure {:%Y/%m} --only-print-filenames
/home/user/iCloud/2020/09/IMG_1693_HEVC.MOV
/home/user/iCloud/2020/09/IMG_1691_HEVC.MOV
/home/user/iCloud/2020/09/IMG_1685_HEVC.MOV
/home/user/iCloud/2020/06/IMG_1646_HEVC.MOV
/home/user/iCloud/2020/05/IMG_1606_HEVC.MOV
/home/user/iCloud/2020/05/IMG_1605_HEVC.MOV
/home/user/iCloud/2020/05/IMG_1577_HEVC.MOV
/home/user/iCloud/2019/03/IMG_0331_HEVC.MOV
/home/user/iCloud/2019/03/IMG_0245_HEVC.MOV
/home/user/iCloud/2019/03/IMG_0244_HEVC.MOV
/ $ ls /home/user/iCloud/2020/09/IMG_16*
IMG_1685.HEIC      IMG_1687.MOV       IMG_1691.HEIC      IMG_1692.PNG       IMG_1693_HEVC.MOV  IMG_1696.PNG       IMG_1699.PNG
IMG_1685.JPG       IMG_1688.MOV       IMG_1691.JPG       IMG_1693.HEIC      IMG_1694.PNG       IMG_1697.PNG
IMG_1685_HEVC.MOV  IMG_1689.MOV       IMG_1691_HEVC.MOV  IMG_1693.JPG       IMG_1695.PNG       IMG_1698.PNG

This option should return an empty list if all files are already downloaded. However, it does not.

I’ve noticed that all of the above files are ‘Live Photos’, if that helps?

Thanks.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
AndreyNikiforovcommented, Nov 2, 2020

I’m in no rush for you to submit the PR… In my container, I use the output of the --only-print-filenames command to test if the files are actually on disk, if they are, I just ignore them. That way I only trigger a download run if files are missing.

@boredazfcuk what is the reason to check separately from downloading (==two phase approach)? If there are no new files, single- and two-phase approaches will result in the same behavior and speed. If there are new files, then two-phase approach will require pulling list of files from icloud and checking disk twice, so it is slower and more work. I am definitely missing something…

0reactions
boredazfcukcommented, Nov 2, 2020

The reason I was checking separately from downloading was due to this issue, which I hit quite a bit: https://github.com/icloud-photos-downloader/icloud_photos_downloader/issues/163

The single-phase approach always detects new files. Attempting to download all 800+ files in my photo stream was quite time consuming. I presumed that this would also increase load on the Apple server due to it checking 800+ files.

In the two-phase approach, retrieving the list of files using --only-print-filenames was comparatively quick and I could use its output to verify if the ‘new’ files were genuinely new. Ignoring the previously downloaded files meant far fewer ‘download’ runs.

Once I’d implemented this, it resulted in fewer private db access disabled for this account. Please wait a few minutes then try again. The remote servers might be trying to throttle requests. (ACCESS_DENIED) lockouts.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Grep From Files and Display the File Name On Linux
The first name is file name (e.g., /etc/crontab, /etc/group). The -l option will only print filename if the match found by the grep:....
Read more >
How can I use grep to show just filenames on Linux? [closed]
The first impression of the document makes you feel that it will only print the file name of the first file. You really...
Read more >
Why has my filename changed? - Microsoft Support
When saving files to your personal OneDrive, certain characters are automatically renamed by Office apps, including Word, Excel and PowerPoint.
Read more >
Displaying Your Filenames - Pixieset - Help Center
When you have the Filename Display option set to Show, the filenames will be shown under each image in the enlarged image view...
Read more >
icloudpd: Versions - Openbase
fix: --only-print-filenames option displays filenames (live photos) of files that have already been downloaded #200; fix: docker works on Windows #192 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found