-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[blick] Add new extractor (blick.ch is a swiss newspaper platform, wh… #9598
Conversation
…ich provides also videos)
video_id = mobj.group('id') | ||
webpage = self._download_webpage(url, video_id) | ||
|
||
found_videos_og = re.findall(r'<meta.*?property="og:video".*?content="(.*?)"', webpage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked out _og_search_property
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_og_search_video_url
may be even better.
Sorry _og_search_video_url
can't be applied for re.findall
, while _og_regexes
is still useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using now _og_regexes
to do this.
found_videos = [] | ||
regex_og = self._og_regexes('video') | ||
regex_ogs = self._og_regexes('video:secure_url') | ||
video_og = self._html_search_regex(regex_og, webpage, name=None, default=None, fatal=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default=None
implies fatal=False
.
- Use _match_id to get the video_id - Extract the video title from the webpage instead of the url - Removed unnecessary "if entry_info_dict.get('formats'):" check
…e for multiple version of the video.
…ich provides also videos)