diff --git a/youtube/common.py b/youtube/common.py index 6e0f4eb..d119607 100644 --- a/youtube/common.py +++ b/youtube/common.py @@ -293,7 +293,7 @@ header_template = Template('''
@@ -311,11 +311,11 @@ $playlists
''') playlist_option_template = Template('''''') -def get_header(): +def get_header(search_box_value=""): playlists = '' for name in local_playlist.get_playlist_names(): playlists += playlist_option_template.substitute(name = name) - return header_template.substitute(playlists=playlists) + return header_template.substitute(playlists = playlists, search_box_value = html.escape(search_box_value)) diff --git a/youtube/search.py b/youtube/search.py index 09a161e..13daa2c 100644 --- a/youtube/search.py +++ b/youtube/search.py @@ -129,7 +129,7 @@ def get_search_page(query_string, parameters=()): result = Template(yt_search_results_template).substitute( - header = common.get_header(), + header = common.get_header(query), results = result_list_html, page_title = query + " - Search", search_box_value = html.escape(query),