gobilibililogin

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

README

GoBilibiliLogin

golang实现的bilibili登录

改自 login_bili_go, 适配我的其他程序, 方便复用

用法

安装
go get -u https://github.com/boxie123/GoBilibiliLogin
示例代码
package main

import (
	"fmt"
	login "github.com/boxie123/GoBilibiliLogin"
)

func main() {
	cookie, csrf, configFilePath := login.Login()

	fmt.Printf("Cookie: %s\ncsrf: %s\ncookie文件存储路径: %s\n", cookie, csrf, configFilePath)
}

可在命令行参数中传入来指定文件名,若不传入则默认bzcookie.json

Documentation

Index

Constants

View Source
const UserAgent = `` /* 131-byte string literal not displayed */

Variables

This section is empty.

Functions

func Login

func Login() (string, string, string)

Login

@Description: 自动登录 Bilibili 账号并储存 cookie 到文件
@return string cookie
@return string csrf
@return string configFilePath 登录信息文件存储路径

Types

type ConfigInfo

type ConfigInfo struct {
	AccessKey    string `json:"accessKey"`
	Cookie       string `json:"cookie"`
	RefreshToken string `json:"refresh_token"`
}

ConfigInfo 配置信息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL