From bd6aba10c6df4b91495b592e22cfe2ade93eae0d Mon Sep 17 00:00:00 2001 From: CompulsiveConfig Date: Wed, 13 Mar 2019 08:14:45 -0500 Subject: [PATCH] [NiconicoPlaylist] Addition of niconico login function, to allow private mylist access. Test still needs work. --- youtube_dl/extractor/niconico.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/niconico.py b/youtube_dl/extractor/niconico.py index 76b412ff1..d0b3f8a72 100644 --- a/youtube_dl/extractor/niconico.py +++ b/youtube_dl/extractor/niconico.py @@ -438,15 +438,27 @@ class NiconicoIE(InfoExtractor): class NiconicoPlaylistIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?nicovideo\.jp/mylist/(?P\d+)' + _NETRC_MACHINE = 'niconico' - _TEST = { + _TESTS = [{ 'url': 'http://www.nicovideo.jp/mylist/27411728', 'info_dict': { 'id': '27411728', 'title': 'AKB48のオールナイトニッポン', }, 'playlist_mincount': 225, - } + }, { + 'url': 'https://www.nicovideo.jp/mylist/64988008', + 'info_dict': { + 'id': '64988008', + 'title': 'Private_Mylist_Test', + }, + 'playlist_mincount': 2, + }] + + # Add support for private mylist access by owner via log-in + def _real_initialize(self): + NiconicoIE._login(self) def _real_extract(self, url): list_id = self._match_id(url)