mirror of
https://github.com/jooray/rss2podcast.git
synced 2025-05-23 07:52:00 +00:00
16 lines
407 B
Python
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
|