From 0f427b1cadd58729147e8a4c4dcdeeb81fd45bff Mon Sep 17 00:00:00 2001 From: Parmjit Virk Date: Mon, 3 Jul 2017 19:28:32 -0500 Subject: [PATCH] [ESPN] Applied requested fixes for PR #13549 --- youtube_dl/extractor/espn.py | 66 ++++++++++-------------------------- 1 file changed, 17 insertions(+), 49 deletions(-) diff --git a/youtube_dl/extractor/espn.py b/youtube_dl/extractor/espn.py index bc8834518..5f4d1733f 100644 --- a/youtube_dl/extractor/espn.py +++ b/youtube_dl/extractor/espn.py @@ -10,7 +10,19 @@ from ..utils import ( class ESPNIE(InfoExtractor): - _VALID_URL = r'https?://(?:(?:(\w+\.)+)?espn\.go|(?:www\.)?espn)\.com/(?:video/clip(?:\?.*?\bid=|/_/id/)|watch/player\?.*?\bid=)(?P\d+)' + _VALID_URL = r'''(?x) + https?:// + (?: + (?:(?:\w+\.)+)?espn\.go| + (?:www\.)?espn + )\.com/ + (?: + video/clip(?:\?.*?\bid=|/_/id/)| + watch/player\?.*?\bid= + ) + (?P\d+) + ''' + _TESTS = [{ 'url': 'http://espn.go.com/video/clip?id=10365079', 'info_dict': { @@ -40,60 +52,16 @@ class ESPNIE(InfoExtractor): 'expected_warnings': ['Unable to download f4m manifest'], }, { 'url': 'http://nonredline.sports.espn.go.com/video/clip?id=19744672', - 'info_dict': { - 'id': '19744672', - 'ext': 'mp4', - 'title': 'Aggies use 2016 season as motivation', - 'description': 'md5:2fe30038633f86408a184ec676c5fdac', - 'timestamp': 1498519201, - 'upload_date': '20170626', - }, - 'params': { - 'skip_download': True, - }, - 'expected_warnings': ['Unable to download f4m manifest'], + 'only_matching': True, }, { 'url': 'https://cdn.espn.go.com/video/clip/_/id/19771774', - 'info_dict': { - 'id': '19771774', - 'ext': 'mp4', - 'title': 'Coach Cal to the Knicks? Not so fast', - 'description': 'md5:a60393eaee9c203dd4184c48c308651b', - 'timestamp': 1498806684, - 'upload_date': '20170630', - }, - 'params': { - 'skip_download': True, - }, - 'expected_warnings': ['Unable to download f4m manifest'], + 'only_matching': True, }, { 'url': 'http://www.espn.com/watch/player?id=19141491', - 'info_dict': { - 'id': '19141491', - 'ext': 'mp4', - 'title': 'Stephen A.: Lynch was wrong for slapping phone out of fan\'s hand', - 'description': 'md5:9b31cf7b31e85c6dfcdefd11571e6c8e', - 'timestamp': 1492011670, - 'upload_date': '20170412', - }, - 'params': { - 'skip_download': True, - }, - 'expected_warnings': ['Unable to download f4m manifest'], + 'only_matching': True, }, { 'url': 'http://www.espn.com/watch/player?bucketId=257&id=19505875', - 'info_dict': { - 'id': '19505875', - 'ext': 'mp4', - 'title': 'Six-year-old Fuller nails first word at Spelling Bee', - 'description': 'md5:f90babb45b196d7c8ca1d295bb68e36a', - 'timestamp': 1496252167, - 'upload_date': '20170531', - }, - 'params': { - 'skip_download': True, - }, - 'expected_warnings': ['Unable to download f4m manifest'], + 'only_matching': True, }, { 'url': 'http://www.espn.com/video/clip?id=10365079', 'only_matching': True,