|
|
@ -23,8 +23,7 @@ from ..utils import ( |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class YoutubeIE(InfoExtractor): |
|
|
|
class YoutubeIE(InfoExtractor): |
|
|
|
"""Information extractor for youtube.com.""" |
|
|
|
IE_DESC = u'YouTube.com' |
|
|
|
|
|
|
|
|
|
|
|
_VALID_URL = r"""^ |
|
|
|
_VALID_URL = r"""^ |
|
|
|
( |
|
|
|
( |
|
|
|
(?:https?://)? # http(s):// (optional) |
|
|
|
(?:https?://)? # http(s):// (optional) |
|
|
@ -629,8 +628,7 @@ class YoutubeIE(InfoExtractor): |
|
|
|
return results |
|
|
|
return results |
|
|
|
|
|
|
|
|
|
|
|
class YoutubePlaylistIE(InfoExtractor): |
|
|
|
class YoutubePlaylistIE(InfoExtractor): |
|
|
|
"""Information Extractor for YouTube playlists.""" |
|
|
|
IE_DESC = u'YouTube.com playlists' |
|
|
|
|
|
|
|
|
|
|
|
_VALID_URL = r"""(?: |
|
|
|
_VALID_URL = r"""(?: |
|
|
|
(?:https?://)? |
|
|
|
(?:https?://)? |
|
|
|
(?:\w+\.)? |
|
|
|
(?:\w+\.)? |
|
|
@ -697,8 +695,7 @@ class YoutubePlaylistIE(InfoExtractor): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class YoutubeChannelIE(InfoExtractor): |
|
|
|
class YoutubeChannelIE(InfoExtractor): |
|
|
|
"""Information Extractor for YouTube channels.""" |
|
|
|
IE_DESC = u'YouTube.com channels' |
|
|
|
|
|
|
|
|
|
|
|
_VALID_URL = r"^(?:https?://)?(?:youtu\.be|(?:\w+\.)?youtube(?:-nocookie)?\.com)/channel/([0-9A-Za-z_-]+)" |
|
|
|
_VALID_URL = r"^(?:https?://)?(?:youtu\.be|(?:\w+\.)?youtube(?:-nocookie)?\.com)/channel/([0-9A-Za-z_-]+)" |
|
|
|
_TEMPLATE_URL = 'http://www.youtube.com/channel/%s/videos?sort=da&flow=list&view=0&page=%s&gl=US&hl=en' |
|
|
|
_TEMPLATE_URL = 'http://www.youtube.com/channel/%s/videos?sort=da&flow=list&view=0&page=%s&gl=US&hl=en' |
|
|
|
_MORE_PAGES_INDICATOR = 'yt-uix-load-more' |
|
|
|
_MORE_PAGES_INDICATOR = 'yt-uix-load-more' |
|
|
@ -756,8 +753,7 @@ class YoutubeChannelIE(InfoExtractor): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class YoutubeUserIE(InfoExtractor): |
|
|
|
class YoutubeUserIE(InfoExtractor): |
|
|
|
"""Information Extractor for YouTube users.""" |
|
|
|
IE_DESC = u'YouTube.com user videos (URL or "ytuser" keyword)' |
|
|
|
|
|
|
|
|
|
|
|
_VALID_URL = r'(?:(?:(?:https?://)?(?:\w+\.)?youtube\.com/user/)|ytuser:)([A-Za-z0-9_-]+)' |
|
|
|
_VALID_URL = r'(?:(?:(?:https?://)?(?:\w+\.)?youtube\.com/user/)|ytuser:)([A-Za-z0-9_-]+)' |
|
|
|
_TEMPLATE_URL = 'http://gdata.youtube.com/feeds/api/users/%s' |
|
|
|
_TEMPLATE_URL = 'http://gdata.youtube.com/feeds/api/users/%s' |
|
|
|
_GDATA_PAGE_SIZE = 50 |
|
|
|
_GDATA_PAGE_SIZE = 50 |
|
|
@ -813,7 +809,7 @@ class YoutubeUserIE(InfoExtractor): |
|
|
|
return [self.playlist_result(url_results, playlist_title = username)] |
|
|
|
return [self.playlist_result(url_results, playlist_title = username)] |
|
|
|
|
|
|
|
|
|
|
|
class YoutubeSearchIE(SearchInfoExtractor): |
|
|
|
class YoutubeSearchIE(SearchInfoExtractor): |
|
|
|
"""Information Extractor for YouTube search queries.""" |
|
|
|
IE_DESC = u'YouTube.com searches' |
|
|
|
_API_URL = 'https://gdata.youtube.com/feeds/api/videos?q=%s&start-index=%i&max-results=50&v=2&alt=jsonc' |
|
|
|
_API_URL = 'https://gdata.youtube.com/feeds/api/videos?q=%s&start-index=%i&max-results=50&v=2&alt=jsonc' |
|
|
|
_MAX_RESULTS = 1000 |
|
|
|
_MAX_RESULTS = 1000 |
|
|
|
IE_NAME = u'youtube:search' |
|
|
|
IE_NAME = u'youtube:search' |
|
|
@ -856,6 +852,7 @@ class YoutubeSearchIE(SearchInfoExtractor): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class YoutubeShowIE(InfoExtractor): |
|
|
|
class YoutubeShowIE(InfoExtractor): |
|
|
|
|
|
|
|
IE_DESC = u'YouTube.com (multi-season) shows' |
|
|
|
_VALID_URL = r'https?://www\.youtube\.com/show/(.*)' |
|
|
|
_VALID_URL = r'https?://www\.youtube\.com/show/(.*)' |
|
|
|
IE_NAME = u'youtube:show' |
|
|
|
IE_NAME = u'youtube:show' |
|
|
|
|
|
|
|
|
|
|
|