• John Colagioia@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 hours ago

    I developed this script for creating permanent/static archives of social media exports, so it’s not a full solution - not a web service, expects file inputs, uses a probably incomplete list of shorteners to avoid pulling real pages - but it along with the shorteners.txt file in the same repository, iterating to find a domain not on the list, might at least inspire a solution, if it’s not good for your specific cases.

  • solrize@lemmy.ml
    link
    fedilink
    English
    arrow-up
    12
    ·
    8 hours ago

    It’s a little complicated. Sometimes the curl command further up works, but sometimes the redirection is done in an html meta tag or even with javascript. I have a messy python script that has a bunch of site specific code to bypass redirects and clean up tracking links. I can’t post it in its present condition (it has some private info embedded) but I’ve been wanting to clean it up and post it sometime.

  • antsu@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    15
    ·
    9 hours ago

    I understand this is not exactly what you’re asking for, but if you have access to a terminal, you can “unshorten” a link with:

    curl --head -L https://example.com/short | grep: location

  • EndOfLine@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    8 hours ago

    I’ve not used it, but your question got me wondering so I searched and found the following site which tries to navigate various redirect methods to find the final destination. I’d be curious to know how well it works.

    https://www.redirect-checker.org/

    • jherazob@fedia.ioOP
      link
      fedilink
      arrow-up
      2
      ·
      7 hours ago

      I was hoping for a self-hosted resource, not a remote API, since this is the Selfhosted community