odysee.go 633 B

12345678910111213141516171819202122
  1. // SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
  2. // SPDX-License-Identifier: Apache-2.0
  3. package processor // import "miniflux.app/v2/internal/reader/processor"
  4. import (
  5. "miniflux.app/v2/internal/config"
  6. "miniflux.app/v2/internal/model"
  7. "miniflux.app/v2/internal/urllib"
  8. )
  9. func shouldFetchOdyseeWatchTime(entry *model.Entry) bool {
  10. if !config.Opts.FetchOdyseeWatchTime() {
  11. return false
  12. }
  13. return urllib.DomainWithoutWWW(entry.URL) == "odysee.com"
  14. }
  15. func fetchOdyseeWatchTime(websiteURL string) (int, error) {
  16. return fetchWatchTime(websiteURL, `meta[property="og:video:duration"]`, false)
  17. }