[yuvutu] Support for user pages
This commit is contained in:
parent
1f3cfb8178
commit
90dfa03af5
@ -1166,7 +1166,7 @@ from .youtube import (
|
|||||||
YoutubeUserIE,
|
YoutubeUserIE,
|
||||||
YoutubeWatchLaterIE,
|
YoutubeWatchLaterIE,
|
||||||
)
|
)
|
||||||
from .yuvutu import YuvutuIE
|
from .yuvutu import YuvutuIE, YuvutuUserIE
|
||||||
from .zapiks import ZapiksIE
|
from .zapiks import ZapiksIE
|
||||||
from .zdf import ZDFIE, ZDFChannelIE
|
from .zdf import ZDFIE, ZDFChannelIE
|
||||||
from .zingmp3 import ZingMp3IE
|
from .zingmp3 import ZingMp3IE
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import itertools
|
||||||
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import determine_ext
|
from ..utils import (
|
||||||
|
determine_ext,
|
||||||
|
sanitized_Request,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class YuvutuIE(InfoExtractor):
|
class YuvutuIE(InfoExtractor):
|
||||||
@ -44,3 +50,36 @@ class YuvutuIE(InfoExtractor):
|
|||||||
'title': title,
|
'title': title,
|
||||||
'age_limit': 18,
|
'age_limit': 18,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class YuvutuUserIE(InfoExtractor):
|
||||||
|
IE_DESC = 'Yuvutu user profile'
|
||||||
|
_VALID_URL = r'http://(?:www\.)?yuvutu\.com/modules\.php\?name=YuPeople&action=view_videos&user_id=(?P<id>[0-9]+)'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'http://www.yuvutu.com/modules.php?name=YuPeople&action=view_videos&user_id=1072966',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '1072966',
|
||||||
|
'age_limit': 18,
|
||||||
|
},
|
||||||
|
'playlist_mincount': 90,
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
user_id = self._match_id(url)
|
||||||
|
|
||||||
|
entries = []
|
||||||
|
for pagenum in itertools.count(1):
|
||||||
|
request = sanitized_Request(
|
||||||
|
'http://www.yuvutu.com/modules.php?name=YuPeople&action=view_videos&user_id=%s&page=%d' % (user_id, pagenum))
|
||||||
|
page = self._download_webpage(request, user_id, 'Downloading user page %d' % pagenum)
|
||||||
|
|
||||||
|
video_ids = re.findall(
|
||||||
|
r'class=[\'"]thumb-image[\'"]>\s+<a\s+href=[\'"]/video/([^/]+)', page)
|
||||||
|
if not video_ids:
|
||||||
|
break
|
||||||
|
for video_id in video_ids:
|
||||||
|
entries.append(self.url_result('http://www.yuvutu.com/video/%s/' % video_id, YuvutuIE.ie_key()))
|
||||||
|
|
||||||
|
playlist = self.playlist_result(entries, user_id)
|
||||||
|
playlist['age_limit'] = 18
|
||||||
|
return playlist
|
||||||
|
Loading…
x
Reference in New Issue
Block a user