Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( THREAD_COUNT = 2 GET_IP_LOCATION = false // 获取ip地址 ENHANCE_ORI_REPLY = false // 功能见 #35 PAGE_DOWNLOAD_LIMIT = 100 // 限制单次下载的页数 #56 USE_TITLE_AS_FOLDER_NAME = false USE_TITLE_AS_MD_FILE_NAME = false USE_LOCAL_SMILE_PIC = false // 使用本地表情 #58 LOCAL_SMILE_PIC_PATH = "../smile/" //本地表情路径 #58 )
这里是配置文件可以改的
View Source
var ( VERSION = "1.5.2" //需要手动改 BUILD_TS = "1691664141" //无需,GitHub actions会自动填写 GIT_REF = "" //无需,GitHub actions会自动填写 GIT_HASH = "" //无需,GitHub actions会自动填写 DELAY_MS = 330 )
这里配置文件和传参都没法改
View Source
var BASE_URL string
View Source
var COOKIE string
View Source
var (
DEBUG_MODE = "1" //GitHub Actions 打包的时候会修改为"0"。本地打包可以 go build -ldflags "-X 'github.com/ludoux/ngapost2md/nga.DEBUG_MODE=0'" main.go
)
ldflags 区域。GitHub Actions 编译时会使用 ldflags 来修改如下值:
View Source
var UA string
Functions ¶
func ToSaveFilename ¶
Types ¶
type NgaClient ¶
type NgaClient struct { *req.Client // contains filtered or unexported fields }
var Client *NgaClient
func NewNgaClient ¶
func NewNgaClient() *NgaClient
type Tiezi ¶
type Tiezi struct { Tid int Title string TitleFolderSafe string Catelogy string Username string UserId int WebMaxPage int LocalMaxPage int LocalMaxFloor int FloorCount int //包含主楼 Floors Floors //主楼为[0] HotPosts Floors Timestamp int64 //page() fixFloorContent() 中会更新 Version string //这个是软件的version Assets map[string]string }
func (*Tiezi) GetNeededFolderName ¶
会首先调用FindFolderNameByTid,确定本地没有相关文件夹再返回指定格式文件名。否则返回本地已有文件名
func (*Tiezi) InitFromLocal ¶
*
- @description: 本地已经有生成过,现在来根据local信息来追加下载新楼层。
- @param {int} tid 帖子tid
- @return {*}
func (*Tiezi) SaveAssetsMap ¶
func (tiezi *Tiezi) SaveAssetsMap()
func (*Tiezi) SaveProcessInfo ¶
func (tiezi *Tiezi) SaveProcessInfo()
Click to show internal directories.
Click to hide internal directories.