From 5b99b0644d6f1ef77f22a8bf5e3823b77f4f44e2 Mon Sep 17 00:00:00 2001 From: yash Date: Mon, 6 Apr 2020 05:57:00 -0700 Subject: [PATCH 1/3] [yjc.ir] Add new extractor --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/yjc.py | 32 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 youtube_dl/extractor/yjc.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 41c02eeae..d7b928d4d 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -1446,6 +1446,7 @@ from .yandexvideo import YandexVideoIE from .yapfiles import YapFilesIE from .yesjapan import YesJapanIE from .yinyuetai import YinYueTaiIE +from .yjc import yjcIE from .ynet import YnetIE from .youjizz import YouJizzIE from .youku import ( diff --git a/youtube_dl/extractor/yjc.py b/youtube_dl/extractor/yjc.py new file mode 100644 index 000000000..922d2ab62 --- /dev/null +++ b/youtube_dl/extractor/yjc.py @@ -0,0 +1,32 @@ +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class yjcIE(InfoExtractor): + _VALID_URL = r'(?:https?://)?(?:www\.)?yjc\.ir/fa/news/(?P\w+)/*' + + _TESTS = { + # TODO: Implement + } + + def _real_extract(self, url): + video_id = self._match_id(url) + + webpage = self._download_webpage( + url, video_id + ) + + title = self._html_search_regex(r'(.+?)', webpage, 'title') + + download_url = self._html_search_regex( + + r'((https:\/\/)cdn\.yjc\.ir/files/fa/news/[0-9]*/[0-9]*/[0-9]*/[0-9_]*\.mp4)', + + webpage, "download_url" + ) + return { + 'id': video_id, + 'url': download_url, + 'title': title + } From 1b0fc3115f288cd8d95c31e93ef0bd04f3b6126f Mon Sep 17 00:00:00 2001 From: yasho21 <55759897+yasho21@users.noreply.github.com> Date: Mon, 6 Apr 2020 06:19:52 -0700 Subject: [PATCH 2/3] Delete likee.py --- youtube_dl/extractor/likee.py | 39 ----------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 youtube_dl/extractor/likee.py diff --git a/youtube_dl/extractor/likee.py b/youtube_dl/extractor/likee.py deleted file mode 100644 index 9e3373d3b..000000000 --- a/youtube_dl/extractor/likee.py +++ /dev/null @@ -1,39 +0,0 @@ -from __future__ import unicode_literals - -from .common import InfoExtractor - - -class likeeIE(InfoExtractor): - - - - _VALID_URL = r'(?:https?://)?(?:www\.)?likee\.com/@(?P\w+[-0-9])*/video/[0-9]+' - #print(1) - #_TESTS = { - # TODO: Implement - - #} - - def _real_extract(self, url): - video_id = self._match_id(url) - webpage = self._download_webpage( - r'http?://video\.like\.video/[A-Za-z0-9!_/=@#$%^&*(),.?:{}|<>]*', video_id - ) - - - title = "video 1" - download_url = self._html_search_regex( - - r'http?://video\.like\.video/[A-Za-z0-9!_/=@#$%^&*(),.?:{}|<>]*', - - webpage, "download_url" - ) - - - - - return { - 'id': video_id, - 'url': download_url, - 'title': title - } From 52a278175d84246c99c92480b13561bf8460f7f0 Mon Sep 17 00:00:00 2001 From: yasho21 <55759897+yasho21@users.noreply.github.com> Date: Mon, 6 Apr 2020 06:20:43 -0700 Subject: [PATCH 3/3] Update extractors.py --- youtube_dl/extractor/extractors.py | 1 - 1 file changed, 1 deletion(-) diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index d7b928d4d..b43923ae1 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -570,7 +570,6 @@ from .liveleak import ( LiveLeakIE, LiveLeakEmbedIE, ) -from .likee import likeeIE from .livestream import ( LivestreamIE, LivestreamOriginalIE,