diff --git a/youtube/accounts.py b/youtube/accounts.py index 4108269..bde9852 100644 --- a/youtube/accounts.py +++ b/youtube/accounts.py @@ -64,10 +64,10 @@ def add_account(env, start_response): use_tor = False if _add_account(parameters['username'][0], parameters['password'][0], save_account, use_tor ): - start_response('200 OK', () ) + start_response('200 OK', [('Content-type', 'text/plain'),] ) return b'Account successfully added' else: - start_response('200 OK', () ) + start_response('200 OK', [('Content-type', 'text/plain'),] ) return b'Failed to add account' def get_account_login_page(env, start_response): diff --git a/youtube/channel.py b/youtube/channel.py index 6acb371..1ec5635 100644 --- a/youtube/channel.py +++ b/youtube/channel.py @@ -402,7 +402,7 @@ def get_channel_page(env, start_response): result = channel_search_page(polymer_json, query, page_number, number_of_videos, env['QUERY_STRING']) else: - start_response('404 Not Found', ()) + start_response('404 Not Found', [('Content-type', 'text/plain'),]) return b'Unknown channel tab: ' + tab.encode('utf-8') start_response('200 OK', [('Content-type','text/html'),]) @@ -423,7 +423,7 @@ def get_channel_page_general_url(env, start_response): page = 'videos' base_url = 'https://www.youtube.com/' + '/'.join(path_parts) else: - start_response('404 Not Found', ()) + start_response('404 Not Found', [('Content-type', 'text/plain'),]) return b'Invalid channel url' if page == 'videos': @@ -446,7 +446,7 @@ def get_channel_page_general_url(env, start_response): polymer_json = json.loads(polymer_json) return channel_search_page(''' else: - start_response('404 Not Found', ()) + start_response('404 Not Found', [('Content-type', 'text/plain'),]) return b'Unknown channel page: ' + page.encode('utf-8') start_response('200 OK', [('Content-type','text/html'),]) diff --git a/youtube/local_playlist.py b/youtube/local_playlist.py index bfca48f..0375040 100644 --- a/youtube/local_playlist.py +++ b/youtube/local_playlist.py @@ -155,7 +155,7 @@ def path_edit_playlist(env, start_response): return b'' else: - start_response('400 Bad Request', ()) + start_response('400 Bad Request', [('Content-type', 'text/plain'),]) return b'400 Bad Request' def edit_playlist(env, start_response): @@ -165,5 +165,5 @@ def edit_playlist(env, start_response): add_to_playlist(parameters['playlist_name'][0], parameters['video_info_list']) start_response('204 No Content', ()) else: - start_response('400 Bad Request', ()) + start_response('400 Bad Request', [('Content-type', 'text/plain'),]) return b'400 Bad Request' diff --git a/youtube/watch.py b/youtube/watch.py index 9e3a1c2..04a5b5d 100644 --- a/youtube/watch.py +++ b/youtube/watch.py @@ -231,7 +231,7 @@ music_list_table_row = Template('''