2016-04-10 14:43:40 +02:00
|
|
|
# coding: utf-8
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2021-02-11 01:09:05 +01:00
|
|
|
from .common import InfoExtractor
|
2021-02-11 14:08:07 +01:00
|
|
|
from ..utils import (
|
|
|
|
ExtractorError,
|
|
|
|
)
|
|
|
|
from .pulsembed import PulseVideoIE, PulsEmbedIE
|
2016-04-10 14:43:40 +02:00
|
|
|
|
|
|
|
|
2021-02-11 01:09:05 +01:00
|
|
|
class ClipRsIE(InfoExtractor):
|
2016-04-10 14:43:40 +02:00
|
|
|
_VALID_URL = r'https?://(?:www\.)?clip\.rs/(?P<id>[^/]+)/\d+'
|
2021-02-11 01:09:05 +01:00
|
|
|
_TESTS = [{
|
2021-02-11 14:08:07 +01:00
|
|
|
'url': 'https://www.clip.rs/premijera-frajle-predstavljaju-novi-spot-za-pesmu-moli-me-moli/3732',
|
2016-04-10 14:43:40 +02:00
|
|
|
'info_dict': {
|
|
|
|
'id': '1488842.1399140381',
|
|
|
|
'ext': 'mp4',
|
|
|
|
'title': 'PREMIJERA Frajle predstavljaju novi spot za pesmu Moli me, moli',
|
|
|
|
'description': 'md5:56ce2c3b4ab31c5a2e0b17cb9a453026',
|
|
|
|
'duration': 229,
|
|
|
|
'timestamp': 1459850243,
|
|
|
|
'upload_date': '20160405',
|
|
|
|
}
|
2021-02-11 14:08:07 +01:00
|
|
|
}, {
|
|
|
|
'url': 'https://www.clip.rs/u-novom-sadu-se-sinoc-desio-jedan-zimski-neum-svi-su-zaboravili-na-koronu-uhvatili-se-u-kolo-i-nastao-je-hit-video/15686',
|
|
|
|
'info_dict': {
|
|
|
|
'id': '2210721.1689293351',
|
|
|
|
'ext': 'mp4',
|
|
|
|
'title': 'U Novom Sadu se sinoć desio jedan zimski Neum: Svi su zaboravili na koronu, uhvatili se u kolo i nastao je HIT VIDEO',
|
|
|
|
'description': 'md5:b1d7d6c0b029b922f06a2a08c9761852',
|
|
|
|
'timestamp': 1609405068,
|
|
|
|
'upload_date': '20201231',
|
|
|
|
},
|
2021-02-11 01:09:05 +01:00
|
|
|
}]
|
2016-04-10 14:43:40 +02:00
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2016-07-06 14:09:05 +02:00
|
|
|
display_id = self._match_id(url)
|
2016-04-10 14:43:40 +02:00
|
|
|
|
2016-07-06 14:09:05 +02:00
|
|
|
webpage = self._download_webpage(url, display_id)
|
2021-02-11 14:08:07 +01:00
|
|
|
info_dict = {}
|
2016-04-10 14:43:40 +02:00
|
|
|
|
2021-02-11 14:08:07 +01:00
|
|
|
mvp_id = PulseVideoIE._search_mvp_id(webpage, default=None)
|
|
|
|
if mvp_id:
|
|
|
|
info_dict.update({
|
|
|
|
'url': 'pulsevideo:%s' % PulseVideoIE._search_mvp_id(webpage),
|
|
|
|
'ie_key': PulseVideoIE.ie_key(),
|
|
|
|
})
|
|
|
|
else:
|
|
|
|
entries = PulsEmbedIE._extract_entries(webpage)
|
|
|
|
if not entries:
|
|
|
|
raise ExtractorError('Video ID not found on webpage')
|
|
|
|
if len(entries) > 1:
|
|
|
|
raise ExtractorError('More than 1 PulsEmbed')
|
|
|
|
info_dict.update(entries[0])
|
|
|
|
|
|
|
|
info_dict.update({
|
2021-02-11 01:09:05 +01:00
|
|
|
'_type': 'url_transparent',
|
2021-02-11 14:08:07 +01:00
|
|
|
'title': self._og_search_title(webpage),
|
|
|
|
'description': self._og_search_description(webpage),
|
2021-02-11 01:09:05 +01:00
|
|
|
'display_id': display_id,
|
2021-02-11 14:08:07 +01:00
|
|
|
})
|
|
|
|
return info_dict
|