Simplify link extractor

This commit is contained in:
FliegendeWurst 2022-01-07 12:19:39 +01:00
parent 38ee7ed31e
commit b44c31d8d4

View File

@ -29,8 +29,7 @@ static IL_CONTENT_CONTAINER: Lazy<Selector> = Lazy::new(|| Selector::parse("#il_
static BLOCK_FAVORITES: Lazy<Selector> = Lazy::new(|| Selector::parse("#block_pditems_0").unwrap());
static ITEM_PROP: Lazy<Selector> = Lazy::new(|| Selector::parse("span.il_ItemProperty").unwrap());
static CONTAINER_ITEMS: Lazy<Selector> = Lazy::new(|| Selector::parse("div.il_ContainerListItem, .il-std-item").unwrap());
static CONTAINER_ITEM_TITLE: Lazy<Selector> = Lazy::new(|| Selector::parse("a.il_ContainerItemTitle").unwrap());
static CONTAINER_ITEM_TITLE_ALTERNATIVE: Lazy<Selector> = Lazy::new(|| Selector::parse(".il-item-title > a").unwrap());
static CONTAINER_ITEM_TITLE: Lazy<Selector> = Lazy::new(|| Selector::parse("a.il_ContainerItemTitle, .il-item-title > a").unwrap());
pub struct ILIAS {
pub opt: Opt,
@ -261,7 +260,6 @@ impl ILIAS {
.flat_map(|item| {
item.select(&CONTAINER_ITEM_TITLE)
.next()
.or_else(|| item.select(&CONTAINER_ITEM_TITLE_ALTERNATIVE).next())
.map(|link| Object::from_link(item, link))
// items without links are ignored
})