Skip to content

Commit

Permalink
Filter NUL bytes from TikTok import
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Jan 31, 2022
1 parent 3909b58 commit 564b740
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datasources/tiktok/search_tiktok.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ def import_from_file(self, path):
if self.interrupted:
raise WorkerInterruptedException()

post = json.loads(line)["data"]
# remove NUL bytes here because they trip up a lot of other
# things
post = json.loads(line.replace("\0", ""))["data"]

hashtags = [extra["hashtagName"] for extra in post.get("textExtra", []) if "hashtagName" in extra and extra["hashtagName"]]

Expand Down

0 comments on commit 564b740

Please sign in to comment.