mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-21 12:57:20 +08:00
[Dailymotion] Added support for "home" URLs.
This commit is contained in:
parent
544a8693b7
commit
8c1ac1b273
@ -103,6 +103,7 @@ from .dailymotion import (
|
||||
DailymotionIE,
|
||||
DailymotionPlaylistIE,
|
||||
DailymotionUserIE,
|
||||
DailymotionUserHomeIE
|
||||
)
|
||||
from .daum import DaumIE
|
||||
from .dbtv import DBTVIE
|
||||
|
@ -250,3 +250,23 @@ class DailymotionUserIE(DailymotionPlaylistIE):
|
||||
'title': full_user,
|
||||
'entries': self._extract_entries(user),
|
||||
}
|
||||
|
||||
class DailymotionUserHomeIE(DailymotionUserIE):
|
||||
IE_NAME = 'dailymotion:userhome'
|
||||
_VALID_URL = r'https?://(?:www\.)?dailymotion\.[a-z]{2,3}/(?P<user>[^/]+)/?$'
|
||||
|
||||
def _real_extract(self, url):
|
||||
mobj = re.match(self._VALID_URL, url)
|
||||
user = mobj.group('user')
|
||||
url = self._PAGE_TEMPLATE % (user, '')
|
||||
webpage = self._download_webpage(url, user)
|
||||
full_user = unescapeHTML(self._html_search_regex(
|
||||
r'<a class="nav-image" title="([^"]+)" href="/%s">' % re.escape(user),
|
||||
webpage, 'user'))
|
||||
|
||||
return {
|
||||
'_type': 'playlist',
|
||||
'id': user,
|
||||
'title': full_user,
|
||||
'entries': self._extract_entries(user),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user