rss2podcast/web_utils.py
2025-05-20 15:32:43 +02:00

16 lines
407 B
Python

import json
import re
def generate_config(config_template, podcast_id):
config_str = json.dumps(config_template)
config_str = config_str.replace('{podcast_id}', podcast_id)
config = json.loads(config_str)
config['podcast_id'] = podcast_id
return config
def sanitize_username(username):
if re.match(r'^[a-zA-Z0-9_-]+$', username):
return True
else:
return False