Skip to content

Commit

Permalink
Update SoBooks website URL to sobooks.cc (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyun8023 committed Jul 4, 2024
1 parent 0bcffb1 commit 1b958fb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ by your running environment.
|--------------------------------------------------|----------------------------------------|-----------------|----------------------------------------|-----------------------------------|----------------------------------|
| [智慧教育平台](#download-textbooks-for-kids) | <https://basic.smartedu.cn/tchMaterial> |||||
| [Talebook](#download-books-from-talebook) | <https://github.com/talebook/talebook> |||||
| [SoBooks](#download-books-from-sobooks) | <https://sobooks.net> |||||
| [SoBooks](#download-books-from-sobooks) | <https://sobooks.cc> |||||
| [Telegram](#download-books-from-telegram-groups) | <https://t.me> |||||
| [Hsu Life](#download-books-from-hsu-life) | <https://book.hsu.life> |||||

Expand Down
2 changes: 1 addition & 1 deletion cmd/flags/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var (

// SoBooks configurations.

SoBooksCode = "844283"
SoBooksCode = "244152"
)

func NewClientConfig() (*client.Config, error) {
Expand Down
6 changes: 3 additions & 3 deletions cmd/sobooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import (

const (
lowestSobooksBookID = 18000
sobooksWebsite = "https://sobooks.net"
sobooksWebsite = "https://sobooks.cc"
)

// sobooksCmd used for download books from sobooks.net
// sobooksCmd used for download books from sobooks.cc
var sobooksCmd = &cobra.Command{
Use: "sobooks",
Short: "A tool for downloading books from sobooks.net",
Short: "A tool for downloading books from sobooks.cc",
Run: func(cmd *cobra.Command, args []string) {
// Set the default start index.
if flags.InitialBookID < lowestSobooksBookID {
Expand Down
2 changes: 1 addition & 1 deletion internal/sobooks/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
driver.DIRECT: "备份",
}
dateRe = regexp.MustCompile(`(?m)(\d{4})-(\d{2})-(\d{2})`)
linkRe = regexp.MustCompile(`(?m)https://sobooks\.net/go\.html\?url=(.*?)"(.*?[::]\s?(\w+))?`)
linkRe = regexp.MustCompile(`(?m)https://sobooks\.cc/go\.html\?url=(.*?)"(.*?[::]\s?(\w+))?`)
)

type BookLink struct {
Expand Down
6 changes: 3 additions & 3 deletions internal/sobooks/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import (
)

func TestParseSobooksUrl(t *testing.T) {
client := resty.New().SetBaseURL("https://sobooks.net")
client := resty.New().SetBaseURL("https://sobooks.cc")

// unsupported 14320 11000
// 20081 16899 16240
id := int64(18021)
resp, err := client.R().
SetCookie(&http.Cookie{
Name: "mpcode",
Value: "844283",
Value: "244152",
Path: "/",
Domain: "sobooks.net",
Domain: "sobooks.cc",
}).
SetPathParam("bookId", strconv.FormatInt(id, 10)).
SetHeader("referer", client.BaseURL).
Expand Down

0 comments on commit 1b958fb

Please sign in to comment.