aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/common.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-07-09 03:01:33 -0700
committerJames Taylor <user234683@users.noreply.github.com>2018-07-09 03:01:33 -0700
commit1fa66ffb0f6d7bec16faab45d9551f94cb662d4d (patch)
tree7b22f0100168f3301adb21ace74adc39d93ff802 /youtube/common.py
parent52835db0a83e071ffe72be80fa68445c370b47cb (diff)
downloadyt-local-1fa66ffb0f6d7bec16faab45d9551f94cb662d4d.tar.lz
yt-local-1fa66ffb0f6d7bec16faab45d9551f94cb662d4d.tar.xz
yt-local-1fa66ffb0f6d7bec16faab45d9551f94cb662d4d.zip
fix search box not having query searched for in results page
Diffstat (limited to 'youtube/common.py')
-rw-r--r--youtube/common.py6
1 files changed, 3 insertions, 3 deletions
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('''
<header>
<div id="header-left">
<form id="site-search" action="/youtube.com/search">
- <input type="search" name="query" class="search-box">
+ <input type="search" name="query" class="search-box" value="$search_box_value">
<button type="submit" value="Search" class="search-button">Search</button>
</form>
</div>
@@ -311,11 +311,11 @@ $playlists
</header>
''')
playlist_option_template = Template('''<option value="$name">$name</option>''')
-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))