Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] YouTube support #38

Open
Wxrlds opened this issue Jul 19, 2020 · 4 comments
Open

[Suggestion] YouTube support #38

Wxrlds opened this issue Jul 19, 2020 · 4 comments

Comments

@Wxrlds
Copy link

Wxrlds commented Jul 19, 2020

When clicking a link in the description of any YouTube video, it first redirects you to youtube.com/redirect and from there to your desired location.
As Google and YouTube belong together it's kind of useless preventing being tracked by google.com but when clicking a link through YouTube they still track you.
It would be nice if this addon could also prevent YouTube from modifying links.

@Rob--W
Copy link
Owner

Rob--W commented Jul 19, 2020

I looked at a random video with a link in the description (https://www.youtube.com/watch?v=y7h_B7UPaYI) and found the following example:

<a class="yt-simple-endpoint style-scope yt-formatted-string" spellcheck="false" href="/redirect?redir_token=[ some long base64-encoded string ]&amp;q=[ url-encoded absolute URL here ]&amp;v=[ video id ]&amp;event=video_description" rel="nofollow" target="_blank" dir="auto">[ absolute URL here ]</a>

I suppose that the logic from my extension is generic enough that it can work for YouTube, with some small modifications.

I'm not going to add this to my extension, however, because it requires a new extension permission (access to youtube). When a new permission is requested, Chrome disables the extension unil the permission change is explicitly approved (and Firefox pauses updates until explicitly approved). There are alternatives (optional permissions + dynamic content scripts), but that incurs some performance cost.

Links in YouTube descriptions are often not the real URLs anyway. They are often shortened links redirecting to the actual destination, loaded with trackers (affiliate links) to support the content creator who published the video.

@hatkidchan
Copy link

Can also be extended into removing &si=XXXXXXXX parameter when sharing it

@1nikolas
Copy link

Also there is the &pp= parameter when copying links from a search

@ale5000-git
Copy link

ale5000-git commented Jul 21, 2024

Look at this example, in the description of: https://www.youtube.com/watch?v=WyrpYUzcjtY
there is this url: https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqbXBTYWZhUmJnR3JIQzhDV2ZRN05aM2RSQTVCZ3xBQ3Jtc0tsOTA5bWZlVmhFVC03LW96VWlpZU9PVGU2VVh3dUtLaDNxdEJwei1JekowZy1UbnJsR0JUTzVwXzRpTlVPcGtGTDd3b0J4TEpzMzhpQ3pfUlhMZ2JPdE03anRnSHdHdVJzQTVvZUpPVFZXMkpSSk1pTQ&q=https%3A%2F%2Fgithub.com%2Fmicro5k%2Fmicrog-unofficial-installer%2Freleases%2Fdownload%2Fv1.3.1-beta%2Fmicrog-unofficial-installer-v1.3.1-beta-by-ale5000-OSS-signed.zip&v=WyrpYUzcjtY

Only the thing inside q= is the real URL, everything else can be discarded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants