From 1345ed928c360578a26d88193e61af65a3bd40c5 Mon Sep 17 00:00:00 2001 From: Jordan Weatherby Date: Sun, 10 May 2020 13:11:01 +0100 Subject: [PATCH 1/6] Fixed giantbomb extraction for videos within shows --- youtube_dl/extractor/giantbomb.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/giantbomb.py b/youtube_dl/extractor/giantbomb.py index 6a1b1e96e..3d2f927ef 100644 --- a/youtube_dl/extractor/giantbomb.py +++ b/youtube_dl/extractor/giantbomb.py @@ -13,8 +13,8 @@ from ..utils import ( class GiantBombIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?giantbomb\.com/videos/(?P[^/]+)/(?P\d+-\d+)' - _TEST = { + _VALID_URL = r'https?://(?:www\.)?giantbomb\.com/(videos|shows)/(?P[^/]+)/(?P\d+-\d+)' + _TESTS = [{ 'url': 'http://www.giantbomb.com/videos/quick-look-destiny-the-dark-below/2300-9782/', 'md5': 'c8ea694254a59246a42831155dec57ac', 'info_dict': { @@ -26,7 +26,19 @@ class GiantBombIE(InfoExtractor): 'duration': 2399, 'thumbnail': r're:^https?://.*\.jpg$', } - } + }, { + 'url': 'https://www.giantbomb.com/shows/ben-stranding/2970-20212', + 'md5': '92d94e1d072d559df7e95129315a9870', + 'info_dict': { + 'id': '2970-20212', + 'display_id': 'ben-stranding', + 'ext': 'mp4', + 'title': 'Lockdown 2020: Ben Stranding', + 'description': 'md5:dfe795e0718a65baee2183c107b87478', + 'duration': 5100, + 'thumbnail': r're:^https?://.*\.png$', + } + }] def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) From f298b4dc4ba3d32d1b4c97b46ff090f012fd7cac Mon Sep 17 00:00:00 2001 From: Jordan Weatherby Date: Sun, 10 May 2020 13:11:48 +0100 Subject: [PATCH 2/6] Fixed failing test due to md5 changes --- youtube_dl/extractor/giantbomb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/giantbomb.py b/youtube_dl/extractor/giantbomb.py index 3d2f927ef..0d92fd613 100644 --- a/youtube_dl/extractor/giantbomb.py +++ b/youtube_dl/extractor/giantbomb.py @@ -16,7 +16,7 @@ class GiantBombIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?giantbomb\.com/(videos|shows)/(?P[^/]+)/(?P\d+-\d+)' _TESTS = [{ 'url': 'http://www.giantbomb.com/videos/quick-look-destiny-the-dark-below/2300-9782/', - 'md5': 'c8ea694254a59246a42831155dec57ac', + 'md5': '132f5a803e7e0ab0e274d84bda1e77ae', 'info_dict': { 'id': '2300-9782', 'display_id': 'quick-look-destiny-the-dark-below', From 7f118b6dfe79841e7d45b4bdb14904e3e43397ee Mon Sep 17 00:00:00 2001 From: JordanWeatherby <47519158+JordanWeatherby@users.noreply.github.com> Date: Wed, 20 May 2020 21:17:20 +0100 Subject: [PATCH 3/6] Updated regex to be non capturing --- youtube_dl/extractor/giantbomb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/giantbomb.py b/youtube_dl/extractor/giantbomb.py index 0d92fd613..9b521f56a 100644 --- a/youtube_dl/extractor/giantbomb.py +++ b/youtube_dl/extractor/giantbomb.py @@ -13,7 +13,7 @@ from ..utils import ( class GiantBombIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?giantbomb\.com/(videos|shows)/(?P[^/]+)/(?P\d+-\d+)' + _VALID_URL = r'https?://(?:www\.)?giantbomb\.com/(?:videos|shows)/(?P[^/]+)/(?P\d+-\d+)' _TESTS = [{ 'url': 'http://www.giantbomb.com/videos/quick-look-destiny-the-dark-below/2300-9782/', 'md5': '132f5a803e7e0ab0e274d84bda1e77ae', From c792bc3f601f58b2e9daf942b49e474332e2d306 Mon Sep 17 00:00:00 2001 From: JordanWeatherby <47519158+JordanWeatherby@users.noreply.github.com> Date: Wed, 20 May 2020 21:59:24 +0100 Subject: [PATCH 4/6] Replacing test with only_matching as requested --- youtube_dl/extractor/giantbomb.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/youtube_dl/extractor/giantbomb.py b/youtube_dl/extractor/giantbomb.py index 9b521f56a..80561d315 100644 --- a/youtube_dl/extractor/giantbomb.py +++ b/youtube_dl/extractor/giantbomb.py @@ -28,15 +28,7 @@ class GiantBombIE(InfoExtractor): } }, { 'url': 'https://www.giantbomb.com/shows/ben-stranding/2970-20212', - 'md5': '92d94e1d072d559df7e95129315a9870', - 'info_dict': { - 'id': '2970-20212', - 'display_id': 'ben-stranding', - 'ext': 'mp4', - 'title': 'Lockdown 2020: Ben Stranding', - 'description': 'md5:dfe795e0718a65baee2183c107b87478', - 'duration': 5100, - 'thumbnail': r're:^https?://.*\.png$', + 'only_matching': True, } }] From f53f694fa5a13568343a536ea189be82f7e37a00 Mon Sep 17 00:00:00 2001 From: JordanWeatherby <47519158+JordanWeatherby@users.noreply.github.com> Date: Wed, 20 May 2020 22:18:44 +0100 Subject: [PATCH 5/6] Fixed broken brackets --- youtube_dl/extractor/giantbomb.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/youtube_dl/extractor/giantbomb.py b/youtube_dl/extractor/giantbomb.py index 80561d315..3d175b9eb 100644 --- a/youtube_dl/extractor/giantbomb.py +++ b/youtube_dl/extractor/giantbomb.py @@ -1,5 +1,4 @@ from __future__ import unicode_literals - import re import json @@ -29,7 +28,6 @@ class GiantBombIE(InfoExtractor): }, { 'url': 'https://www.giantbomb.com/shows/ben-stranding/2970-20212', 'only_matching': True, - } }] def _real_extract(self, url): From f2fc29c4da641f5a0240168c545e8ddfecf6d830 Mon Sep 17 00:00:00 2001 From: JordanWeatherby <47519158+JordanWeatherby@users.noreply.github.com> Date: Wed, 20 May 2020 22:26:42 +0100 Subject: [PATCH 6/6] added back line break VS code removed --- youtube_dl/extractor/giantbomb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/extractor/giantbomb.py b/youtube_dl/extractor/giantbomb.py index 3d175b9eb..c6477958d 100644 --- a/youtube_dl/extractor/giantbomb.py +++ b/youtube_dl/extractor/giantbomb.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import re import json