Knowledgebase / FAQ - ip-connect GmbH
Knowledgeroot - Version: 0.9.9.5
Menü verstecken Menü ausklappen Menü neuladen Menü einklappen
Menü schliessen
  1.https://github.com/ndbroadbent/icloud_photos_downloader    (Zuletzt geändert von rsch an 27.09.2017 23:24:30)

 Installation

On Synology install GIT Server first (you can leave it stopped) for the git cli.

# Clone the repo somewhere   
git clone https://github.com/ndbroadbent/icloud_photos_downloader.git

cd icloud_photos_downloader

# Install dependencies (Linux)
sudo pip install -r requirements.txt

Authentication

If your account has two-factor authentication enabled, you will be prompted for a code when you run the script.

Two-factor authentication will expire after an interval set by Apple, at which point you will have to re-authenticate. This interval is currently two months.

You can receive an email notification when two-factor authentication expires by passing the --smtp-username and --smtp-password options. Emails will be sent to --smtp-username by default, or you can send to a different email address with --notification-email.

If you want to send notification emails using your Gmail account, and you have enabled two-factor authentication, you will need to generate an App Password at https://myaccount.google.com/apppasswords

System Keyring

You can store your password in the system keyring using the icloud command-line tool (installed with the pyiclouddependency):

$ icloud --username=jappleseed@apple.com ICloud Password for jappleseed@apple.com:  Save password in keyring? (y/N) 

If you have stored a password in the keyring, you will not be required to provide a password when running the script.

If you would like to delete a password stored in your system keyring, you can clear a stored password using the --delete-from-keyring command-line option:

$ icloud --username=jappleseed@apple.com --delete-from-keyring 

Usage

$ ./download_photos.py <download_directory>                        --username=<username>                        [--password=<password>]                        [--size=(original|medium|thumb)]                        [--recent <integer>]                        [--until-found <integer>]                        [--download-videos]                        [--auto-delete]                        [--only-print-filenames]                        [--smtp-username <smtp_username>]                        [--smtp-password <smtp_password>]                        [--smtp-host <smtp_host>]                        [--smtp-port <smtp_port>]                        [--smtp-no-tls]                        [--notification-email <notification_email>]  Options:     --username <username>           Your iCloud username or email address     --password <password>           Your iCloud password     --size [original|medium|thumb]  Image size to download (default: original)     --recent INTEGER RANGE          Number of recent photos to download                                     (default: download all photos)     --until-found INTEGER RANGE     Download most recently added photos until we                                     find x number of previously downloaded                                     consecutive photos (default: download all                                     photos)     --download-videos               Download both videos and photos (default:                                     only download photos)     --force-size                    Only download the requested size (default:                                     download original if size is not available)     --auto-delete                   Scans the "Recently Deleted" folder and                                     deletes any files found in there. (If you                                     restore the photo in iCloud, it will be                                     downloaded again.)     --only-print-filenames          Only prints the filenames of all files that                                     will be downloaded. (Does not download any                                     files.)     --smtp-username <smtp_username>                                     Your SMTP username, for sending email                                     notifications when two-step authentication                                     expires.     --smtp-password <smtp_password>                                     Your SMTP password, for sending email                                     notifications when two-step authentication                                     expires.     --smtp-host <smtp_host>         Your SMTP server host. Defaults to:                                     smtp.gmail.com     --smtp-port <smtp_port>         Your SMTP server port. Default: 587 (Gmail)     --smtp-no-tls                   Pass this flag to disable TLS for SMTP (TLS                                     is required for Gmail)     --notification-email <notification_email>                                     Email address where you would like to                                     receive email notifications. Default: SMTP                                     username     -h, --help                      Show this message and exit. 

Example:

$ ./download_photos.py ./Photos \      --username=testuser@example.com \      --password=pass1234 \      --size=original \      --recent 500 \      --auto-delete 

Error on first run

The first time you run the script, you will probably see an error message like this:

Bad Request (400) 

This error usually means that Apple's servers are getting ready to send you data about your photos. This process can take around 5-10 minutes, so please wait a few minutes, then try again.

(If you are still seeing this message after 30 minutes, then please open an issue on GitHub.)

Run once every 3 hours using Cron

cp cron_script.sh.example cron_script.sh 
  • Edit cron_script.sh with your username, password, and other options

  • Run crontab -e, and add the following line:

0 */3 * * * /path/to/icloud_photos_downloader/cron_script.sh 

 

verschieben [Oben]

  2.http://www.synology-wiki.de/index.php/Synogear:_weitere_Tools    (Zuletzt geändert von rsch an 27.09.2017 23:19:41)

Zur genaueren Diagnose liefert Synology in einem nicht modifizierten System weitere Tools. Diese müssen lediglich installiert werden.

Zur Installation muss man root Rechte haben. Also entweder direkt als root per ssh anmelden oder als admin und anschließend per "sudo su" zu root werden.

Auf der Kommandozeile den Befehl für die Installation eingeben:

synogear install


Nach einem kurzen Moment sind die Tools installiert

Ein Liste der Tools erhält man mit dem Befehl

synogear list

All tools:
addr2name          ldd                pmap               sysctl
arping             log-analyzer.sh    prtstat            sysstat
bash               lsof               ps                 tcpdump
cifsiostat         ltrace             pstree             tcpdump_wrapper
clockdiff          mpstat             pwdx               tcpspray
dig                name2addr          rarpd              tcpspray6
domain_test.sh     ncat               rdisc              tcptraceroute6
file               ndisc6             rdisc6             telnet
fix_idmap.sh       nethogs            rltraceroute6      time
free               nfsiostat-sysstat  rview              tload
fuser              nmap               rvim               top
gcore              nping              sa1                tracepath
gdb                nslookup           sa2                traceroute6
gdbserver          peekfd             sadc               tracert6
iftop              perf-check.py      sadf               uptime
iostat             pgrep              sar                vim
iotop              pidof              sid2ugid.sh        vimdiff
iperf              pidstat            slabtop            vmstat
iperf3             ping               sockstat           w
kill               ping6              speedtest-cli.py   watch
killall            pkill              strace             xxd

Ab sofort lassen sich die oben gelisteten Tools direkt über die Kommandozeile aufrufen.

Das Paket wird nun auch im Paketzentrum als "Diagnosis Tool" angezeigt. Eine Deinstallation ist hier auch möglich.

Eine Installation der Tools über das Paketzentrum scheint allerdings nicht möglich zu sein.

verschieben [Oben]

  3.Python PIP package installer    (Zuletzt geändert von rsch an 27.09.2017 23:21:01)

1st) Install Python from the Package Installer Web interface. I have Python 2.7 installed

2nd) Connect to your Synology NAS through ssh.

3rd) Get the pip installer: wget https://bootstrap.pypa.io/get-pip.py

4th) Execute the installer: python get-pip.py. It will take a while:

 # python get-pip.py 
Collecting pip
  Downloading pip-8.0.2-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 42kB/s 
Collecting setuptools
  Downloading setuptools-19.6-py2.py3-none-any.whl (472kB)
    100% |████████████████████████████████| 475kB 109kB/s 
Collecting wheel
  Downloading wheel-0.26.0-py2.py3-none-any.whl (63kB)
    100% |████████████████████████████████| 65kB 291kB/s 
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-8.0.2 setuptools-19.6 wheel-0.26.0

We can now execute the pip command:

# pip

Usage:   
  pip  [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  help                        Show help for commands.
...
...

Now we can install the modules that we need.

verschieben [Oben]