1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-24 01:14:32 +01:00

finished dropout extractor

This commit is contained in:
Thomas Tsiakalakis 2019-02-20 18:58:00 +01:00
parent f749ac67ab
commit 89ed0c9eed

View File

@ -1,14 +1,13 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from .vimeo import VHXEmbedIE
from ..utils import (
ExtractorError,
sanitized_Request,
urlencode_postdata
urlencode_postdata,
RegexNotFoundError
)
import re
@ -31,9 +30,10 @@ import re
class IntlDropoutIE(VHXEmbedIE):
IE_DESC = 'International Dropout.tv'
_LOGIN_URL = 'https://intl.dropout.tv/login'
_LOGOUT_URL = 'https://intl.dropout.tv/logout'
_VALID_URL = r'https://intl\.dropout\.tv/(?P<id>[^/]+/.+)'
_VALID_URL = r'https://intl\.dropout\.tv/(?P<id>.+)'
_TEST = {
'url': 'https://intl.dropout.tv/um-actually/season:1/videos/c-3po-s-origins-hp-lovecraft-the-food-album-with-weird-al-yankovic',
'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)',
@ -87,15 +87,12 @@ class IntlDropoutIE(VHXEmbedIE):
def _real_extract(self, url):
webpage = self._download_webpage(url, None)
embed = self._html_search_regex(r'<iframe[^>]+"(?P<embed>https://embed.vhx.tv/videos/[0-9]+[^"]*)"[^>]*>', webpage, 'embed')
print(embed)
self._download_webpage(
self._LOGOUT_URL, None,
note='logging out',
errnote='unable to logout', fatal=False
)
return self.url_result(embed)
try:
video = self._html_search_regex(r'<iframe[^>]+"(?P<embed>https://embed.vhx.tv/videos/[0-9]+[^"]*)"[^>]*>', webpage, 'embed')
except RegexNotFoundError:
items = re.findall(r'<a href="(?P<url>https://intl.dropout.tv/videos/[^"]+)"', webpage)
playlist_id = self._search_regex(r'https://intl.dropout.tv/(?P<id>.+)', url, 'id')
playlist_title = self._html_search_regex(r'<h1 class="[^"]*collection-title[^"]*"[^>]*>(?P<title>[^<]+)<', webpage, 'title')
return self.playlist_from_matches(items, playlist_id=playlist_id, playlist_title=playlist_title)
return self.url_result(video)