Skip to content

Commit

Permalink
t.bilibili
Browse files Browse the repository at this point in the history
  • Loading branch information
kaki-admin committed Dec 13, 2024
1 parent 0c11cf2 commit 61d4c07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
8 changes: 8 additions & 0 deletions backend-server/crawler/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ import (
func EntryCrawler(entry *model.Entry, feedUrl, userAgent, cookie string, certificates, fetchViaProxy bool) {
//entryID, entryUrl, entryTitle, imageUrl, author string, entryPublishedAt int64, feed *model.Feed) (string, string, int64) {
common.Logger.Info("crawler entry start", zap.String("url", entry.URL))
if common.Domain(entry.URL) == "t.bilibili.com" {
entry.FullContent = entry.Content
entry.Language = "zh-cn"
if entry.ImageUrl == "" && entry.Content != "" {
entry.ImageUrl = common.GetImageUrlFromContent(entry.Content)
}
return
}
entry.RawContent = FetchRawContnt(
entry.URL,
entry.Title,
Expand Down
11 changes: 5 additions & 6 deletions backend-server/model/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ type Entry struct {
URL string `json:"url"`
CommentsURL string `json:"comments_url"`
PublishedAtParsed time.Time
PublishedAt int64 `json:"published_at"`

CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Content string `json:"content"`
RawContent string `json:"raw_content"`
PublishedAt int64 `json:"published_at"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Content string `json:"content"`
RawContent string `json:"raw_content"`
//PureContent string `bson:"pure_content"`
FullContent string `json:"full_content"`
//DocId string `json:"doc_id"`
Expand Down

0 comments on commit 61d4c07

Please sign in to comment.