From 72da97cb9c2017d02b896d85c778c5b3c2d4c1da Mon Sep 17 00:00:00 2001 From: Parmjit Virk Date: Sun, 2 Jul 2017 22:49:51 -0500 Subject: [PATCH 1/5] [ESPN] Extend _VALID_URL to include additional URL formats --- youtube_dl/extractor/espn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/espn.py b/youtube_dl/extractor/espn.py index 8795e0ddf..6d00ea84e 100644 --- a/youtube_dl/extractor/espn.py +++ b/youtube_dl/extractor/espn.py @@ -10,7 +10,7 @@ from ..utils import ( class ESPNIE(InfoExtractor): - _VALID_URL = r'https?://(?:espn\.go|(?:www\.)?espn)\.com/video/clip(?:\?.*?\bid=|/_/id/)(?P\d+)' + _VALID_URL = r'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': { From 3f21e1ec5a8452c79573896a7bd63369dcd64924 Mon Sep 17 00:00:00 2001 From: Parmjit Virk Date: Sun, 2 Jul 2017 22:52:56 -0500 Subject: [PATCH 2/5] [ESPN] Updated test suite --- youtube_dl/extractor/espn.py | 69 ++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/espn.py b/youtube_dl/extractor/espn.py index 6d00ea84e..bc8834518 100644 --- a/youtube_dl/extractor/espn.py +++ b/youtube_dl/extractor/espn.py @@ -25,15 +25,70 @@ class ESPNIE(InfoExtractor): 'skip_download': True, }, }, { - # intl video, from http://www.espnfc.us/video/mls-highlights/150/video/2743663/must-see-moments-best-of-the-mls-season - 'url': 'http://espn.go.com/video/clip?id=2743663', + 'url': 'https://broadband.espn.go.com/video/clip?id=18910086', 'info_dict': { - 'id': '2743663', + 'id': '18910086', 'ext': 'mp4', - 'title': 'Must-See Moments: Best of the MLS season', - 'description': 'md5:4c2d7232beaea572632bec41004f0aeb', - 'timestamp': 1449446454, - 'upload_date': '20151207', + 'title': 'Kyrie spins around defender for two', + 'description': 'md5:2b0f5bae9616d26fba8808350f0d2b9b', + 'timestamp': 1489539155, + 'upload_date': '20170315', + }, + 'params': { + 'skip_download': True, + }, + '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'], + }, { + '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'], + }, { + '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'], + }, { + '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, From 0f427b1cadd58729147e8a4c4dcdeeb81fd45bff Mon Sep 17 00:00:00 2001 From: Parmjit Virk Date: Mon, 3 Jul 2017 19:28:32 -0500 Subject: [PATCH 3/5] [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, From 1dc4bc1dbc5c2eea8b3f284293a95d334c800b06 Mon Sep 17 00:00:00 2001 From: Parmjit Virk Date: Wed, 5 Jul 2017 15:57:52 -0500 Subject: [PATCH 4/5] [ESPN] Applied second requested fixes for PR #13549 --- youtube_dl/extractor/espn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/espn.py b/youtube_dl/extractor/espn.py index 5f4d1733f..f6b441ef6 100644 --- a/youtube_dl/extractor/espn.py +++ b/youtube_dl/extractor/espn.py @@ -18,7 +18,7 @@ class ESPNIE(InfoExtractor): )\.com/ (?: video/clip(?:\?.*?\bid=|/_/id/)| - watch/player\?.*?\bid= + watch/player(?:\?.*?\bid=|/_/id/) ) (?P\d+) ''' @@ -62,6 +62,9 @@ class ESPNIE(InfoExtractor): }, { 'url': 'http://www.espn.com/watch/player?bucketId=257&id=19505875', 'only_matching': True, + }, { + 'url': 'http://www.espn.com/watch/player/_/id/19141491', + 'only_matching': True, }, { 'url': 'http://www.espn.com/video/clip?id=10365079', 'only_matching': True, From da12ebcc04337c3eb3c9d84dc5bfd68b4eb78158 Mon Sep 17 00:00:00 2001 From: Parmjit Virk Date: Wed, 5 Jul 2017 17:05:00 -0500 Subject: [PATCH 5/5] [ESPN] Applied third requested fixes for PR #13549 --- youtube_dl/extractor/espn.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/espn.py b/youtube_dl/extractor/espn.py index f6b441ef6..7a7436068 100644 --- a/youtube_dl/extractor/espn.py +++ b/youtube_dl/extractor/espn.py @@ -17,8 +17,14 @@ class ESPNIE(InfoExtractor): (?:www\.)?espn )\.com/ (?: - video/clip(?:\?.*?\bid=|/_/id/)| - watch/player(?:\?.*?\bid=|/_/id/) + (?: + video/clip| + watch/player + ) + (?: + \?.*?\bid=| + /_/id/ + ) ) (?P\d+) '''