mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-03 17:42:54 +08:00
[elib] Add extractor
This commit is contained in:
parent
a6745124f9
commit
3d315e6c7a
31
youtube_dl/extractor/elib.py
Normal file
31
youtube_dl/extractor/elib.py
Normal file
@ -0,0 +1,31 @@
|
||||
# coding: utf-8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import clean_html
|
||||
|
||||
|
||||
class ElibIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://delivery.*\.elib\.se/Library/(?P<id>[^/#?]+)'
|
||||
|
||||
_TEST = {
|
||||
# Fake ID, real IDs are loan-specific
|
||||
'url': 'https://delivery-32.elib.se/Library/123a4d5a-1e3a-2412-84ae-4a36134e0ac1',
|
||||
'only_matching': True,
|
||||
}
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
data = self._download_json(
|
||||
'https://webservices.elib.se/librarystreaming/v1.0/streamdata/' + video_id,
|
||||
video_id, query={'format': 'json'})
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': data['product']['title'],
|
||||
'url': data['streamUri'],
|
||||
'ext': 'mp3',
|
||||
'vcodec': 'none',
|
||||
'description': clean_html(data['product'].get('description')),
|
||||
'thumbnail': data['product'].get('coverImage'),
|
||||
}
|
@ -259,6 +259,7 @@ from .ehow import EHowIE
|
||||
from .eighttracks import EightTracksIE
|
||||
from .einthusan import EinthusanIE
|
||||
from .eitb import EitbIE
|
||||
from .elib import ElibIE
|
||||
from .ellentv import (
|
||||
EllenTVIE,
|
||||
EllenTVClipsIE,
|
||||
|
Loading…
Reference in New Issue
Block a user