From c562f8705925f33b8b2de7ffe55543e335159856 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 24 Nov 2021 11:47:25 +0100 Subject: [PATCH] clean urls --- app/video/management/commands/load_titles.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/video/management/commands/load_titles.py b/app/video/management/commands/load_titles.py index 5a12f07..058eae6 100644 --- a/app/video/management/commands/load_titles.py +++ b/app/video/management/commands/load_titles.py @@ -8,7 +8,9 @@ def escape(key): return key.replace('%', '%25').replace('&', '%26').replace('_', '%09').replace(' ', '_').replace('<', '%0E').replace('>', '%0F') def escape_slug(key): - return key.replace('%', '').replace('&', '-').replace('_', '-').replace(' ', '-').replace('<', '').replace('>', '').lower() + key = ox.decode_html(key).replace('%', '').replace('&', '-').replace('_', '-').replace(' ', '-').replace('<', '').replace('>', '').lower() + key = key.replace("'", '').replace('"', '').strip() + return key class Command(BaseCommand): help = 'import titles from pan.do/ra'