diff --git a/torrent.py b/torrent.py index 7a6fd5606..cddbff3b6 100644 --- a/torrent.py +++ b/torrent.py @@ -36,6 +36,9 @@ def convert_torrent_to_note(base_dir: str, nickname: str, domain: str, if not post_json_object.get('type'): return None + if not isinstance(post_json_object['type'], str): + return None + if post_json_object['type'] != 'Torrent': return None diff --git a/video.py b/video.py index 53b254b58..98762f452 100644 --- a/video.py +++ b/video.py @@ -36,6 +36,9 @@ def convert_video_to_note(base_dir: str, nickname: str, domain: str, if not post_json_object.get('type'): return None + if not isinstance(post_json_object['type'], str): + return None + if post_json_object['type'] != 'Video': return None