twspace-crawler
twspace-crawler copied to clipboard
Protected accounts saving/organization and missing webhook
If the host of a space has a private account, there's no Discord webhook sent for whatever reason but also the file(s) don't get properly organized. I tested it by hosting a space with a private account, and using the auth of my other account that follows it.
https://github.com/HitomaruKonpaku/twspace-crawler/blob/430247d89b18d92bada17a56180ec64ec3727970/src/modules/SpaceWatcher.ts#L63 calls https://github.com/HitomaruKonpaku/twspace-crawler/blob/430247d89b18d92bada17a56180ec64ec3727970/src/utils/SpaceUtil.ts#L22
but for protected accounts the value of creator_results
is
"creator_results": {
"result": {
"__typename": "UserUnavailable",
"reason": "Protected"
}
}
I think we should modify SpaceUtil's functions to mitigate a protected account such as by adding a check to SpaceUtil#getHostUsername and other relevant functions. Despite create_results
being unavailable we could utilize audiospace.participants.admins[0]
instead as from my gathering that is always the host. Even though the account is protected, we can pull relevant data such as user and display names as well as the user's id and avatar (src/interfaces/Twitter.interface.ts#L69).
By using this information and adding checks, we could derive the appropriate information and be able to send the webhook with no problem as well as organizing the files accordingly.
I can help work on this but I will be busy until the next 12 hours or so.
Oh yea rarely got this issue.
I plan to rewrite this sometime soon to support other issue (like detect and notify ended Space)