mirror of
https://github.com/tgbot-collection/YYeTsBot.git
synced 2025-11-25 11:29:38 +08:00
隐藏资源的功能
This commit is contained in:
@@ -243,6 +243,9 @@ class ResourceHandler(BaseHandler):
|
||||
|
||||
resource_id = int(self.get_query_argument("id"))
|
||||
username = self.get_current_user()
|
||||
if str(resource_id) in os.getenv("HIDDEN_RESOURCE", "").split(","):
|
||||
self.set_status(HTTPStatus.NOT_FOUND)
|
||||
return {"status": 0, "info": "资源已隐藏", }
|
||||
data = self.instance.get_resource_data(resource_id, username)
|
||||
if not data:
|
||||
self.ban()
|
||||
|
||||
Reference in New Issue
Block a user