MCPcopy
hub / github.com/codelucas/newspaper / _get_category_urls

Method _get_category_urls

newspaper/source.py:121–126  ·  view source on GitHub ↗

The domain param is **necessary**, see .utils.cache_disk for reasons. the boilerplate method is so we can use this decorator right. We are caching categories for 1 day.

(self, domain)

Source from the content-addressed store, hash-verified

119
120 @utils.cache_disk(seconds=(86400*1), cache_folder=ANCHOR_DIRECTORY)
121 def _get_category_urls(self, domain):
122 """The domain param is **necessary**, see .utils.cache_disk for reasons.
123 the boilerplate method is so we can use this decorator right.
124 We are caching categories for 1 day.
125 """
126 return self.extractor.get_category_urls(self.url, self.doc)
127
128 def set_categories(self):
129 urls = self._get_category_urls(self.domain)

Callers 1

set_categoriesMethod · 0.95

Calls 1

get_category_urlsMethod · 0.80

Tested by

no test coverage detected