A feature-rich command-line audio/video downloader
[extractor/dplay] GlobalCyclingNetworkPlus: Add extractor (#7360)
bashonly774aa09dd6aa
diff --git a/yt_dlp/extractor/_extractors.py b/yt_dlp/extractor/_extractors.pyindex 15344a6e5a..a49a57a689 100644--- a/yt_dlp/extractor/_extractors.py+++ b/yt_dlp/extractor/_extractors.py@@ -497,6 +497,7 @@ from .dplay import (DiscoveryPlusItalyIE,DiscoveryPlusItalyShowIE,DiscoveryPlusIndiaShowIE,+ GlobalCyclingNetworkPlusIE,)from .dreisat import DreiSatIEfrom .drbonanza import DRBonanzaIEdiff --git a/yt_dlp/extractor/dplay.py b/yt_dlp/extractor/dplay.pyindex 8eb4d8ffa8..cf6d149342 100644--- a/yt_dlp/extractor/dplay.py+++ b/yt_dlp/extractor/dplay.py@@ -65,6 +65,7 @@ class DPlayBaseIE(InfoExtractor):return streaming_listdef _get_disco_api_info(self, url, display_id, disco_host, realm, country, domain=''):+ country = self.get_param('geo_bypass_country') or countrygeo_countries = [country.upper()]self._initialize_geo_bypass({'countries': geo_countries,@@ -1001,3 +1002,39 @@ class DiscoveryPlusIndiaShowIE(DiscoveryPlusShowBaseIE):_SHOW_STR = 'show'_INDEX = 4_VIDEO_IE = DiscoveryPlusIndiaIE+++class GlobalCyclingNetworkPlusIE(DiscoveryPlusBaseIE):+ _VALID_URL = r'https?://plus\.globalcyclingnetwork\.com/watch/(?P<id>\d+)'+ _TESTS = [{+ 'url': 'https://plus.globalcyclingnetwork.com/watch/1397691',+ 'info_dict': {+ 'id': '1397691',+ 'ext': 'mp4',+ 'title': 'The Athertons: Mountain Biking\'s Fastest Family',+ 'description': 'md5:75a81937fcd8b989eec6083a709cd837',+ 'thumbnail': 'https://us1-prod-images.disco-api.com/2021/03/04/eb9e3026-4849-3001-8281-9356466f0557.png',+ 'series': 'gcn',+ 'creator': 'Gcn',+ 'upload_date': '20210309',+ 'timestamp': 1615248000,+ 'duration': 2531.0,+ 'tags': [],+ },+ 'skip': 'Subscription required',+ 'params': {'skip_download': 'm3u8'},+ }]++ _PRODUCT = 'web'+ _DISCO_API_PARAMS = {+ 'disco_host': 'disco-api-prod.globalcyclingnetwork.com',+ 'realm': 'gcn',+ 'country': 'us',+ }++ def _update_disco_api_headers(self, headers, disco_base, display_id, realm):+ headers.update({+ 'x-disco-params': f'realm={realm}',+ 'x-disco-client': f'WEB:UNKNOWN:{self._PRODUCT}:27.3.2',+ 'Authorization': self._get_auth(disco_base, display_id, realm),+ })