glinkfix


Nameglinkfix JSON
Version 2.0.4 PyPI version JSON
download
home_pageNone
SummaryGoogle Drive Link Fixer
upload_time2024-11-15 17:11:47
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2021-2024, Peter Nardi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords curl download drive embed glinkfix google image link markdown
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![GitHub](https://img.shields.io/github/license/geozeke/glinkfix)
![PyPI](https://img.shields.io/pypi/v/glinkfix)
![PyPI - Status](https://img.shields.io/pypi/status/glinkfix)
![GitHub last commit](https://img.shields.io/github/last-commit/geozeke/glinkfix)
![GitHub issues](https://img.shields.io/github/issues/geozeke/glinkfix)
![PyPI - Downloads](https://img.shields.io/pypi/dm/glinkfix)
![GitHub repo size](https://img.shields.io/github/repo-size/geozeke/glinkfix)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/glinkfix)

<br>

# glinkfix

<br>

<img src="https://lh3.googleusercontent.com/d/1H04KVAA3ohH_dLXIrC0bXuJXDn3VutKc"
alt="Dinobox logo" width="120"/>

## Google Drive Link Fixer

## Notes (please read)

1. It's turning into an arms race. Google keeps changing how links are
   handled on their servers, which often breaks tools like *glinkfix*.
   Direct downloading and embedding G-Drive links is definitely an
   unsupported "off the books" feature as far as Google is concerned. As
   of Jan 2024, Google made a significant change, which definitely broke
   some links created with this tool. This update (Apr 2024) works, *for
   now*, but if Google changes again, things may break.

2. Viewing links that point to animated gifs may just show up 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-based
   operating systems (not Server installs). Even without automatic
   copying, link fixing will still work and the results will be
   displayed on the screen, regardless of where you run it (Server or
   Desktop). *glinkfix* uses the [pyperclip][def9] library, and
   automatic copying to the clipboard should work seamlessly on
   Windows/Mac. If you're running Linux and links are not automatically
   copied to the clipboard, [refer to this note][def8] from the
   pyperclip developer.

## To Developers

If you're just using *glinkfix*, then carry on!

If you're a developer looking to fork this repository and modify
*glinkfix*, there are two important considerations:

1. *glinkfix* requires [uv][def11] for dependency management. It is well
   behaved and extremely fast. If you're a Python developer you should
   check it out. Visit the [uv site][def11] and install it using using
   the instructions for your operating system.

2. I've included a file called `global-gitignore.txt` which is a copy of
   the `.gitignore` I placed in my home directory and configured
   globally for all my development projects. The `global-gitignore.txt`
   file reflects my development setup (for example using tools like
   vscode), but yours may be different. Just cherry-pick any necessary
   elements from `global-gitignore.txt` for your own use.

   *Details on gitignore files are available on [GitHub][def2].*

## Installation

The preferred way to install *glinkfix* is with [pipx][def3]:

```shell
pipx install glinkfix
```

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

```shell
pip3 install glinkfix
```

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

```shell
pipx run glinkfix -h
```

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

## 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 images below are actually hosted on Google Drive and the
"fixed" links are embedded into this README file.*

---

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*):

<img src="https://lh3.googleusercontent.com/d/1aHqCi_R6S9T9OI8kYLj-bH-Rd1eEgiWd"
alt="Getting Link" width="450"/>

---

<img src="https://lh3.googleusercontent.com/d/1DM7C91o8K32B95YkVPUv9rVga6lJdYzA"
alt="Getting Link" width="450"/>

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

---

To display the help menu, run: `glinkfix -h`

```text
usage: glinkfix [-h] [-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
  -d, --download  The default behavior for glinkfix is to repackage a
                  Google Drive link to make it suitable for embedding in
                  a website. Use this option if you want to repackage
                  Google Drive link for direct 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][def6]
 security feature.

## Version History

View releases on the [*glinkfix* git repository][def7]

### License

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

### Acknowledgements

This project uses the [pyperclip library][def4] which is licensed under
the BSD 3 Clause License. The full license text can be found in the
[LICENSE-BSD-3-CLAUSE][def10] file.

[def2]: https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
[def3]: https://pipx.pypa.io/stable/
[def4]: https://github.com/asweigart/pyperclip
[def5]: ./LICENSE
[def6]: https://support.google.com/a/answer/10685032
[def7]: https://github.com/geozeke/glinkfix
[def8]: https://pyperclip.readthedocs.io/en/latest/index.html#not-implemented-error
[def9]: https://pypi.org/project/pyperclip/
[def10]: ./LICENSE-BSD-3-CLAUSE
[def11]: https://docs.astral.sh/uv/

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "glinkfix",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Peter Nardi <pete@nardi.com>",
    "keywords": "curl, download, drive, embed, glinkfix, google, image, link, markdown",
    "author": null,
    "author_email": "Peter Nardi <pete@nardi.com>",
    "download_url": "https://files.pythonhosted.org/packages/a0/43/fe8eda523908081811b6920a4a2c48b84da5134f123d2bcbac6f51d1d399/glinkfix-2.0.4.tar.gz",
    "platform": null,
    "description": "![GitHub](https://img.shields.io/github/license/geozeke/glinkfix)\n![PyPI](https://img.shields.io/pypi/v/glinkfix)\n![PyPI - Status](https://img.shields.io/pypi/status/glinkfix)\n![GitHub last commit](https://img.shields.io/github/last-commit/geozeke/glinkfix)\n![GitHub issues](https://img.shields.io/github/issues/geozeke/glinkfix)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/glinkfix)\n![GitHub repo size](https://img.shields.io/github/repo-size/geozeke/glinkfix)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/glinkfix)\n\n<br>\n\n# glinkfix\n\n<br>\n\n<img src=\"https://lh3.googleusercontent.com/d/1H04KVAA3ohH_dLXIrC0bXuJXDn3VutKc\"\nalt=\"Dinobox logo\" width=\"120\"/>\n\n## Google Drive Link Fixer\n\n## Notes (please read)\n\n1. It's turning into an arms race. Google keeps changing how links are\n   handled on their servers, which often breaks tools like *glinkfix*.\n   Direct downloading and embedding G-Drive links is definitely an\n   unsupported \"off the books\" feature as far as Google is concerned. As\n   of Jan 2024, Google made a significant change, which definitely broke\n   some links created with this tool. This update (Apr 2024) works, *for\n   now*, but if Google changes again, things may break.\n\n2. Viewing links that point to animated gifs may just show up as static\n   images.\n\n3. In the v2 update, in addition to displaying the fixed link on the\n   screen, *glinkfix* will also attempt to copy the fixed link to the\n   clipboard. Copying to the clipboard only works for Desktop-based\n   operating systems (not Server installs). Even without automatic\n   copying, link fixing will still work and the results will be\n   displayed on the screen, regardless of where you run it (Server or\n   Desktop). *glinkfix* uses the [pyperclip][def9] library, and\n   automatic copying to the clipboard should work seamlessly on\n   Windows/Mac. If you're running Linux and links are not automatically\n   copied to the clipboard, [refer to this note][def8] from the\n   pyperclip developer.\n\n## To Developers\n\nIf you're just using *glinkfix*, then carry on!\n\nIf you're a developer looking to fork this repository and modify\n*glinkfix*, there are two important considerations:\n\n1. *glinkfix* requires [uv][def11] for dependency management. It is well\n   behaved and extremely fast. If you're a Python developer you should\n   check it out. Visit the [uv site][def11] and install it using using\n   the instructions for your operating system.\n\n2. I've included a file called `global-gitignore.txt` which is a copy of\n   the `.gitignore` I placed in my home directory and configured\n   globally for all my development projects. The `global-gitignore.txt`\n   file reflects my development setup (for example using tools like\n   vscode), but yours may be different. Just cherry-pick any necessary\n   elements from `global-gitignore.txt` for your own use.\n\n   *Details on gitignore files are available on [GitHub][def2].*\n\n## Installation\n\nThe preferred way to install *glinkfix* is with [pipx][def3]:\n\n```shell\npipx install glinkfix\n```\n\nAlternatively, you can create a separate virtual environment and install\nit the traditional way:\n\n```shell\npip3 install glinkfix\n```\n\nIf you just need a quick one-time link fix, and don't want to commit to\na full installation, use:\n\n```shell\npipx run glinkfix -h\n```\n\nand follow the directions to run it again with the option you want.\n\n## Purpose / Usage\n\nWhen you share files with Google Drive, the sharing link you get is only\ngood for accessing the content through a web browser. If you want to use\na Google Drive sharing link to embed an image in a document (e.g. in a\nmarkdown or html file), or you want to directly download a file\npointed-to by a Google Drive sharing link using something like `curl` or\n`wget` in linux, the link needs to be adjusted (\"fixed\") for these\npurposes.\n\nIt's not especially hard to repackage the link, but it's a pain. You\nhave to copy the link to a text editor, carve it up manually, and\nreassemble it. If you've got a lot of links to deal with it starts to\nget very tedious. This tool is designed to remove the tedium.\n\n*Note: The images below are actually hosted on Google Drive and the\n\"fixed\" links are embedded into this README file.*\n\n---\n\nStart by getting a sharing link to a file on Google Drive. Make sure\nit's set up for public access (*Anyone with the link*):\n\n<img src=\"https://lh3.googleusercontent.com/d/1aHqCi_R6S9T9OI8kYLj-bH-Rd1eEgiWd\"\nalt=\"Getting Link\" width=\"450\"/>\n\n---\n\n<img src=\"https://lh3.googleusercontent.com/d/1DM7C91o8K32B95YkVPUv9rVga6lJdYzA\"\nalt=\"Getting Link\" width=\"450\"/>\n\nNow run *glinkfix* and paste the link into the terminal. Copy the\n\"fixed\" version and use it as required.\n\n---\n\nTo display the help menu, run: `glinkfix -h`\n\n```text\nusage: glinkfix [-h] [-d]\n\nThis program takes a Google Drive sharing link for a file and repackages\nit into a link that can be downloaded directly (e.g. using curl) or\nembedded in a document to be viewed (e.g. an image in a markdown\ndocument). Note: there is a size limit of 40MB for a single file when\nusing Google Drive links in this manner.\n\noptional arguments:\n  -h, --help      show this help message and exit\n  -d, --download  The default behavior for glinkfix is to repackage a\n                  Google Drive link to make it suitable for embedding in\n                  a website. Use this option if you want to repackage\n                  Google Drive link for direct downloading (e.g.\n                  downloading using curl).\n```\n\n## Usage Notes\n\n* There is a 40MB size limit for a single file when using Google Drive\n  sharing links directly for viewing or downloading. Individual files\n  larger than 40MB will not render/download properly. This limit is a\n  function of how Google Drive works and is not related to *glinkfix*.\n* When creating a download link for use with `curl` make sure to use\n  `curl`'s `-L` option to allow for redirects.\n* *glinkfix* supports links that use Google's [resource key][def6]\n security feature.\n\n## Version History\n\nView releases on the [*glinkfix* git repository][def7]\n\n### License\n\nThis project is licensed under the MIT License. See the [LICENSE][def5]\nfile for details.\n\n### Acknowledgements\n\nThis project uses the [pyperclip library][def4] which is licensed under\nthe BSD 3 Clause License. The full license text can be found in the\n[LICENSE-BSD-3-CLAUSE][def10] file.\n\n[def2]: https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files\n[def3]: https://pipx.pypa.io/stable/\n[def4]: https://github.com/asweigart/pyperclip\n[def5]: ./LICENSE\n[def6]: https://support.google.com/a/answer/10685032\n[def7]: https://github.com/geozeke/glinkfix\n[def8]: https://pyperclip.readthedocs.io/en/latest/index.html#not-implemented-error\n[def9]: https://pypi.org/project/pyperclip/\n[def10]: ./LICENSE-BSD-3-CLAUSE\n[def11]: https://docs.astral.sh/uv/\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2021-2024, Peter Nardi  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Google Drive Link Fixer",
    "version": "2.0.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/geozeke/glinkfix/issues",
        "Source Code": "https://github.com/geozeke/glinkfix"
    },
    "split_keywords": [
        "curl",
        " download",
        " drive",
        " embed",
        " glinkfix",
        " google",
        " image",
        " link",
        " markdown"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1ee60fd44634482fc30a493947bbd84a62e316d6b8c75968f3d67cbb7108a0e7",
                "md5": "de3d712f20f748503538227dae3ca93f",
                "sha256": "f798a330af1b6a5a40c6c9243ca6480f1a1c9ecc262fee75eeb50786d0e8b1ed"
            },
            "downloads": -1,
            "filename": "glinkfix-2.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "de3d712f20f748503538227dae3ca93f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 9218,
            "upload_time": "2024-11-15T17:11:46",
            "upload_time_iso_8601": "2024-11-15T17:11:46.557612Z",
            "url": "https://files.pythonhosted.org/packages/1e/e6/0fd44634482fc30a493947bbd84a62e316d6b8c75968f3d67cbb7108a0e7/glinkfix-2.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a043fe8eda523908081811b6920a4a2c48b84da5134f123d2bcbac6f51d1d399",
                "md5": "bfcbab40b63506ce5457288453f4b994",
                "sha256": "a3351fd4592f7dc2148187a961504fc940008f9328d0768108989ef767c2df00"
            },
            "downloads": -1,
            "filename": "glinkfix-2.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "bfcbab40b63506ce5457288453f4b994",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 8195,
            "upload_time": "2024-11-15T17:11:47",
            "upload_time_iso_8601": "2024-11-15T17:11:47.999718Z",
            "url": "https://files.pythonhosted.org/packages/a0/43/fe8eda523908081811b6920a4a2c48b84da5134f123d2bcbac6f51d1d399/glinkfix-2.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-15 17:11:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "geozeke",
    "github_project": "glinkfix",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "glinkfix"
}
        
Elapsed time: 1.32159s