Git Product home page Git Product logo

Comments (6)

chexxor avatar chexxor commented on May 20, 2024 1

My friends send links like this to me:
https://www.tiktok.com/t/something/
And my browser expands it to:
https://www.tiktok.com/@user/video/12345678901234567890?_t=something&_r=1

So it must be a short link. We could use a regex to match the URL path in the short-URL, but to resolve it to the final URL and remove tracking parameters, we would need to fetch the expanded URL from TikTok.

Short-URLs can be so nefarious. 😞

from leon.

svenjacobs avatar svenjacobs commented on May 20, 2024 1

As you already found out, there is a similar discussion regarding Amazon short links. Leon would have to perform a HTTP request while currently it can do all the cleaning locally. I still haven't decided whether I like or hate this idea 😉

from leon.

svenjacobs avatar svenjacobs commented on May 20, 2024

Hello @chexxor,

it depends on how TikTok URLs are structured and what needs to be removed. As I don't use TikTok, I have no clue and need user input here 🙂

In most cases a regular expression is sufficient. There are a few examples in this project of sanitizers that use regular expressions.

from leon.

chexxor avatar chexxor commented on May 20, 2024

I found some existing work for it.
https://git.sr.ht/~zethra/tiktok-url-cleaner/tree/main/item/src/main.rs#L85

I'm not familiar with Rust, but I see a web request, so I would guess it's to do short-URL expansion if necessary, or maybe it's to check whether the URL is valid or not.

Anyways, it looks like it just removes all the query parameters after ensuring it's a valid URL.

from leon.

chexxor avatar chexxor commented on May 20, 2024

TikTok will know that I opened the URL if I use my browser to expand the short-URL, because my browser would send cookies.

One advantage to using Leon to sanitize it is TikTok wouldn't get mg browser cookies, making the URL expansion relatively anonymous.

Then, if I want to further share the URL with my other friends, it's better to share the anonymized URL rather than the original one.

So there's an advantage to using Leon to open TikTok links for myself, and also for my friends with whom I reshare a link.

Related to discussion on Amazon links here: #75

from leon.

svenjacobs avatar svenjacobs commented on May 20, 2024

I decided to not implement this because I believe that Leon should stay close to its roots, namely providing privacy by removing tracking and other obsolete parameters. Performing network requests actually reduces privacy because it leaves trails on the server owned by the company, in this case TikTok (ByteDance). If you really want to sanitize these URLs, please unwrap them manually by opening them and then send the unwrapped URL to Leon. If you further want to talk about this, please use this discussion.

from leon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.