Compare commits

...

10 Commits

Author SHA1 Message Date
Moritz Bunse
ef2b7d196a
Merge 638ec38eb5 into c5098961b0 2024-08-09 01:09:47 +03:00
dirkf
638ec38eb5
Linted 2023-01-23 13:27:52 +00:00
Moritz Bunse
47390b1355
Update youtube_dl/extractor/videocdn.py
Co-authored-by: dirkf <fieldhouse@gmx.net>
2023-01-21 20:28:53 +01:00
Moritz Bunse
5d37e5e19d
Update youtube_dl/extractor/videocdn.py
Co-authored-by: dirkf <fieldhouse@gmx.net>
2023-01-21 20:28:23 +01:00
mbunse
bdd0cf4611 apply suggested improvements 2023-01-21 20:27:41 +01:00
Moritz Bunse
6ff4cde8e8
Update youtube_dl/extractor/videocdn.py
Co-authored-by: dirkf <fieldhouse@gmx.net>
2023-01-21 20:17:48 +01:00
mbunse
62e96f48db Merge branch 'feature/add_videocdn_extractor' of https://github.com/mbunse/youtube-dl into feature/add_videocdn_extractor 2023-01-21 20:16:36 +01:00
mbunse
bfca7e849c remove duplicate video id extraction 2023-01-21 20:16:21 +01:00
Moritz Bunse
aec8c6b570
Update youtube_dl/extractor/videocdn.py
Co-authored-by: dirkf <fieldhouse@gmx.net>
2023-01-21 20:11:25 +01:00
mbunse
6b54fcef20 [VideoCdn] Add new extractor 2023-01-21 01:10:22 +01:00
2 changed files with 63 additions and 0 deletions

View File

@ -645,6 +645,7 @@ from .livestream import (
) )
from .lnkgo import LnkGoIE from .lnkgo import LnkGoIE
from .localnews8 import LocalNews8IE from .localnews8 import LocalNews8IE
from .videocdn import VideoCdnIE
from .lovehomeporn import LoveHomePornIE from .lovehomeporn import LoveHomePornIE
from .lrt import LRTIE from .lrt import LRTIE
from .lynda import ( from .lynda import (

View File

@ -0,0 +1,62 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
urljoin,
)
class VideoCdnIE(InfoExtractor):
_VALID_URL = r'https?://e\.video-cdn\.net/video?.*video-id=(?P<id>[a-zA-Z0-9-_]+).*'
_TESTS = [
{
'url': 'https://e.video-cdn.net/video?video-id=8eBUrWaMJFS38A5X-j2CgY&player-id=53Tun3ZZpZpVuvaTvsm3jU',
'info_dict': {
'id': '8eBUrWaMJFS38A5X-j2CgY',
'ext': 'mp4',
'title': 'RiskBuster FireFighter VI - Adventskranz',
'thumbnail': r're:(?i)https://.*\.jpeg',
},
},
{
'url': 'https://e.video-cdn.net/video?video-id=91imQ_wKjkTFghe-3mmBAA&player-id=7nCLZ_ESM8rT9YUw6qUGA9',
'info_dict': {
'id': '91imQ_wKjkTFghe-3mmBAA',
'ext': 'mp4',
'title': 'SCC2019_Talk_Tychsen_TXL.mp4',
'thumbnail': r're:(?i)https://.*\.jpeg',
},
},
]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
thumbnail = self._search_regex(
r'\"thumbnailUrl\":\"(?P<thumbnail>[^\"]+)',
webpage, 'thumbnail', group='thumbnail',
default=None)
title = self._search_regex(r'"name"\s*:\s*"((?:\\"|[^"])+)', webpage, 'title')
manifest_url = self._search_regex(r'"contentUrl"\s*:\s*"((?:\\"|[^"])+)', webpage, 'manifest_url')
manifest_url = urljoin(url, manifest_url)
formats = []
if manifest_url and determine_ext(manifest_url) == 'm3u8':
formats.extend(self._extract_m3u8_formats(
manifest_url, video_id, 'mp4',
entry_protocol='m3u8_native', m3u8_id='m3u8'))
self._sort_formats(formats)
return {
'id': video_id,
'title': title,
'thumbnail': thumbnail,
'formats': formats,
}