From a04f2c61cce55c725fe24c2d245c8ebeab3fb27c Mon Sep 17 00:00:00 2001 From: Alfredo Casanova Date: Wed, 31 May 2023 19:45:03 -0300 Subject: [PATCH] prepend your domain and it works just add yourdomain.tld/ before the url and it will bypass the paywall! --- portable.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/portable.py b/portable.py index cfa07f8..2e9480b 100644 --- a/portable.py +++ b/portable.py @@ -1,5 +1,6 @@ import flask import requests +from flask import request app = flask.Flask(__name__) googlebot_headers = { @@ -94,6 +95,7 @@ def bypass_paywall(url): """ response = requests.get(url, headers=googlebot_headers) response.encoding = response.apparent_encoding +# response.encoding = 'UTF-8' return response.text @@ -107,5 +109,16 @@ def show_article(): link = flask.request.form["link"] return bypass_paywall(link) +@app.route("/", defaults={"path": ""}) +@app.route('/', methods=["GET"]) +def get_article(path): + full_url = request.url + parts = full_url.split('/',4) + if len(parts) >= 5: + actual_url = 'https://' + parts[4] + return bypass_paywall(actual_url) + else: + return "invalid url", 400 + app.run(debug=True)