1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2025-01-08 14:17:54 +01:00

Add extract User url

This commit is contained in:
hatienl0i261299 2020-03-29 14:46:57 +07:00
parent a49d4359b1
commit cb2895076b
2 changed files with 8 additions and 40 deletions

View File

@ -1508,4 +1508,5 @@ from .zingmp3_vn import (
Zingmp3_vnIE, Zingmp3_vnIE,
Zingmp3_vnPlaylistIE, Zingmp3_vnPlaylistIE,
Zingmp3_vnChartIE, Zingmp3_vnChartIE,
Zingmp3_vnUserIE,
) )

View File

@ -581,41 +581,17 @@ class Zingmp3_vnChartIE(Zingmp3_vnIE):
yield self.url_result(url, ie=Zingmp3_vnIE.ie_key(), video_id=video_id) 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)^ _VALID_URL = r'''(?x)^
((http[s]?|fpt):)\/?\/(www\.|m\.|) ((http[s]?|fpt):)\/?\/(www\.|m\.|)
(?P<site> (?P<site>
(zingmp3\.vn) (zingmp3\.vn)
)\/(?P<nghe_si>nghe-si\/|) )\/(?P<nghe_si>nghe-si\/|)(?P<name>.*?)
(?P<name>.*?) (?:$|\/)
(?:$|\/)(?P<slug_name>.*?$) (?P<slug_name>bai-hat|album|video|playlist)$
''' '''
IE_NAME = "zingmp3_vn:user" IE_NAME = "zingmp3_vn:user"
_TESTS = [ _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", 'url': "https://zingmp3.vn/nghe-si/Huong-Giang-Idol/bai-hat",
"info_dict": { "info_dict": {
@ -664,14 +640,6 @@ r"""class Zingmp3_vnUserIE(Zingmp3_vnIE):
}, },
"playlist_mincount": 5 "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 = { list_name_api_user = {
'bai-hat': "/song/get-list", 'bai-hat': "/song/get-list",
@ -785,4 +753,3 @@ r"""class Zingmp3_vnUserIE(Zingmp3_vnIE):
if total <= start: if total <= start:
break break
"""