Skip to main content

GitHub PyPI PyPI - Status GitHub last commit GitHub issues PyPI - Downloads GitHub repo size PyPI - Python Version


glinkfix


glinkfix logo

Notes (please read)

  1. Google periodically changes how Drive links are handled, which can affect tools like glinkfix. Direct downloading and embedding Google Drive links is unsupported behavior as far as Google is concerned. As of January 2024, Google made a significant change that broke some links created with this tool. glinkfix now accepts current Drive file link formats such as usp=drive_link, but future Google changes may break link handling again.

  2. Viewing links that point to animated GIFs may appear as static images.

  3. In the v2 update, in addition to displaying the fixed link on the screen, glinkfix will also attempt to copy the fixed link to the clipboard. Copying to the clipboard only works for desktop operating systems, not server environments. Even without automatic copying, link fixing will still work and the results will be displayed on the screen, regardless of where you run it. glinkfix uses the pyperclip library, and automatic copying to the clipboard should work seamlessly on Windows and macOS. If you're running Linux and links are not automatically copied to the clipboard, refer to this note from the pyperclip documentation.

  4. glinkfix is tested on Linux, macOS, and Windows in continuous integration. Clipboard behavior still depends on the local desktop or server environment.

Installation

The preferred way to install glinkfix is with pipx:

pipx install glinkfix

You can also install glinkfix as a tool with uv:

uv tool install glinkfix

Alternatively, you can create a separate virtual environment and install it the traditional way:

pip3 install glinkfix

If you just need a quick one-time link fix and don't want to commit to a full installation, use:

pipx run glinkfix -h

and follow the directions to run it again with the option you want.

Purpose and Usage

When you share files with Google Drive, the sharing link you get is intended primarily for accessing the content through a web browser. glinkfix supports Google Drive file links such as https://drive.google.com/file/d/<file-id>/view?usp=drive_link, .../preview, and bare /file/d/<file-id> links. If you want to use a Google Drive file sharing link to embed an image in a document (e.g. in a Markdown or HTML file), or you want to directly download a file pointed to by a Google Drive sharing link using something like curl or wget in Linux, the link needs to be adjusted ("fixed") for these purposes.

It's not especially hard to repackage the link, but it can be tedious. You have to copy the link to a text editor, carve it up manually, and reassemble it. If you've got a lot of links to deal with, the process gets repetitive. This tool is designed to remove that tedium.

Note: The images below demonstrate Google Drive sharing links and their "fixed" equivalents.


Start by getting a sharing link to a file on Google Drive. Make sure it's set up for public access (Anyone with the link):

Getting Link


Copying Link

Now run glinkfix with the sharing link:

glinkfix "https://drive.google.com/file/d/<file-id>/view?usp=drive_link"

By default, glinkfix creates an embeddable link, prints the result, and attempts to copy the fixed link to the clipboard. To create a direct-download link instead, use:

glinkfix --download "https://drive.google.com/file/d/<file-id>/view?usp=drive_link"

For shell scripts, use --quiet to print only the converted URL:

glinkfix --quiet "https://drive.google.com/file/d/<file-id>/view?usp=drive_link"

To print the normal output without copying to the clipboard, use:

glinkfix --no-copy "https://drive.google.com/file/d/<file-id>/view?usp=drive_link"

If you run glinkfix without a URL, it prompts for one interactively. Press Ctrl-C at the prompt to exit cleanly.


To display the help menu, run: glinkfix -h

usage: glinkfix [-h] [-d] [--no-copy] [--quiet] [-v] [url]

Convert a Google Drive file sharing link into a link suitable for
embedding in a document, such as an image in Markdown or HTML, or for
direct download, such as with curl. glinkfix accepts current Drive file
link formats such as usp=drive_link and uses Python's standard-library
URL parser for lightweight, dependency-minimal processing. Google Drive
links used this way have a single-file size limit of 40 MB.

positional arguments:
  url             Google Drive file sharing link to convert. If omitted,
                  prompt for one.

options:
  -h, --help      show this help message and exit
  -d, --download  Create a direct-download link instead of the default
                  embeddable link.
  --no-copy       Do not copy the converted link to the clipboard.
  --quiet         Print only the converted link and skip clipboard copying.
  -v, --version   show program's version number and exit

Usage Notes

  • There is a 40 MB size limit for a single file when using Google Drive sharing links directly for viewing or downloading. Individual files larger than 40 MB will not render or download properly. This limit is a function of how Google Drive works and is not related to glinkfix.
  • When creating a download link for use with curl, make sure to use curl's -L option to allow for redirects.
  • glinkfix supports current Google Drive file sharing links, including usp=drive_link, usp=drivesdk, usp=sharing, and usp=share_link.
  • glinkfix supports links that use Google's resource key security feature and preserves the resource key in fixed links.
  • glinkfix supports Drive file links only. It does not convert Google Drive folder links or native Google Docs, Sheets, or Slides editor links.
  • The link parser uses Python's standard-library URL parsing tools for lightweight, dependency-minimal processing. New dependencies are acceptable when they provide a clear correctness, performance, or maintainability benefit.

Development and releases

Pull-request titles use Conventional Commits. User-visible types are feat, change, deprecate, remove, fix, security, perf, deploy, docs, revert, and dependency-scoped build(deps...) or chore(deps...). Routine build, chore, ci, refactor, style, and test changes are hidden from release notes unless marked as breaking with !.

Preview pending user-visible entries with:

just changelog

Prepare a release from a clean branch with a canonical version such as 2.2.3, 2.2.3b1, or 2.2.3rc1:

just bump 2.2.3
just check
just build
git add CHANGELOG.md changelogs pyproject.toml uv.lock
git commit -m "chore(release): prepare for 2.2.3"

just bump requires at least one user-visible change. A release-preparation chore(release) commit is hidden and does not satisfy that requirement.

After merging the release-preparation commit, update local main and run just tag-release. It pushes one annotated v<version> tag. Prereleases publish to TestPyPI and create GitHub prereleases; stable releases publish to PyPI and create stable GitHub Releases. Only successful stable releases move the mutable latest tag.

The release workflow uses PyPI Trusted Publishing. Before the first release, configure pending publishers for this repository in TestPyPI and PyPI using the release.yml workflow and the testpypi and pypi GitHub environments. Allow the workflow to force-update the mutable latest tag; do not attach a GitHub Release to that tag.

Dependabot checks direct Python and GitHub Actions dependencies weekly. It groups eligible Python minor and patch updates, and automatically enables squash auto-merge only for Dependabot-authored direct minor or patch updates without maintainer changes. Major and otherwise ineligible updates require manual review.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

This project uses the pyperclip library, an external dependency licensed under the BSD 3-Clause License. See the pyperclip project for license details.

Metadata

Release files for glinkfix 2.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for glinkfix 2.2.4
File Size Uploaded
glinkfix-2.2.4.tar.gz 707.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for glinkfix 2.2.4
File Interpreter ABI Platform
glinkfix-2.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 717.2 kB

Release files / glinkfix-2.2.4.tar.gz

Download URL glinkfix-2.2.4.tar.gz
Size 707.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9c53347f85c521c7ce1a170f0e830740d6bbbf22b21cda31ec1411836354cd39
BLAKE2b-256 checksum
How to use checksums
92812b06e5daef053337562cc5b6bb80e9593904949705305da04034e621fe30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log

Release files / glinkfix-2.2.4-py3-none-any.whl

Download URL glinkfix-2.2.4-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6d881c24898cad22ea3c70e07f0a268810557ae50e8a8d23fd861e31ab6de42
BLAKE2b-256 checksum
How to use checksums
43dc622f8631a572648d35e569e250e6fb7273063dded099b5568feca34f47f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log

Release history Release notifications | RSS feed

2.2.6

2 release files

This release

2.2.4 This release

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.11

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.0.16

2 release files

1.0.15

2 release files

1.0.14

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page