From cb2895076b066f581aae9516fc645509ddb23348 Mon Sep 17 00:00:00 2001 From: hatienl0i261299 Date: Sun, 29 Mar 2020 14:46:57 +0700 Subject: [PATCH] Add extract User url --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/zingmp3_vn.py | 47 +++++------------------------- 2 files changed, 8 insertions(+), 40 deletions(-) diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 3ad9dc3a3..f3cfcb6c1 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -1508,4 +1508,5 @@ from .zingmp3_vn import ( Zingmp3_vnIE, Zingmp3_vnPlaylistIE, Zingmp3_vnChartIE, + Zingmp3_vnUserIE, ) \ No newline at end of file diff --git a/youtube_dl/extractor/zingmp3_vn.py b/youtube_dl/extractor/zingmp3_vn.py index aac1495f4..5cff7a745 100644 --- a/youtube_dl/extractor/zingmp3_vn.py +++ b/youtube_dl/extractor/zingmp3_vn.py @@ -581,41 +581,17 @@ class Zingmp3_vnChartIE(Zingmp3_vnIE): yield self.url_result(url, ie=Zingmp3_vnIE.ie_key(), video_id=video_id) -r"""class Zingmp3_vnUserIE(Zingmp3_vnIE): +class Zingmp3_vnUserIE(Zingmp3_vnIE): _VALID_URL = r'''(?x)^ - ((http[s]?|fpt):)\/?\/(www\.|m\.|) - (?P - (zingmp3\.vn) - )\/(?Pnghe-si\/|) - (?P.*?) - (?:$|\/)(?P.*?$) + ((http[s]?|fpt):)\/?\/(www\.|m\.|) + (?P + (zingmp3\.vn) + )\/(?Pnghe-si\/|)(?P.*?) + (?:$|\/) + (?Pbai-hat|album|video|playlist)$ ''' IE_NAME = "zingmp3_vn:user" _TESTS = [ - { - "url": "https://zingmp3.vn/Mr-Siro", - "info_dict": { - "id": "IWZ98609", - "title": "Mr-Siro-bai-hat" - }, - "playlist_mincount": 5 - }, - { - "url": "https://zingmp3.vn/onlyc", - "info_dict": { - "id": "IWZ9ZED8", - "title": 'onlyc-bai-hat' - }, - "playlist_mincount": 5 - }, - { - "url": "https://zingmp3.vn/nghe-si/Huong-Giang-Idol", - "info_dict": { - "id": "IWZ9CUWA", - "title": "Huong-Giang-Idol-bai-hat" - }, - "playlist_mincount": 5 - }, { 'url': "https://zingmp3.vn/nghe-si/Huong-Giang-Idol/bai-hat", "info_dict": { @@ -664,14 +640,6 @@ r"""class Zingmp3_vnUserIE(Zingmp3_vnIE): }, "playlist_mincount": 5 }, - { - "url": "https://zingmp3.vn/chu-de/Acoustic/IWZ977C8.html", - "info_dict": { - "id": "IWZ977C8", - "title": "Acoustic", - }, - "playlist_mincount": 3 - }, ] list_name_api_user = { 'bai-hat': "/song/get-list", @@ -785,4 +753,3 @@ r"""class Zingmp3_vnUserIE(Zingmp3_vnIE): if total <= start: break -"""