Skip to content

Instantly share code, notes, and snippets.

View jkitching's full-sized avatar

Joel Kitching jkitching

View GitHub Profile
@jkitching
jkitching / combine_photo_video.sh
Created May 27, 2024 07:31
Combine a photo (HEIC or JPEG) and a video into a file which Google Photos will recognize as a motion photo
#!/bin/bash
# Inline XMP data
inline_xmp='<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.1.0-jc003">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:GCamera="http://ns.google.com/photos/1.0/camera/"
xmlns:Container="http://ns.google.com/photos/1.0/container/"
xmlns:Item="http://ns.google.com/photos/1.0/container/item/"
xmlns:xmpNote="http://ns.adobe.com/xmp/note/"
#!/bin/bash
# Initialize variables
TARGET_ARRAY=""
COMMAND=""
OUTPUT_NAME=""
TOKEN_FILE=""
PAGE_TOKEN_ARG=""
# Parse long-form command-line arguments
#!/bin/bash
# keyring tool is provided by Python keyring package
username="your.email@gmail.com"
read -sp "$username app password: " password
echo
input="$username\n$password\n"
json=`echo -e $input | docker run -i gpsoauth_login`
echo $json
import getpass
import json
import keyring
import subprocess
GOOGLE_ACCOUNT = 'your.email@gmail.com'
TOKEN_NAME = 'gpsoauth-token'
password = getpass.getpass('{} app password: '.format(GOOGLE_ACCOUNT))
input_string = '{}\n{}\n\n\n'.format(GOOGLE_ACCOUNT, password)
# Usage:
#
# $ docker build -t gpsoauth_login -f gpsoauth_login.Dockerfile .
# $ docker run -it --rm gpsoauth_login
# <stdin: username>
# <stdin: password>
# <stdin: android_id>
# {'SID': 'BAD_COOKIE', 'LSID': 'BAD_COOKIE', 'Token': ... }
FROM alpine:3.16