Add support for Shush.se.
This commit is contained in:
parent
1ad6143061
commit
90709a0fc5
@ -632,6 +632,7 @@ from .sexykarma import SexyKarmaIE
|
|||||||
from .shahid import ShahidIE
|
from .shahid import ShahidIE
|
||||||
from .shared import SharedIE
|
from .shared import SharedIE
|
||||||
from .sharesix import ShareSixIE
|
from .sharesix import ShareSixIE
|
||||||
|
from .shush import ShushIE
|
||||||
from .sina import SinaIE
|
from .sina import SinaIE
|
||||||
from .skynewsarabia import (
|
from .skynewsarabia import (
|
||||||
SkyNewsArabiaIE,
|
SkyNewsArabiaIE,
|
||||||
|
50
youtube_dl/extractor/shush.py
Normal file
50
youtube_dl/extractor/shush.py
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..compat import (
|
||||||
|
compat_parse_qs,
|
||||||
|
)
|
||||||
|
from ..utils import (
|
||||||
|
encode_dict,
|
||||||
|
sanitized_Request,
|
||||||
|
urlencode_postdata,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class ShushIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?shush\.se/(?:index\.php)?\?(?P<id>id=[0-9]+&show=.+)'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'http://www.shush.se/index.php?id=23&show=thirdwatch',
|
||||||
|
'md5': '13d99f581a174b82e239b85720cbfa2a',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '23-thirdwatch',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Third Watch Season 2 Episode: 1 – The Lost',
|
||||||
|
'thumbnail': 're:^https?://.*\.(gif|jpg)$',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
parsed_id = compat_parse_qs(video_id)
|
||||||
|
if parsed_id:
|
||||||
|
video_id = "%s-%s" % (parsed_id['id'][0], parsed_id['show'][0])
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
|
title = self._search_regex(r'<title>Shush.se - Watch (.+?) \| Free Online Streaming', webpage, 'title')
|
||||||
|
query_id = self._html_search_regex(r'\{link:"([a-zA-Z0-9@/!=]+)",image:', webpage, 'query_id')
|
||||||
|
|
||||||
|
file_info_request = sanitized_Request('http://www.shush.se/plugins/load.php')
|
||||||
|
file_info_request.add_header("Content-type", 'application/x-www-form-urlencoded')
|
||||||
|
file_info_request.data = urlencode_postdata(encode_dict({'link': query_id}))
|
||||||
|
file_info = self._download_json(file_info_request, video_id)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': title,
|
||||||
|
'url': file_info["link"],
|
||||||
|
'ext': file_info["type"],
|
||||||
|
'thumbnail': file_info["image"],
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user