[Vine] Add support for playlists
This commit is contained in:
parent
cdfc187cd5
commit
1f0cd0a1b8
@ -835,6 +835,11 @@ class InfoExtractor(object):
|
|||||||
'title': unescapeHTML(json_ld.get('headline')),
|
'title': unescapeHTML(json_ld.get('headline')),
|
||||||
'description': unescapeHTML(json_ld.get('articleBody')),
|
'description': unescapeHTML(json_ld.get('articleBody')),
|
||||||
})
|
})
|
||||||
|
elif item_type == 'ItemList':
|
||||||
|
info.update({
|
||||||
|
'url': unescapeHTML(json_ld.get('url')),
|
||||||
|
'itemListElement': json_ld.get('itemListElement'),
|
||||||
|
})
|
||||||
return dict((k, v) for k, v in info.items() if v is not None)
|
return dict((k, v) for k, v in info.items() if v is not None)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -956,6 +956,7 @@ from .vimeo import (
|
|||||||
from .vimple import VimpleIE
|
from .vimple import VimpleIE
|
||||||
from .vine import (
|
from .vine import (
|
||||||
VineIE,
|
VineIE,
|
||||||
|
VinePlaylistIE,
|
||||||
VineUserIE,
|
VineUserIE,
|
||||||
)
|
)
|
||||||
from .viki import (
|
from .viki import (
|
||||||
|
@ -116,6 +116,29 @@ class VineIE(InfoExtractor):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class VinePlaylistIE(InfoExtractor):
|
||||||
|
IE_NAME = 'vine:playlist'
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?vine\.co/playlists/(?P<id>[^/]+)/?(\?.*)?$'
|
||||||
|
TEST = {
|
||||||
|
'url': 'https://vine.co/playlists/songcollab-kenzie-nimmo',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'songcollab-kenzie-nimmo',
|
||||||
|
'title': 'SongCollab: Kenzie Nimmo',
|
||||||
|
},
|
||||||
|
'playlist_mincount': 20,
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
display_id = self._match_id(url)
|
||||||
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
|
||||||
|
title = self._html_search_regex(r'<h1>(.+)</h1>', webpage, 'title', None)
|
||||||
|
data = self._search_json_ld(webpage, display_id)['itemListElement']
|
||||||
|
|
||||||
|
entries = [self.url_result(e['url'], 'Vine') for e in data]
|
||||||
|
return self.playlist_result(entries, display_id, title)
|
||||||
|
|
||||||
|
|
||||||
class VineUserIE(InfoExtractor):
|
class VineUserIE(InfoExtractor):
|
||||||
IE_NAME = 'vine:user'
|
IE_NAME = 'vine:user'
|
||||||
_VALID_URL = r'(?:https?://)?vine\.co/(?P<u>u/)?(?P<user>[^/]+)/?(\?.*)?$'
|
_VALID_URL = r'(?:https?://)?vine\.co/(?P<u>u/)?(?P<user>[^/]+)/?(\?.*)?$'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user