Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jiao #56

Closed
wants to merge 3 commits into from
Closed

Jiao #56

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions history.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package bilibili

import (
"github.com/go-resty/resty/v2"
)

// ClearHistory 清空历史记录
func (c *Client) ClearHistory() error {
const (
method = resty.MethodPost
url = "https://api.bilibili.com/x/v2/history/delete"
)
_, err := execute[any](c, method, url, nil, fillCsrf(c))
return err
}
2 changes: 1 addition & 1 deletion tools/gen_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def snake_to_camel(snake_str):
if content or comment:
sep = '。' if content and comment else ''
comment = ' // %s%s%s' % (content, sep, comment)
comment = comment.replace('<br>', '。').replace('<br/>', '。').replace('<br />', '。')
comment = comment.replace('<br>', '。').replace('<br/>', '。').replace('<br />', '。').replace('\\', '')
print('\t%s %s `json:"%s%s`%s' % (name, m['type'], m['name'], m['notnull'], comment))
print('}')

2 changes: 1 addition & 1 deletion tools/gen_struct2.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def snake_to_camel(snake_str):
if content or comment:
sep = '。' if content and comment else ''
comment = ' // %s%s%s' % (content, sep, comment)
comment = comment.replace('<br>', '。').replace('<br/>', '。').replace('<br />', '。')
comment = comment.replace('<br>', '。').replace('<br/>', '。').replace('<br />', '。').replace('\\', '')
comment = comment.decode("utf-8").encode(sys.stdin.encoding)
print('\t%s %s `json:"%s%s`%s' % (name, m['type'], m['name'], m['notnull'], comment))
print('}')
Expand Down
Loading