]> jfr.im git - yt-dlp.git/commitdiff
[extractor/dplay] Add MotorTrend extractor (#4446)
authorSipherdrakon <redacted>
Tue, 26 Jul 2022 03:39:40 +0000 (23:39 -0400)
committerGitHub <redacted>
Tue, 26 Jul 2022 03:39:40 +0000 (09:09 +0530)
Authored by: Sipherdrakon

yt_dlp/extractor/_extractors.py
yt_dlp/extractor/dplay.py

index 1f6e5f81ee1ef5fab645a0a39fb33ef307af951d..5bd6a71bdf520e793baa85ece8ca1d404ed1dd72 100644 (file)
     DiscoveryLifeIE,
     AnimalPlanetIE,
     TLCIE,
+    MotorTrendIE,
     DiscoveryPlusIndiaIE,
     DiscoveryNetworksDeIE,
     DiscoveryPlusItalyIE,
index 5c4f3c8923124dcd6d7d596e3cf3eb8b5a547f19..e16856b2b93358f4b5527a58c0aacb6bea3617c4 100644 (file)
@@ -718,6 +718,33 @@ class TLCIE(DiscoveryPlusBaseIE):
     }
 
 
+class MotorTrendIE(DiscoveryPlusBaseIE):
+    _VALID_URL = r'https?://(?:watch\.)?motortrend\.com/video' + DPlayBaseIE._PATH_REGEX
+    _TESTS = [{
+        'url': 'https://watch.motortrend.com/video/car-issues-motortrend-atve-us/double-dakotas',
+        'info_dict': {
+            'id': '"4859182"',
+            'display_id': 'double-dakotas',
+            'ext': 'mp4',
+            'title': 'Double Dakotas',
+            'description': 'Tylers buy-one-get-one Dakota deal has the Wizard pulling double duty.',
+            'season_number': 2,
+            'episode_number': 3,
+        },
+        'skip': 'Available for Premium users',
+    }, {
+        'url': 'https://watch.motortrend.com/video/car-issues-motortrend-atve-us/double-dakotas',
+        'only_matching': True,
+    }]
+
+    _PRODUCT = 'vel'
+    _DISCO_API_PARAMS = {
+        'disco_host': 'us1-prod-direct.watch.motortrend.com',
+        'realm': 'go',
+        'country': 'us',
+    }
+
+
 class DiscoveryPlusIE(DiscoveryPlusBaseIE):
     _VALID_URL = r'https?://(?:www\.)?discoveryplus\.com/(?!it/)(?:\w{2}/)?video' + DPlayBaseIE._PATH_REGEX
     _TESTS = [{