Skip to content

Commit

Permalink
Skip live streams when capturing TikTok posts
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Dec 12, 2024
1 parent 889f6a8 commit d9367ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/tiktok.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ zeeschuimer.register_module(
}
let items = r.filter(x => x.hasOwnProperty('item') && x.hasOwnProperty('type')).map(x => x["item"]);
let known_fields = ["id", "desc", "createTime", "music", "duetInfo"];
let bad_fields = ["liveRoomInfo"]; // if these are present, skip the post, e.g. for live streams
for(let i in items) {
let item = items[i];
let item_ok = true;
Expand All @@ -58,6 +59,11 @@ zeeschuimer.register_module(
item_ok = false;
}
}
for (let j in bad_fields) {
if (item.hasOwnProperty(bad_fields[j])) {
item_ok = false;
}
}
if(item_ok) {
useable_items.push(item);
}
Expand Down

0 comments on commit d9367ac

Please sign in to comment.