mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-10 00:58:17 +02:00
parent
506e261d20
commit
3dc582e5ea
@ -167,6 +167,7 @@
|
|||||||
from .facebook import FacebookIE
|
from .facebook import FacebookIE
|
||||||
from .faz import FazIE
|
from .faz import FazIE
|
||||||
from .fc2 import FC2IE
|
from .fc2 import FC2IE
|
||||||
|
from .fczenit import FczenitIE
|
||||||
from .firstpost import FirstpostIE
|
from .firstpost import FirstpostIE
|
||||||
from .firsttv import FirstTVIE
|
from .firsttv import FirstTVIE
|
||||||
from .fivemin import FiveMinIE
|
from .fivemin import FiveMinIE
|
||||||
|
41
youtube_dl/extractor/fczenit.py
Normal file
41
youtube_dl/extractor/fczenit.py
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
|
class FczenitIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?fc-zenit\.ru/video/gl(?P<id>[0-9]+)'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'http://fc-zenit.ru/video/gl6785/',
|
||||||
|
'md5': '458bacc24549173fe5a5aa29174a5606',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '6785',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': '«Зенит-ТВ»: как Олег Шатов играл против «Урала»',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
|
video_title = self._html_search_regex(r'<div class=\"photoalbum__title\">([^<]+)', webpage, 'title')
|
||||||
|
|
||||||
|
bitrates_raw = self._html_search_regex(r'bitrates:.*\n(.*)\]', webpage, 'video URL')
|
||||||
|
bitrates = re.findall(r'url:.?\'(.+?)\'.*?bitrate:.?([0-9]{3}?)', bitrates_raw)
|
||||||
|
|
||||||
|
formats = [{
|
||||||
|
'url': furl,
|
||||||
|
'tbr': tbr,
|
||||||
|
} for furl, tbr in bitrates]
|
||||||
|
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': video_title,
|
||||||
|
'formats': formats,
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user