From b42098cce0a9926c86e654c0415b140ed3391303 Mon Sep 17 00:00:00 2001 From: Wasi Master Date: Thu, 1 Jun 2023 09:20:27 +0600 Subject: [PATCH] small fixes and cleanup --- portable.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/portable.py b/portable.py index 2e9480b..f152c77 100644 --- a/portable.py +++ b/portable.py @@ -95,7 +95,6 @@ def bypass_paywall(url): """ response = requests.get(url, headers=googlebot_headers) response.encoding = response.apparent_encoding -# response.encoding = 'UTF-8' return response.text @@ -115,10 +114,10 @@ def get_article(path): full_url = request.url parts = full_url.split('/',4) if len(parts) >= 5: - actual_url = 'https://' + parts[4] + actual_url = 'https://' + parts[4].lstrip('/') return bypass_paywall(actual_url) else: return "invalid url", 400 -app.run(debug=True) +app.run(debug=False)