From 5f31a5e783a495751f1554e063b1c5c49aacb88d Mon Sep 17 00:00:00 2001 From: cpm Date: Fri, 11 Nov 2016 23:14:58 -0500 Subject: [PATCH] [PlaysTVIE] Replaced regex with json_ld --- youtube_dl/extractor/plays.py | 37 ++++------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/youtube_dl/extractor/plays.py b/youtube_dl/extractor/plays.py index 3d7f05a42..5ac0292fa 100644 --- a/youtube_dl/extractor/plays.py +++ b/youtube_dl/extractor/plays.py @@ -9,16 +9,7 @@ from ..utils import int_or_none class PlaysTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?plays\.tv/video/(?P[0-9a-f]{18})' - _TESTS = [{ - 'url': 'https://plays.tv/video/57698d69e6c84884a2/just-a-typical-reaper-potg', - 'md5': 'c4bdc35a0c9ca1f95c6ecad2f99c0e76', - 'info_dict': { - 'id': '57698d69e6c84884a2', - 'ext': 'mp4', - 'title': 'Solfect - Just a typical Reaper POTG', - 'description': 'Posted by Solfect', - } - }, { + _TEST = { 'url': 'https://plays.tv/video/56af17f56c95335490/when-you-outplay-the-azir-wall', 'md5': 'dfeac1198506652b5257a62762cec7bc', 'info_dict': { @@ -27,34 +18,14 @@ class PlaysTVIE(InfoExtractor): 'title': 'Bjergsen - When you outplay the Azir wall', 'description': 'Posted by Bjergsen', } - }, { - 'url': 'https://plays.tv/video/58236095d388d140aa/-?from=user', - 'md5': '09535d1d157f679e6446fb39ce51645a', - 'info_dict': { - 'id': '58236095d388d140aa', - 'ext': 'mp4', - 'title': 'akn3ex - \u63a7\u3048\u3081\u306b\u8a00\u3063\u3066\u9811\u5f35\u3063\u3066\u308b', - 'description': 'Posted by akn3ex', - } - }, { - 'url': 'http://plays.tv/video/56d77f74866aa25854/pro-abortion-propaganda?from=search&search=dota+2', - 'md5': '3e3fc1d5c20cb373eb3143bbb4ca5070', - 'info_dict': { - 'id': '56d77f74866aa25854', - 'ext': 'mp4', - 'title': 'SavageIs - pro abortion propaganda', - 'description': 'Posted by SavageIs', - } - }] + } def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) - content = self._search_regex( - r'