-
Notifications
You must be signed in to change notification settings - Fork 10k
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
[CBSNews] Fixed regex for news videos (fixes issue #13284) #13503
Conversation
youtube_dl/extractor/cbsnews.py
Outdated
@@ -60,7 +75,7 @@ def _real_extract(self, url): | |||
webpage = self._download_webpage(url, video_id) | |||
|
|||
video_info = self._parse_json(self._html_search_regex( | |||
r'(?:<ul class="media-list items" id="media-related-items"><li data-video-info|<div id="cbsNewsVideoPlayer" data-video-player-options)=\'({.+?})\'', | |||
r'(?:<ul class="media-list items" id="media-related-items"[^>]+><li data-video-info|<div id="cbsNewsVideoPlayer" data-video-player-options)=\'({.+?})\'', |
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.
Breaks all videos embedded with exact <ul class="media-list items" id="media-related-items"><li data-video-info
.
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.
Good catch. Please see the updated regex - it should now include the exact match as well. Thanks!
youtube_dl/extractor/cbsnews.py
Outdated
@@ -60,7 +75,7 @@ def _real_extract(self, url): | |||
webpage = self._download_webpage(url, video_id) | |||
|
|||
video_info = self._parse_json(self._html_search_regex( | |||
r'(?:<ul class="media-list items" id="media-related-items"><li data-video-info|<div id="cbsNewsVideoPlayer" data-video-player-options)=\'({.+?})\'', | |||
r'(?:<ul class="media-list items" id="media-related-items"(?:[^>]+)?><li data-video-info|<div id="cbsNewsVideoPlayer" data-video-player-options)=\'({.+?})\'', |
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.
[^>]*
.
Please follow the guide below
x
into all the boxes [ ] relevant to your pull request (like that [x])Before submitting a pull request make sure you have:
In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?
Description of your pull request and other information
Updated the regex for the [CBSNews] extractor to grab the appropriate JSON data for news videos - issue #13284. Apparently the source html has changed for the news pages.
Cheers,
Parmjit V.