Module hdrezka.post.info.schedule
Post episode release schedule parsing.
Functions
def parse_schedule(html: str | bs4.BeautifulSoup | bs4.element.Tag) ‑> tuple[ScheduleBlock, ...]-
Expand source code
def parse_schedule(html: str | BeautifulSoup | Tag) -> tuple[ScheduleBlock, ...]: """ Parse ``.b-post__schedule_block`` tables from a title page. Returns an empty tuple when the schedule markup is missing. """ soup = as_soup(html) root = soup.select_one('.b-post__schedule') or soup blocks = [] for block in root.select('.b-post__schedule_block'): title = text(block.select_one('.b-post__schedule_block_title .title')) items = [] for tr in block.select('table.b-post__schedule_table tr'): item = _parse_row(tr) if item is not None: items.append(item) blocks.append(ScheduleBlock(title=title, items=tuple(items))) return tuple(blocks)Parse
.b-post__schedule_blocktables from a title page.Returns an empty tuple when the schedule markup is missing.
Classes
class ScheduleBlock (title: str,
items: tuple[ScheduleItem, ...] = ())-
Expand source code
class ScheduleBlock(NamedTuple): """Season schedule block under one heading.""" title: str items: tuple[ScheduleItem, ...] = ()Season schedule block under one heading.
Ancestors
- builtins.tuple
Instance variables
var items : tuple[ScheduleItem, ...]-
Expand source code
class ScheduleBlock(NamedTuple): """Season schedule block under one heading.""" title: str items: tuple[ScheduleItem, ...] = ()Alias for field number 1
var title : str-
Expand source code
class ScheduleBlock(NamedTuple): """Season schedule block under one heading.""" title: str items: tuple[ScheduleItem, ...] = ()Alias for field number 0
class ScheduleItem (id: int,
season: int = 0,
episode: int = 0,
title: str = '',
original_title: str = '',
date: str = '',
exists: bool = False)-
Expand source code
class ScheduleItem(NamedTuple): """One episode row from a post schedule table.""" id: int season: int = 0 episode: int = 0 title: str = '' original_title: str = '' date: str = '' exists: bool = FalseOne episode row from a post schedule table.
Ancestors
- builtins.tuple
Instance variables
var date : str-
Expand source code
class ScheduleItem(NamedTuple): """One episode row from a post schedule table.""" id: int season: int = 0 episode: int = 0 title: str = '' original_title: str = '' date: str = '' exists: bool = FalseAlias for field number 5
var episode : int-
Expand source code
class ScheduleItem(NamedTuple): """One episode row from a post schedule table.""" id: int season: int = 0 episode: int = 0 title: str = '' original_title: str = '' date: str = '' exists: bool = FalseAlias for field number 2
var exists : bool-
Expand source code
class ScheduleItem(NamedTuple): """One episode row from a post schedule table.""" id: int season: int = 0 episode: int = 0 title: str = '' original_title: str = '' date: str = '' exists: bool = FalseAlias for field number 6
var id : int-
Expand source code
class ScheduleItem(NamedTuple): """One episode row from a post schedule table.""" id: int season: int = 0 episode: int = 0 title: str = '' original_title: str = '' date: str = '' exists: bool = FalseAlias for field number 0
var original_title : str-
Expand source code
class ScheduleItem(NamedTuple): """One episode row from a post schedule table.""" id: int season: int = 0 episode: int = 0 title: str = '' original_title: str = '' date: str = '' exists: bool = FalseAlias for field number 4
var season : int-
Expand source code
class ScheduleItem(NamedTuple): """One episode row from a post schedule table.""" id: int season: int = 0 episode: int = 0 title: str = '' original_title: str = '' date: str = '' exists: bool = FalseAlias for field number 1
var title : str-
Expand source code
class ScheduleItem(NamedTuple): """One episode row from a post schedule table.""" id: int season: int = 0 episode: int = 0 title: str = '' original_title: str = '' date: str = '' exists: bool = FalseAlias for field number 3