npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

google-photos-migrate

v2.3.10

Published

A tool to fix EXIF data and recover filenames from a Google Photos takeout.

Downloads

103

Readme

google-photos-migrate

Project info

A tool like google-photos-exif, but does some extra things:

  • uses the titles from the .json file to recover previous filenames
  • moves duplicates into their own folder
  • tries to match files by the title in their .json file
  • fixes wrong extensions, identified by ExifTool (or use --skip-corrections)
  • video files won't show up as from 1970
  • works for English, German, French, Turkish, Russian and Spanish (for more langs fix this file)
  • supported extensions can be found and configured in extensions.ts

Run this tool

Note: On Windows, make sure to use double quotes " instead of '.

Natively

Prerec: Must have at least Node.js 18 installed.

Full structured migration

If you wish to migrate an entire takeout folder (and keep the album directory structure):

mkdir output error

npx google-photos-migrate@latest full '/path/to/takeout' './output' './error' --timeout 60000

The folder names in the output and error directories will now correspond to the original album names.

Flat migration

If you wish to migrate your Google Photos folder into a flat directory (and don't care about albums):

mkdir output error

npx google-photos-migrate@latest flat '/path/to/takeout/Google Photos' './output' './error' --timeout 60000

Optional flags (see --help for all details):

--timeout integer
    Shorthand: -t integer
    Meaning: Sets the timeout for exiftool, default is 30000 (30s)
--force
    Shorthand: -f
    Meaning: Forces the migration and overwrites files in the target directory.

Docker

Prerec: You must have a working docker or podman install.

A Dockerfile is also provided to make running this tool easier on most hosts. The image must be built manually (see below), no pre-built images are provided. Using it will by default use only software-based format conversion, hardware accelerated format conversion is beyond these instructions.

Build the image once before you run it:

git clone https://github.com/garzj/google-photos-migrate
cd google-photos-migrate

# build the image
docker build -f Dockerfile -t localhost/google-photos-migrate:latest .

To run the full migration:

mkdir output error
docker run --rm -it --security-opt=label=disable \
    -v "$(readlink -e path/to/takeout):/takeout" \
    -v "$(readlink -e ./output):/output" \
    -v "$(readlink -e ./error):/error" \
   localhost/google-photos-migrate:latest \
     full '/takeout' '/output' '/error' --timeout=60000

To run the flat migration:

mkdir output error
docker run --rm -it --security-opt=label=disable \
    -v "$(readlink -e path/to/takeout):/takeout" \
    -v "$(readlink -e ./output):/output" \
    -v "$(readlink -e ./error):/error" \
   localhost/google-photos-migrate:latest \
     flat '/takeout/Google Fotos' '/output' '/error' --timeout=60000

All other options are also available. The only difference from running it natively is the lack of (possible) hardware acceleration, and the need to explicitly add any folders the command will need to reference as host-mounts for the container.

For the overall help:

docker run --rm -it --security-opt=label=disable \
   localhost/google-photos-migrate:latest \
     --help

Further steps

  • If you use Linux + Android, you might want to check out the scripts I used to locate duplicate media and keep the better versions in the android-dups directory.
  • Use a tool like Immich and upload your photos

Development

Build instructions

Prerec: Must have Node 18 & yarn installed.

To build and run the app:

git clone https://github.com/garzj/google-photos-migrate
cd google-photos-migrate
yarn
yarn build
yarn start <subcommand>

Watch file changes

Use yarn dev to watch for file changes and make sure to pass the -f flag to overwrite migrated files after restarts.

The entrypoint of the cli is in src/cli.ts and library code should be exported from src/index.ts.