[Picarto] Add new extractor for recorded Picarto VODs
This commit is contained in:
parent
a86922c470
commit
540db7fffc
@ -799,6 +799,7 @@ from .periscope import (
|
||||
from .philharmoniedeparis import PhilharmonieDeParisIE
|
||||
from .phoenix import PhoenixIE
|
||||
from .photobucket import PhotobucketIE
|
||||
from .picarto import PicartoVodIE
|
||||
from .piksel import PikselIE
|
||||
from .pinkbike import PinkbikeIE
|
||||
from .pladform import PladformIE
|
||||
|
38
youtube_dl/extractor/picarto.py
Normal file
38
youtube_dl/extractor/picarto.py
Normal file
@ -0,0 +1,38 @@
|
||||
# coding: utf-8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
|
||||
|
||||
class PicartoVodIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://(?:www\.)?picarto\.tv/videopopout/(?P<id>[a-zA-Z_\-.0-9]+).flv'
|
||||
_TEST = {
|
||||
'url': 'https://picarto.tv/videopopout/Carrot_2018.01.11.07.55.12.flv',
|
||||
'md5': '1ecd32f358fee23d8b3e6954880f78d4',
|
||||
'info_dict': {
|
||||
'id': 'Carrot_2018.01.11.07.55.12',
|
||||
'ext': 'm3u8',
|
||||
'title': 'Carrot_2018.01.11.07.55.12',
|
||||
'thumbnail': r're:^https?://.*\.jpg$'
|
||||
}
|
||||
}
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
|
||||
vod_regex = "<script[^<]*>[^<]*riot.mount\(([^<]+)\)[^<]*<\/"
|
||||
vod_script = self._html_search_regex(vod_regex, webpage, "vod_script")
|
||||
vod_url = self._search_regex('vod: \\"([^\\"]*)\\"', vod_script, "vod_url")
|
||||
vod_thumb = self._search_regex('vodThumb: \\"([^\\"]*)\\"', vod_script, "vod_thumb")
|
||||
|
||||
title = video_id
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': title,
|
||||
'description': "",
|
||||
'uploader': "",
|
||||
'url' : vod_url,
|
||||
'thumbnail' : vod_thumb
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user