diff --git a/infomentor/config.py b/infomentor/config.py index 14db11c..6997342 100644 --- a/infomentor/config.py +++ b/infomentor/config.py @@ -13,6 +13,7 @@ def load(): _config.add_section('smtp') _config['pushover']['apikey'] = '' _config['general']['secretkey'] = '' + _config['general']['baseurl'] = '' _config['smtp']['server'] = '' _config['smtp']['username'] = '' _config['smtp']['password'] = '' diff --git a/infomentor/informer.py b/infomentor/informer.py index 1733f95..921d0ef 100755 --- a/infomentor/informer.py +++ b/infomentor/informer.py @@ -69,7 +69,7 @@ class Informer(object): text = news.content for attachment in news.attachments: fid, fname = attachment.localpath.split('/') - text += '''
Attachment {0}: https://files.hyttioaoa.de/{1}
'''.format(fname, attachment.localpath) + text += '''
Attachment {0}: {2}/{1}
'''.format(fname, attachment.localpath, cfg['general']['baseurl']) parsed_date = dateparser.parse(news.date) now = datetime.datetime.now() parsed_date += datetime.timedelta(hours=now.hour, minutes=now.minute) @@ -107,7 +107,7 @@ class Informer(object): text = ' {}'.format(text) with open(fpath, 'w+') as f: f.write(text) - return 'https://files.hyttioaoa.de/{}.html'.format(filename) + return '{}/{}.html'.format(cfg['general']['baseurl'], filename) def _notify_news_mail(self, news): # Import the email modules we'll need @@ -166,7 +166,7 @@ class Informer(object): text = hw.text for attachment in hw.attachments: fid, fname = attachment.localpath.split('/') - text += '''
Attachment {0}: https://files.hyttioaoa.de/{1}
'''.format(fname, attachment.localpath) + text += '''
Attachment {0}: {2}/{1}
'''.format(fname, attachment.localpath, cfg['general']['baseurl']) if len(text) > 900: url = self._make_site(text) shorttext = text[:900]