Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New regex for extracting series title #21834

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion youtube_dl/extractor/tvn24.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ def _real_extract(self, url):

webpage = self._download_webpage(url, video_id)

title = self._og_search_title(webpage)
title = self._html_search_regex(
r'<span[^>]+class="standardHeader1[^"]*"[^>]*>\s*(.+?)\s*</span>',
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. It's not a title. You must extract title of the video not series.
  2. class=standardHeader1 pattern is too ambiguous and not future-proof since it occurs multiple times on the page though not in span currently.

webpage, 'title', default=None)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Title is mandatory. Read coding conventions.


Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove all meaningless changes.


def extract_json(attr, name, fatal=True):
return self._parse_json(
Expand Down