[peertube] Added extractor
This commit is contained in:
parent
796bf9de45
commit
034026359e
@ -805,6 +805,7 @@ from .parliamentliveuk import ParliamentLiveUKIE
|
||||
from .patreon import PatreonIE
|
||||
from .pbs import PBSIE
|
||||
from .pearvideo import PearVideoIE
|
||||
from .peertube import PeertubeIE
|
||||
from .people import PeopleIE
|
||||
from .performgroup import PerformGroupIE
|
||||
from .periscope import (
|
||||
@ -1332,7 +1333,7 @@ from .webofstories import (
|
||||
WebOfStoriesPlaylistIE,
|
||||
)
|
||||
from .weibo import (
|
||||
WeiboIE,
|
||||
WeiboIE,
|
||||
WeiboMobileIE
|
||||
)
|
||||
from .weiqitv import WeiqiTVIE
|
||||
|
35
youtube_dl/extractor/peertube.py
Normal file
35
youtube_dl/extractor/peertube.py
Normal file
@ -0,0 +1,35 @@
|
||||
# coding: utf-8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
|
||||
|
||||
class PeertubeIE(InfoExtractor):
|
||||
_BASE_VIDEO_URL = 'https://peertube.touhoppai.moe/static/webseed/%s-1080.mp4'
|
||||
_BASE_THUMBNAIL_URL = 'https://peertube.touhoppai.moe/static/previews/%s.jpg'
|
||||
IE_DESC = 'Peertube Videos'
|
||||
IE_NAME = 'Peertube'
|
||||
_VALID_URL = r'https?:\/\/peertube\.touhoppai\.moe\/videos\/watch\/(?P<id>[0-9|\-|a-z]+)'
|
||||
_TEST = {
|
||||
'url': 'https://peertube.touhoppai.moe/videos/watch/7f3421ae-6161-4a4a-ae38-d167aec51683',
|
||||
'md5': 'a5e1e4a978e6b789553198d1739f5643',
|
||||
'info_dict': {
|
||||
'id': '7f3421ae-6161-4a4a-ae38-d167aec51683',
|
||||
'ext': 'mp4',
|
||||
'title': 'David Revoy Live Stream: Speedpainting',
|
||||
'description': 'md5:5c09a6e3fdb5f56edce289d69fbe7567',
|
||||
'thumbnail': 'https://peertube.touhoppai.moe/static/previews/7f3421ae-6161-4a4a-ae38-d167aec51683.jpg',
|
||||
}
|
||||
}
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
title = self._og_search_title(webpage)
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': title,
|
||||
'description': self._og_search_description(webpage),
|
||||
'url': self._BASE_VIDEO_URL % video_id,
|
||||
'thumbnail': self._BASE_THUMBNAIL_URL % video_id
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user