Remove protocol part from URL

This commit is contained in:
Yax 2015-05-02 20:24:12 +02:00
parent 39039fd533
commit 1521daf485

View file

@ -61,7 +61,11 @@ def convert_comment(db, site, filename):
if 'site' in d: if 'site' in d:
comment.author_site = d['site'] comment.author_site = d['site']
if 'url' in d: if 'url' in d:
comment.url = d['url'] logger.info(d['url'][:6])
if d['url'][:7] == 'http://':
comment.url = d['url'][7:]
elif d['url'][:8] == 'https://':
comment.url = d['url'][8:]
# else: # else:
# comment.url = d['article'] # comment.url = d['article']
if 'date' in d: if 'date' in d: