Skip to content

feat: Add overview extraction for myvideo extractor#29

Merged
fzlins merged 1 commit intomasterfrom
feat/myvideo-overview-extractor
Jun 21, 2025
Merged

feat: Add overview extraction for myvideo extractor#29
fzlins merged 1 commit intomasterfrom
feat/myvideo-overview-extractor

Conversation

@fzlins
Copy link
Copy Markdown
Owner

@fzlins fzlins commented Jun 21, 2025

This change implements the extraction of episode overviews for the myvideo.net.tw extractor.

The extractor now correctly parses and stores the overview text found within 'span[class='episodeIntro movieIntro'] blockquote'.

Additionally, the extractor has been made more resilient by handling cases where season-level information (like title and overall description) might be missing on the page, allowing it to proceed with episode data extraction.

This change implements the extraction of episode overviews
for the myvideo.net.tw extractor.

The extractor now correctly parses and stores the overview text
found within 'span[class='episodeIntro movieIntro'] blockquote'.

Additionally, the extractor has been made more resilient by
handling cases where season-level information (like title and
overall description) might be missing on the page, allowing
it to proceed with episode data extraction.
@fzlins fzlins requested a review from Copilot June 21, 2025 11:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds extraction of episode overview and improves resilience when season-level data is missing.

  • Wraps season-level selectors in a try/except to continue on missing title or description
  • Extracts episode overview text from the span.episodeIntro blockquote element
  • Leaves episode_overview blank if the blockquote is absent
Comments suppressed due to low confidence (2)

tmdb-import/extractors/myvideo.py:47

  • New behavior for extracting episode_overview should be covered by tests, including cases where the blockquote is present and absent.
        episode_overview_element = episode.find_element(By.CSS_SELECTOR, value="span[class='episodeIntro movieIntro'] blockquote")

tmdb-import/extractors/myvideo.py:15

  • The try: block is mis-indented compared to its nested code, which will raise an IndentationError. Align the try and matching except with the other statements at the same indentation level.
    try:

Comment on lines +47 to +48
episode_overview_element = episode.find_element(By.CSS_SELECTOR, value="span[class='episodeIntro movieIntro'] blockquote")
episode_overview = episode_overview_element.text if episode_overview_element else ""
Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using find_element will raise a NoSuchElementException if no blockquote exists, so the subsequent if episode_overview_element check is never reached. Consider using find_elements and checking for a non-empty list or wrapping this call in its own try/except.

Suggested change
episode_overview_element = episode.find_element(By.CSS_SELECTOR, value="span[class='episodeIntro movieIntro'] blockquote")
episode_overview = episode_overview_element.text if episode_overview_element else ""
episode_overview_elements = episode.find_elements(By.CSS_SELECTOR, value="span[class='episodeIntro movieIntro'] blockquote")
episode_overview = episode_overview_elements[0].text if episode_overview_elements else ""

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +27
except Exception as e:
logging.warning(f"Could not extract season-level information: {e}")
Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catching the base Exception may hide unexpected errors. It’s better to catch specific exceptions (e.g., NoSuchElementException) to avoid masking real issues.

Suggested change
except Exception as e:
logging.warning(f"Could not extract season-level information: {e}")
except NoSuchElementException as e:
logging.warning(f"Element not found during season-level extraction: {e}")
except WebDriverException as e:
logging.warning(f"Web driver error during season-level extraction: {e}")
except Exception as e:
logging.critical(f"Unexpected error during season-level extraction: {e}")

Copilot uses AI. Check for mistakes.
@fzlins fzlins merged commit b23262b into master Jun 21, 2025
@fzlins fzlins deleted the feat/myvideo-overview-extractor branch June 21, 2025 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants