mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-23 13:36:35 +00:00
Fixes from testing
The `automatic_captions` has a layer for language codes that I didn't account for. The type checking was copied and I didn't adjust for the arguments in this function.
This commit is contained in:
parent
25d2ff6802
commit
2f34fff713
@ -194,8 +194,8 @@ def filter_response(response_dict):
|
||||
Clean up the response so as to not store useless metadata in the database.
|
||||
'''
|
||||
# raise an exception for an unexpected argument type
|
||||
if not isinstance(filedata, dict):
|
||||
raise TypeError(f'filedata must be a dict, got "{type(filedata)}"')
|
||||
if not isinstance(response_dict, dict):
|
||||
raise TypeError(f'response_dict must be a dict, got "{type(response_dict)}"')
|
||||
# optimize the empty case
|
||||
if not response_dict:
|
||||
return response_dict
|
||||
@ -227,7 +227,11 @@ def filter_response(response_dict):
|
||||
and '&expire=' in url
|
||||
)
|
||||
|
||||
_drop_url_keys(response_dict, 'automatic_captions', drop_auto_caption_url)
|
||||
ac_key = 'automatic_captions'
|
||||
if ac_key in response_dict.keys():
|
||||
ac_dict = response_dict[ac_key]
|
||||
for lang_code in ac_dict:
|
||||
_drop_url_keys(ac_dict, lang_code, drop_auto_caption_url)
|
||||
# end of automatic_captions cleanup }}}
|
||||
|
||||
return response_dict
|
||||
|
Loading…
Reference in New Issue
Block a user