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

Paramount Plus Site Request #28342

Closed
5 tasks done
dedwards3311 opened this issue Mar 4, 2021 · 3 comments
Closed
5 tasks done

Paramount Plus Site Request #28342

dedwards3311 opened this issue Mar 4, 2021 · 3 comments
Labels
site-support-request Add extractor(s) for a new domain

Comments

@dedwards3311
Copy link

dedwards3311 commented Mar 4, 2021

Checklist

  • I'm reporting a new site support request
  • I've verified that I'm running youtube-dl version 2021.03.03
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that none of provided URLs violate any copyrights
  • I've searched the bugtracker for similar site support requests including closed ones

Example URLs

https://www.paramountplus.com/shows/the-real-world/video/OUPywmOhn5Z_0rQVkLjM_aZ_dY14j2Gg/the-real-world-episode-1/

https://www.paramountplus.com/shows/kamp-koral/video/7KFREx9Z9CMQm2fZU7wGms2_kG0egKtF/kamp-koral-spongebob-s-under-years-the-jellyfish-kid/

https://www.cbs.com/shows/the-real-world/video/0_gpHFsSED4l0GAZMrTj_12fAjmrt4hA/the-real-world-hawaii-/ (This is the URL that worked with CBS ALL Access but has now changed to paramount plus.)

Description

CBS All Access changed to paramount plus. Extractor was working fine on CBS All Access but paramount plus is not working. Getting unsupported URL. The new site Paramount Plus looks exactly the same as cbs all access just with a different name. Possibly needs just a new extractor. If you need my credentials to test the website please let me know.

@dedwards3311 dedwards3311 added the site-support-request Add extractor(s) for a new domain label Mar 4, 2021
@Mr-Jake
Copy link

Mr-Jake commented Mar 4, 2021

It looks like only the domain name changed. The url structures are still the same.

Free videos (login not required):
(Notice the url after the domain is exactly the same)

https://www.paramountplus.com/shows/the_price_is_right/video/OHQMzPEUA8BkfiN0rI5_31EWN4rLxWsW/the-price-is-right-3-3-2021/

https://www.cbs.com/shows/the_price_is_right/video/OHQMzPEUA8BkfiN0rI5_31EWN4rLxWsW/the-price-is-right-3-3-2021/

The CBS site is still active, but now contains only CBS shows, so the CBS extractor should not be removed. Hopefully this will be an easy fix where only the paramount plus domain needs to be added to the CBS extractor.

@CHJ85
Copy link

CHJ85 commented Mar 4, 2021

They're using the same API as CBS All Access, because it's essentially just a rebrand but with more content. All you have to do is replace cbs.com with paramountplus.com in the extractor file "cbs.py".
Like this:

from __future__ import unicode_literals

from .theplatform import ThePlatformFeedIE
from ..utils import (
    ExtractorError,
    int_or_none,
    find_xpath_attr,
    xpath_element,
    xpath_text,
    update_url_query,
)


class CBSBaseIE(ThePlatformFeedIE):
    def _parse_smil_subtitles(self, smil, namespace=None, subtitles_lang='en'):
        subtitles = {}
        for k, ext in [('sMPTE-TTCCURL', 'tt'), ('ClosedCaptionURL', 'ttml'), ('webVTTCaptionURL', 'vtt')]:
            cc_e = find_xpath_attr(smil, self._xpath_ns('.//param', namespace), 'name', k)
            if cc_e is not None:
                cc_url = cc_e.get('value')
                if cc_url:
                    subtitles.setdefault(subtitles_lang, []).append({
                        'ext': ext,
                        'url': cc_url,
                    })
        return subtitles


class CBSIE(CBSBaseIE):
    _VALID_URL = r'(?:cbs:|https?://(?:www\.)?(?:paramountplus\.com/shows/[^/]+/video|colbertlateshow\.com/(?:video|podcasts))/)(?P<id>[\w-]+)'

    _TESTS = [{
        'url': 'http://www.paramountplus.com/shows/garth-brooks/video/_u7W953k6la293J7EPTd9oHkSPs6Xn6_/connect-chat-feat-garth-brooks/',
        'info_dict': {
            'id': '_u7W953k6la293J7EPTd9oHkSPs6Xn6_',
            'ext': 'mp4',
            'title': 'Connect Chat feat. Garth Brooks',
            'description': 'Connect with country music singer Garth Brooks, as he chats with fans on Wednesday November 27, 2013. Be sure to tune in to Garth Brooks: Live from Las Vegas, Friday November 29, at 9/8c on CBS!',
            'duration': 1495,
            'timestamp': 1385585425,
            'upload_date': '20131127',
            'uploader': 'CBSI-NEW',
        },
        'params': {
            # m3u8 download
            'skip_download': True,
        },
        '_skip': 'Blocked outside the US',
    }, {
        'url': 'http://colbertlateshow.com/video/8GmB0oY0McANFvp2aEffk9jZZZ2YyXxy/the-colbeard/',
        'only_matching': True,
    }, {
        'url': 'http://www.colbertlateshow.com/podcasts/dYSwjqPs_X1tvbV_P2FcPWRa_qT6akTC/in-the-bad-room-with-stephen/',
        'only_matching': True,
    }]

    def _extract_video_info(self, content_id, site='cbs', mpx_acc=2198311517):
        items_data = self._download_xml(
            'http://can.cbs.com/thunder/player/videoPlayerService.php',
            content_id, query={'partner': site, 'contentId': content_id})
        video_data = xpath_element(items_data, './/item')
        title = xpath_text(video_data, 'videoTitle', 'title', True)
        tp_path = 'dJ5BDC/media/guid/%d/%s' % (mpx_acc, content_id)
        tp_release_url = 'http://link.theplatform.com/s/' + tp_path

        asset_types = []
        subtitles = {}
        formats = []
        last_e = None
        for item in items_data.findall('.//item'):
            asset_type = xpath_text(item, 'assetType')
            if not asset_type or asset_type in asset_types or 'HLS_FPS' in asset_type or 'DASH_CENC' in asset_type:
                continue
            asset_types.append(asset_type)
            query = {
                'mbr': 'true',
                'assetTypes': asset_type,
            }
            if asset_type.startswith('HLS') or asset_type in ('OnceURL', 'StreamPack'):
                query['formats'] = 'MPEG4,M3U'
            elif asset_type in ('RTMP', 'WIFI', '3G'):
                query['formats'] = 'MPEG4,FLV'
            try:
                tp_formats, tp_subtitles = self._extract_theplatform_smil(
                    update_url_query(tp_release_url, query), content_id,
                    'Downloading %s SMIL data' % asset_type)
            except ExtractorError as e:
                last_e = e
                continue
            formats.extend(tp_formats)
            subtitles = self._merge_subtitles(subtitles, tp_subtitles)
        if last_e and not formats:
            raise last_e
        self._sort_formats(formats)

        info = self._extract_theplatform_metadata(tp_path, content_id)
        info.update({
            'id': content_id,
            'title': title,
            'series': xpath_text(video_data, 'seriesTitle'),
            'season_number': int_or_none(xpath_text(video_data, 'seasonNumber')),
            'episode_number': int_or_none(xpath_text(video_data, 'episodeNumber')),
            'duration': int_or_none(xpath_text(video_data, 'videoLength'), 1000),
            'thumbnail': xpath_text(video_data, 'previewImageURL'),
            'formats': formats,
            'subtitles': subtitles,
        })
        return info

    def _real_extract(self, url):
        content_id = self._match_id(url)
        return self._extract_video_info(content_id)

pukkandan pushed a commit to yt-dlp/yt-dlp that referenced this issue Mar 4, 2021
@dare2
Copy link

dare2 commented Mar 5, 2021

Also, if you replace paramountplus.com to cbs.com in the URL before feeding it to youtube-dl, that will work too, at least for content that was present before the branding switchover.

leshasmlesha pushed a commit to leshasmlesha/youtube-dl that referenced this issue Mar 7, 2021
leshasmlesha pushed a commit to leshasmlesha/youtube-dl that referenced this issue Mar 7, 2021
github-actions bot added a commit to hellopony/youtube-dl that referenced this issue Mar 7, 2021
This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-support-request Add extractor(s) for a new domain
Projects
None yet
Development

No branches or pull requests

4 participants