1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2026-01-17 13:02:50 +01:00

Allow arbitrary sites to include a cover url

This commit is contained in:
Alex Raubach 2018-09-02 11:07:59 -04:00
parent ea60ac5122
commit ff568eef10
2 changed files with 7 additions and 3 deletions

View file

@ -4,5 +4,6 @@
"author": "erraticerrata",
"chapter_selector": "#main .entry-content > ul:nth-of-type(1) > li > a",
"content_selector": "#main .entry-content",
"filter_selector": ".sharedaddy, .wpcnt, style"
"filter_selector": ".sharedaddy, .wpcnt, style",
"cover_url": "https://gitlab.com/Mikescher2/A-Practical-Guide-To-Evil-Lyx/raw/master/APGTE_1/APGTE_front.png"
}

View file

@ -18,7 +18,8 @@ Example JSON:
"author": "erraticerrata",
"chapter_selector": "#main .entry-content > ul > li > a",
"content_selector": "#main .entry-content",
"filter_selector": ".sharedaddy, .wpcnt, style"
"filter_selector": ".sharedaddy, .wpcnt, style",
"cover_url": "https://gitlab.com/Mikescher2/A-Practical-Guide-To-Evil-Lyx/raw/master/APGTE_1/APGTE_front.png"
}
"""
@ -33,6 +34,7 @@ class SiteDefinition:
chapter_selector = attr.ib(default=False)
# If this is present, it's used to filter out content that matches the selector
filter_selector = attr.ib(default=False)
cover_url = attr.ib(default='')
@register
@ -52,7 +54,8 @@ class Arbitrary(Site):
story = Section(
title=definition.title,
author=definition.author,
url=url
url=url,
cover_url=definition.cover_url
)
if definition.chapter_selector: