From cbd88ea7fadbe16eaeef8777d418e981840d9b2a Mon Sep 17 00:00:00 2001 From: urlbot Date: Mon, 9 Feb 2015 04:01:35 +0100 Subject: [PATCH] command_wp: urlencode generated URLs --- plugins.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins.py b/plugins.py index e0de805..5f039f6 100644 --- a/plugins.py +++ b/plugins.py @@ -587,7 +587,9 @@ def command_wp(argv, lang='de', **args): page = next(iter(j['query']['pages'].values())) short = page.get('extract', None) linktitle = page.get('title', query).replace(' ', '_') - link = 'https://%s.wikipedia.org/wiki/%s' % (lang, linktitle) + link = 'https://%s.wikipedia.org/wiki/%s' % ( + lang, urllib.parse.quote(linktitle) + ) except Exception as e: logger('plugin', 'wp(%s) failed: %s, %s' % (query, e, traceback.format_exc())) return {