IOS uses shortcut commands to upload compressed screenshots to Google Photos
cd /opt wget https://exiftool.org/Image-ExifTool-12.23.tar.gz tar -zxf Image-ExifTool-12.23.tar.gz
cd ~/ wget https://downloads.rclone.org/v1.55.0/rclone-v1.55.0-linux-amd64.deb dpkg -i rclone-v1.55.0-linux-amd64.deb rclone config # n) New remote # name> GooglePhoto ## 16 / Google Photos ## \ "google photos" # Storage> 16 ## OAuth Client Id ## Leave blank normally. ## Enter a string value. Press Enter for the default (""). # client_id> ## OAuth Client Secret ## Leave blank normally. ## Enter a string value. Press Enter for the default (""). # client_secret> ## Set to make the Google Photos backend read only. ## ## If you choose read only then rclone will only request read only access ## to your photos, otherwise rclone will request full access. ## Enter a boolean value (true or false). Press Enter for the default ("false"). # read_only> ## Edit advanced config? (y/n) ## y) Yes ## n) No (default) # y/n> n ## Remote config ## Use auto config? ## * Say Y if not sure ## * Say N if you are working on a remote or headless machine ## y) Yes (default) ## n) No # y/n> n ## Please go to the following link: https://accounts.google.com/o/oauth2/auth?XXXXXXXXXXXXXXXXXX ## Log in and authorize rclone for access # Enter verification code> XXXXXXXXXX ## -------------------- ## [XXXXX] ## client_id = ## client_secret = ## token = XXXXXX ## -------------------- ## y) Yes this is OK ## e) Edit this remote ## d) Delete this remote # y/e/d> y
apt update && apt install -y fuse mkdir /mnt/GooglePhotos cat > /etc/systemd/system/rclonephotos.service <<EOF [Unit] Description=rclone GooglePhotos [Service] User=root ExecStart=/usr/bin/rclone mount GooglePhoto: upload//mnt/GooglePhotos/-- allow other -- allow non empty -- vfs cache mode full -- default permissions -- uid [uid of www data] -- gid [gid of www data] -- umask 027 ExecStop=/usr/bin/fusermount -u /mnt/GooglePhotos/ Restart=on-abort [Install] WantedBy=multi-user.target EOF systemctl enable rclonephotos --now service rclonephotos status ## Active: active (running) ls -l /mnt ## drwxr-x--- 1 www-data www-data 0 Apr 12 16:17 GooglePhotos
<? php ini_set('display_errors',1); date_default_timezone_set('Asia/Shanghai'); header('Content-Type:text/plain; charset=utf-8'); if((!isset($_SERVER['PHP_AUTH_USER']) || ! isset($_SERVER['PHP_AUTH_PW'])) || ! ($_SERVER['PHP_AUTH_USER'] == 'test' && $_SERVER['PHP_AUTH_PW'] == 'testtest')){ header('WWW-Authenticate: Basic realm="Authentication"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authentication invalid.'; exit; } if(empty($_FILES['file']['tmp_name']) || ! is_uploaded_file($_FILES['file']['tmp_name'])){ header('HTTP/1.0 403 Forbidden'); echo 'Invalid file source.'; exit; } @unlink("/tmp/{$_FILES['file']['name']}"); if(move_uploaded_file($_FILES['file']['tmp_name'],"/tmp/{$_FILES['file']['name']}") === FALSE){ header('HTTP/1.0 500 Internal Server Error'); echo 'Could not move temporary file.'; exit; } $time = strtotime($_POST['time']); $exiftime = date('Y:m:d H:i:s',$time); exec("/opt/Image-ExifTool-12.23/exiftool -alldates='$exiftime' /tmp/{$_FILES['file']['name']}"); rename("/tmp/{$_FILES['file']['name']}","/mnt/GooglePhotos/{$_FILES['file']['name']}"); echo 'Success.';
| | |
---|---|---|