Skip to content

Commit

Permalink
[sky] Add SkyNewsStoryIE (#1443)
Browse files Browse the repository at this point in the history
Authored by: ajj8
  • Loading branch information
ajj8 committed Oct 27, 2021
1 parent bd1c792 commit b7b186e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions yt_dlp/extractor/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,7 @@
from .skynewsau import SkyNewsAUIE
from .sky import (
SkyNewsIE,
SkyNewsStoryIE,
SkySportsIE,
SkySportsNewsIE,
)
Expand Down
28 changes: 28 additions & 0 deletions yt_dlp/extractor/sky.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,34 @@ class SkyNewsIE(SkyBaseIE):
}


class SkyNewsStoryIE(SkyBaseIE):
IE_NAME = 'sky:news:story'
_VALID_URL = r'https?://news\.sky\.com/story/[0-9a-z-]+-(?P<id>[0-9]+)'
_TEST = {
'url': 'https://news.sky.com/story/budget-2021-chancellor-rishi-sunak-vows-address-will-deliver-strong-economy-fit-for-a-new-age-of-optimism-12445425',
'info_dict': {
'id': 'ref:0714acb9-123d-42c8-91b8-5c1bc6c73f20',
'title': 'md5:e408dd7aad63f31a1817bbe40c7d276f',
'description': 'md5:a881e12f49212f92be2befe4a09d288a',
'ext': 'mp4',
'upload_date': '20211027',
'timestamp': 1635317494,
'uploader_id': '6058004172001',
}
}

def _real_extract(self, url):
article_id = self._match_id(url)
webpage = self._download_webpage(url, article_id)

entries = [self._process_ooyala_element(webpage, sdc_el, url)
for sdc_el in re.findall(self._SDC_EL_REGEX, webpage)]

return self.playlist_result(
entries, article_id, self._og_search_title(webpage),
self._html_search_meta(['og:description', 'description'], webpage))


class SkySportsNewsIE(SkyBaseIE):
IE_NAME = 'sky:sports:news'
_VALID_URL = r'https?://(?:www\.)?skysports\.com/([^/]+/)*news/\d+/(?P<id>\d+)'
Expand Down

0 comments on commit b7b186e

Please sign in to comment.