-
Star
(254)
You must be signed in to star a gist -
Fork
(30)
You must be signed in to fork a gist
-
-
Save mathix420/e0604ab0e916622972372711d2829555 to your computer and use it in GitHub Desktop.
| // ==UserScript== | |
| // @name Medium Paywall Bypass | |
| // @namespace Violentmonkey Scripts | |
| // @run-at document-start | |
| // @match *://*.medium.com/* | |
| // @match *://medium.com/* | |
| // @match *://*/* | |
| // @grant none | |
| // @version 3.0 | |
| // @inject-into content | |
| // @updateURL https://gist.githubusercontent.com/mathix420/e0604ab0e916622972372711d2829555/raw/medium.user.js | |
| // @downloadURL https://gist.githubusercontent.com/mathix420/e0604ab0e916622972372711d2829555/raw/medium.user.js | |
| // @website freedium-mirror.cfd | |
| // @author Mathix420, ZhymabekRoman | |
| // @description Don't forget to remove `@match` filters you don't want. | |
| // ==/UserScript== | |
| // initCall is telling us if we need to inject the title observer | |
| function mediumRedirecter(initCall = false) { | |
| if ( | |
| // Allow seeing original articles that were already redirected to freedium. | |
| !window.location.href.endsWith('#bypass') && | |
| // Do not redirect when editing on medium. | |
| !window.location.href.includes("/edit?source=") && | |
| // Detect if we are on a medium website (regardless of the domain) | |
| document.head?.querySelector('meta[property="al:android:url"]')?.content?.includes('medium://p/') | |
| ) { | |
| window.location.href = 'https://freedium-mirror.cfd/' + window.location.href; | |
| } else if (initCall && /(.*\.|^)medium\.com$/.test(window.location.host)) { | |
| // Observe <title> changes | |
| new MutationObserver(function(mutations) { | |
| // If title change is detected, check if a freedium redirect is required | |
| if (mutations[0].target.textContent) mediumRedirecter(); | |
| }).observe( | |
| document.querySelector('title'), | |
| { subtree: true, characterData: true, childList: true } | |
| ); | |
| } | |
| } | |
| mediumRedirecter(true); |
@zzJinux yes, I thought about that too a couple months ago, I will try to implement it once I have more free time
@mathix420 I have already locally patched the script to add the predicate. I hope your version will do so.
@zzJinux if you want you can fork this gist and update it so I can replicate your changes
@mathix420 Just a few lines change: https://gist.github.com/zzJinux/364725e7c61810719286d94e88a4e38c I haven't had any issues.
Guys, sorry, yeah I known that's my fault. I need your help: Freedium-cfd/web#16 (comment)
Not sure if I'm doing something wrong, but the above script doesn't work as of the time of writing (at least in Firefox). This works though:
// ==UserScript==
// @name Medium Paywall Bypass
// @namespace Violentmonkey Scripts
// @run-at document-idle
// @match *://*.medium.com/*
// @grant none
// @version 2.5
// @author Mathix420, ZhymabekRoman
// ==/UserScript==
(function() {
function mediumRedirecter() {
if (
!window.location.hostname.includes('freedium.cfd') &&
window.location.hostname.includes('medium.com') &&
!window.location.href.endsWith('#bypass') &&
!window.location.href.includes("/edit?source=")
) {
window.location.href = 'https://freedium.cfd/' + window.location.href;
}
}
mediumRedirecter();
})();
Thanks for your effort.
The original script works great for me. However, your solution has one small problem: it can't work on domains other than medium.com. Here is a small list of third-party domains:
- uxplanet.org
- osintteam.blog
- ahmedelfakharany.com
- drlee.io
- generativeai.pub
- towardsdev.com
- infosecwriteups.com
- thetaoist.online
- devopsquare.com
- bettermarketing.pub
- itnext.io
- betterprogramming.pub
- curiouse.co
- betterhumans.pub
- uxdesign.cc
- thebolditalic.com
- codeburst.io
- writingcooperative.com
- entrepreneurshandbook.co
- storiusmag.com
- javascript.plainenglish.io
- code.likeagirl.io
- medium.datadriveninvestor.com
- blog.det.life
- python.plainenglish.io
- blog.stackademic.com
- ai.gopubby.com
- blog.devops.dev
- levelup.gitconnected.com
- ai.plainenglish.io
And so on.
Thanks for your effort.
The original script works great for me. However, your solution has one small problem: it can't work on domains other than medium.com. Here is a small list of third-party domains:
- uxplanet.org
- osintteam.blog
- ahmedelfakharany.com
- drlee.io
- generativeai.pub
- towardsdev.com
- infosecwriteups.com
- thetaoist.online
- devopsquare.com
- bettermarketing.pub
- itnext.io
- betterprogramming.pub
- curiouse.co
- betterhumans.pub
- uxdesign.cc
- thebolditalic.com
- codeburst.io
- writingcooperative.com
- entrepreneurshandbook.co
- storiusmag.com
- javascript.plainenglish.io
- code.likeagirl.io
- medium.datadriveninvestor.com
- blog.det.life
- python.plainenglish.io
- blog.stackademic.com
- ai.gopubby.com
- blog.devops.dev
- levelup.gitconnected.com
- ai.plainenglish.io
And so on.
what do you mean ? just add those domains to the script in @match part (or accept the script on eveypage ) or just use a bookmarker
javascript: (function () { window.location = window.location.toString().replace("https://", "https://freedium.cfd/"); })();
Hi, here is my modified version:
https://gist.github.com/allenyllee/05e07d0c12bcf6d67edf5ed87f4b7629
I use ChatGPT to modify it, asking it to add a bypass button in the bottom right corner and auto-detect whether freedium.cfd or freedium-mirror.cfd is available. It should then redirect to the available domain.
In case freedium goes unstable, how about disabling redirects for free posts? This is the predicate to check if it is a premium content:
document.querySelector('.meteredContent') != null