Skip to main content

Google Drive Link Fixer

Project description

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


Google Drive Link Fixer

Installation

The Google Drive Link Fixer is lightweight, pure Python, with no third-party dependencies.

pip3 install glinkfix  

Purpose / Usage

When you share files with Google Drive, the sharing link you get is only good for accessing the content through a web browser. If you want to use a Google Drive 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's a pain. 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, it starts to get very tedious. This tool is designed to remove the tedium.

Note: The animated gifs below are actually hosted on Google Drive, and the corrected links are embedded into this README file.


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

Retrieving Google Link


Now run glinkfix and paste the link into the terminal. Copy the "fixed" version and use is as required.

Using Google Link


To display the help menu, run: glinkfix -h

usage: glinkfix [-h] (-v | -d)

This program takes a Google Drive sharing link for a file and repackages it into a link
that can be downloaded directly (e.g. using curl) or embedded in a document to be viewed
(e.g. an image in a markdown document). Note: there is a size limit of 40MB for a single
file when using Google Drive links in this manner.

optional arguments:
  -h, --help      show this help message and exit
  -v, --view      repackage the link for viewing (e.g. as an embedded link in a markdown
                  document).
  -d, --download  repackage the link for downloading (e.g. downloading using curl).

Usage Notes

  • There is a 40MB size limit for a single file when using Google Drive sharing links directly for viewing or downloading. Individual files larger than 40MB will not render/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 links that use Google's resource key security feature.

Version History

  • 1.0.7 (2022-07-15)
    • Fixed handling of URLs with resource keys.
    • Code cleanup and refactoring.
    • Implemented custom exception handling.
    • Implemented testing infrastructure.

  • 1.0.6 (2022-01-17)
    • Code cleanup.

  • 1.0.5 (2021-12-23)
    • Code linting.
    • Documentation cleanup.

  • 1.0.4 (2021-12-19)
    • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glinkfix-1.0.7.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

glinkfix-1.0.7-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file glinkfix-1.0.7.tar.gz.

File metadata

  • Download URL: glinkfix-1.0.7.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for glinkfix-1.0.7.tar.gz
Algorithm Hash digest
SHA256 13754beb9d4d115632b0481422b412bdcc269a9b2f074d2570e9b2e790ebb49b
MD5 56c7e7315b65480e35152bb912f5c529
BLAKE2b-256 533c7bae19c53b35c47848f8deb1c808dc9cb63a7d7fd2eae2c26c962db718b5

See more details on using hashes here.

File details

Details for the file glinkfix-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: glinkfix-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for glinkfix-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 76e03e57bca6d88f4ea072aae6fe134a99dffea4474a274e332ff651f5e51993
MD5 d6109ad0d10214983e895b134c42f3bf
BLAKE2b-256 3fe89fe0f05c31c4cc46e22cf33ed88548ad31cdec600991a74c2f8e5388fb8b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page