mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-01-07 17:16:08 +00:00
[vine:user] Fix extraction (closes #15514)
This commit is contained in:
parent
68ddba20ae
commit
9b5aead6aa
|
@ -2,7 +2,6 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import itertools
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
|
@ -116,14 +115,14 @@ class VineUserIE(InfoExtractor):
|
||||||
_VINE_BASE_URL = 'https://vine.co/'
|
_VINE_BASE_URL = 'https://vine.co/'
|
||||||
_TESTS = [
|
_TESTS = [
|
||||||
{
|
{
|
||||||
'url': 'https://vine.co/Visa',
|
'url': 'https://vine.co/itsruthb',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'Visa',
|
'id': 'itsruthb',
|
||||||
},
|
},
|
||||||
'playlist_mincount': 46,
|
'playlist_mincount': 611,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'url': 'https://vine.co/u/941705360593584128',
|
'url': 'https://vine.co/u/942914934646415360',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -139,16 +138,10 @@ class VineUserIE(InfoExtractor):
|
||||||
profile_url, user, note='Downloading user profile data')
|
profile_url, user, note='Downloading user profile data')
|
||||||
|
|
||||||
user_id = profile_data['data']['userId']
|
user_id = profile_data['data']['userId']
|
||||||
timeline_data = []
|
user_archive = self._download_json(
|
||||||
for pagenum in itertools.count(1):
|
'https://archive.vine.co/profiles/%s.json' % user_id, user_id)
|
||||||
timeline_url = '%sapi/timelines/users/%s?page=%s&size=100' % (
|
posts = user_archive['posts']
|
||||||
self._VINE_BASE_URL, user_id, pagenum)
|
|
||||||
timeline_page = self._download_json(
|
|
||||||
timeline_url, user, note='Downloading page %d' % pagenum)
|
|
||||||
timeline_data.extend(timeline_page['data']['records'])
|
|
||||||
if timeline_page['data']['nextPage'] is None:
|
|
||||||
break
|
|
||||||
|
|
||||||
entries = [
|
entries = [
|
||||||
self.url_result(e['permalinkUrl'], 'Vine') for e in timeline_data]
|
self.url_result('https://vine.co/v/%s' % post_id, 'Vine')
|
||||||
|
for post_id in posts]
|
||||||
return self.playlist_result(entries, user)
|
return self.playlist_result(entries, user)
|
||||||
|
|
Loading…
Reference in a new issue