Fix catch ytapi.ChannelNotFound and return json 404.
This commit is contained in:
		
							parent
							
								
									4af4985ac5
								
							
						
					
					
						commit
						26704c238e
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -87,8 +87,8 @@ def post_add_channel(): | |||
|         # It seems they have given us a username instead. | ||||
|         try: | ||||
|             channel_id = common.ycdldb.youtube.get_user_id(username=channel_id) | ||||
|         except IndexError: | ||||
|             flask.abort(404) | ||||
|         except ycdl.ytapi.ChannelNotFound: | ||||
|             return jsonify.make_json_response({}, status=404) | ||||
| 
 | ||||
|     channel = common.ycdldb.add_channel(channel_id, get_videos=True) | ||||
|     return jsonify.make_json_response(ycdl.jsonify.channel(channel)) | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue