2024-09-22 18:22:41 -07:00
|
|
|
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2025-02-25 08:11:06 +08:00
|
|
|
package processor // import "miniflux.app/v2/internal/reader/processor"
|
2024-09-22 18:22:41 -07:00
|
|
|
|
|
|
|
import (
|
|
|
|
"miniflux.app/v2/internal/config"
|
|
|
|
"miniflux.app/v2/internal/model"
|
2025-06-18 22:29:11 +02:00
|
|
|
"miniflux.app/v2/internal/urllib"
|
2024-09-22 18:22:41 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
func shouldFetchNebulaWatchTime(entry *model.Entry) bool {
|
|
|
|
if !config.Opts.FetchNebulaWatchTime() {
|
|
|
|
return false
|
|
|
|
}
|
2024-12-12 03:30:59 +00:00
|
|
|
|
2025-06-18 22:29:11 +02:00
|
|
|
return urllib.DomainWithoutWWW(entry.URL) == "nebula.tv"
|
2024-09-22 18:22:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func fetchNebulaWatchTime(websiteURL string) (int, error) {
|
2025-06-18 22:29:11 +02:00
|
|
|
return fetchWatchTime(websiteURL, `meta[property="video:duration"]`, false)
|
2024-09-22 18:22:41 -07:00
|
|
|
}
|