Include old URL in script input (#3940)

* Include old URL in script input
* Include URL in update input
This commit is contained in:
WithoutPants
2023-07-26 12:59:16 +10:00
committed by GitHub
parent df70b182a4
commit 4b07c5b60b
3 changed files with 21 additions and 2 deletions

View File

@@ -262,6 +262,9 @@ func (c Cache) ScrapeName(ctx context.Context, id, query string, ty ScrapeConten
// ScrapeFragment uses the given fragment input to scrape
func (c Cache) ScrapeFragment(ctx context.Context, id string, input Input) (ScrapedContent, error) {
// set the deprecated URL field if it's not set
input.populateURL()
s := c.findScraper(id)
if s == nil {
return nil, fmt.Errorf("%w: id %s", ErrNotFound, id)