From 6f58576d9c4c1aab80836f3c6f2029154b78002b Mon Sep 17 00:00:00 2001 From: enigmaquip Date: Fri, 27 Oct 2017 08:22:32 -0600 Subject: [PATCH 1/8] [fxnetworks] improve extraction --- youtube_dl/extractor/fxnetworks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/youtube_dl/extractor/fxnetworks.py b/youtube_dl/extractor/fxnetworks.py index 629897317..3d3512d68 100644 --- a/youtube_dl/extractor/fxnetworks.py +++ b/youtube_dl/extractor/fxnetworks.py @@ -64,6 +64,9 @@ class FXNetworksIE(AdobePassIE): 'id': video_id, 'title': title, 'url': smuggle_url(update_url_query(release_url, query), {'force_smil_url': True}), + 'series': video_data.get('data-show-title'), + 'episode_number': int(video_data.get('data-episode')), + 'season_number': int(video_data.get('data-season')), 'thumbnail': video_data.get('data-large-thumb'), 'age_limit': parse_age_limit(rating), 'ie_key': 'ThePlatform', From a8e8d0739255dfc9ab24183814ed81215901d034 Mon Sep 17 00:00:00 2001 From: enigmaquip Date: Fri, 27 Oct 2017 08:31:38 -0600 Subject: [PATCH 2/8] Changed episode number and season number to use int_or_none util --- youtube_dl/extractor/fxnetworks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/fxnetworks.py b/youtube_dl/extractor/fxnetworks.py index 3d3512d68..6b2ca848f 100644 --- a/youtube_dl/extractor/fxnetworks.py +++ b/youtube_dl/extractor/fxnetworks.py @@ -65,8 +65,8 @@ class FXNetworksIE(AdobePassIE): 'title': title, 'url': smuggle_url(update_url_query(release_url, query), {'force_smil_url': True}), 'series': video_data.get('data-show-title'), - 'episode_number': int(video_data.get('data-episode')), - 'season_number': int(video_data.get('data-season')), + 'episode_number': int_or_none(video_data.get('data-episode')), + 'season_number': int_or_none(video_data.get('data-season')), 'thumbnail': video_data.get('data-large-thumb'), 'age_limit': parse_age_limit(rating), 'ie_key': 'ThePlatform', From 3c15d43670698af3bb002d4c10652c12dd9ccf26 Mon Sep 17 00:00:00 2001 From: enigmaquip Date: Fri, 27 Oct 2017 15:39:31 -0600 Subject: [PATCH 3/8] update test --- youtube_dl/extractor/fxnetworks.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/fxnetworks.py b/youtube_dl/extractor/fxnetworks.py index 6b2ca848f..9154e631e 100644 --- a/youtube_dl/extractor/fxnetworks.py +++ b/youtube_dl/extractor/fxnetworks.py @@ -13,17 +13,21 @@ from ..utils import ( class FXNetworksIE(AdobePassIE): _VALID_URL = r'https?://(?:www\.)?(?:fxnetworks|simpsonsworld)\.com/video/(?P\d+)' _TESTS = [{ - 'url': 'http://www.fxnetworks.com/video/719841347694', - 'md5': '1447d4722e42ebca19e5232ab93abb22', + 'url': 'http://www.fxnetworks.com/video/1046477891799', + 'md5': 'b5d9896b224e6c85f10e92fbac3a9115', 'info_dict': { - 'id': '719841347694', + 'id': '1046477891799', 'ext': 'mp4', - 'title': 'Vanpage', - 'description': 'F*ck settling down. You\'re the Worst returns for an all new season August 31st on FXX.', + 'title': 'September', + 'description': 'Sam has people over. An FX Original Series, Thursday 10PM on FX.', 'age_limit': 14, 'uploader': 'NEWA-FNG-FX', - 'upload_date': '20160706', - 'timestamp': 1467844741, + 'upload_date': '20170615', + 'timestamp': 1505453400, + 'episode_number': 1, + 'season_number': 2, + 'series': 'Better Things', + }, 'add_ie': ['ThePlatform'], }, { From 7157dfb5f62ad865b843bb11dc0b20f67dc4e5d1 Mon Sep 17 00:00:00 2001 From: enigmaquip Date: Fri, 27 Oct 2017 15:40:01 -0600 Subject: [PATCH 4/8] Update fxnetworks.py --- youtube_dl/extractor/fxnetworks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/fxnetworks.py b/youtube_dl/extractor/fxnetworks.py index 9154e631e..5abcab977 100644 --- a/youtube_dl/extractor/fxnetworks.py +++ b/youtube_dl/extractor/fxnetworks.py @@ -20,7 +20,7 @@ class FXNetworksIE(AdobePassIE): 'ext': 'mp4', 'title': 'September', 'description': 'Sam has people over. An FX Original Series, Thursday 10PM on FX.', - 'age_limit': 14, + 'age_limit': 17, 'uploader': 'NEWA-FNG-FX', 'upload_date': '20170615', 'timestamp': 1505453400, From fa1225999123423cc61179c7ce67310def7718b0 Mon Sep 17 00:00:00 2001 From: enigmaquip Date: Fri, 27 Oct 2017 20:37:00 -0600 Subject: [PATCH 5/8] fix test --- youtube_dl/extractor/fxnetworks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/fxnetworks.py b/youtube_dl/extractor/fxnetworks.py index 5abcab977..8112e8054 100644 --- a/youtube_dl/extractor/fxnetworks.py +++ b/youtube_dl/extractor/fxnetworks.py @@ -16,13 +16,13 @@ class FXNetworksIE(AdobePassIE): 'url': 'http://www.fxnetworks.com/video/1046477891799', 'md5': 'b5d9896b224e6c85f10e92fbac3a9115', 'info_dict': { - 'id': '1046477891799', + 'id': 'NFPnVIqjI5eS', 'ext': 'mp4', 'title': 'September', 'description': 'Sam has people over. An FX Original Series, Thursday 10PM on FX.', 'age_limit': 17, 'uploader': 'NEWA-FNG-FX', - 'upload_date': '20170615', + 'upload_date': '20170915', 'timestamp': 1505453400, 'episode_number': 1, 'season_number': 2, From 421a6407f46dbc2ec4152e5e2bd936f2bdd6b636 Mon Sep 17 00:00:00 2001 From: enigmaquip Date: Sat, 28 Oct 2017 13:22:05 -0600 Subject: [PATCH 6/8] fix test for freely available vid --- youtube_dl/extractor/fxnetworks.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/youtube_dl/extractor/fxnetworks.py b/youtube_dl/extractor/fxnetworks.py index 8112e8054..35bc4283b 100644 --- a/youtube_dl/extractor/fxnetworks.py +++ b/youtube_dl/extractor/fxnetworks.py @@ -13,21 +13,20 @@ from ..utils import ( class FXNetworksIE(AdobePassIE): _VALID_URL = r'https?://(?:www\.)?(?:fxnetworks|simpsonsworld)\.com/video/(?P\d+)' _TESTS = [{ - 'url': 'http://www.fxnetworks.com/video/1046477891799', - 'md5': 'b5d9896b224e6c85f10e92fbac3a9115', + 'url': 'http://www.fxnetworks.com/video/1032565827847', + 'md5': '8d99b97b4aa7a202f55b6ed47ea7e703', 'info_dict': { - 'id': 'NFPnVIqjI5eS', + 'id': 'dRzwHC_MMqIv', 'ext': 'mp4', - 'title': 'September', - 'description': 'Sam has people over. An FX Original Series, Thursday 10PM on FX.', - 'age_limit': 17, + 'title': 'First Look: Better Things - Season 2', + 'description': 'Because real life is like a fart. Watch this FIRST LOOK to see what inspired the new season of Better Things.', + 'age_limit': 14, 'uploader': 'NEWA-FNG-FX', - 'upload_date': '20170915', - 'timestamp': 1505453400, - 'episode_number': 1, + 'upload_date': '20170825', + 'timestamp': 1503686274, + 'episode_number': 0, 'season_number': 2, 'series': 'Better Things', - }, 'add_ie': ['ThePlatform'], }, { From fc7d42b21a1952b53b6397797b544592dfefc89c Mon Sep 17 00:00:00 2001 From: enigmaquip Date: Sat, 28 Oct 2017 16:15:52 -0600 Subject: [PATCH 7/8] Update fxnetworks.py --- youtube_dl/extractor/fxnetworks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/extractor/fxnetworks.py b/youtube_dl/extractor/fxnetworks.py index 35bc4283b..0a0bc60f0 100644 --- a/youtube_dl/extractor/fxnetworks.py +++ b/youtube_dl/extractor/fxnetworks.py @@ -7,6 +7,7 @@ from ..utils import ( extract_attributes, parse_age_limit, smuggle_url, + int_or_none, ) From 825375ec0323106b781c3145af1d3e43ee663af9 Mon Sep 17 00:00:00 2001 From: Sergey M Date: Sun, 29 Oct 2017 05:19:43 +0700 Subject: [PATCH 8/8] Update fxnetworks.py --- youtube_dl/extractor/fxnetworks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/fxnetworks.py b/youtube_dl/extractor/fxnetworks.py index 0a0bc60f0..37549fb01 100644 --- a/youtube_dl/extractor/fxnetworks.py +++ b/youtube_dl/extractor/fxnetworks.py @@ -3,11 +3,11 @@ from __future__ import unicode_literals from .adobepass import AdobePassIE from ..utils import ( - update_url_query, extract_attributes, + int_or_none, parse_age_limit, smuggle_url, - int_or_none, + update_url_query, )