mirror of
https://github.com/l1ving/youtube-dl
synced 2020-11-18 19:53:54 -08:00
[knesset_gov_il] Add extractor for knesset.gov.il (Israeli parliament) committee discussions
This commit is contained in:
parent
75294a5ed0
commit
fe8170184b
@ -511,6 +511,7 @@ from .kickstarter import KickStarterIE
|
|||||||
from .kinja import KinjaEmbedIE
|
from .kinja import KinjaEmbedIE
|
||||||
from .kinopoisk import KinoPoiskIE
|
from .kinopoisk import KinoPoiskIE
|
||||||
from .konserthusetplay import KonserthusetPlayIE
|
from .konserthusetplay import KonserthusetPlayIE
|
||||||
|
from .knesset_gov_il import KnessetGovIlIE
|
||||||
from .krasview import KrasViewIE
|
from .krasview import KrasViewIE
|
||||||
from .ku6 import Ku6IE
|
from .ku6 import Ku6IE
|
||||||
from .kusi import KUSIIE
|
from .kusi import KUSIIE
|
||||||
|
46
youtube_dl/extractor/knesset_gov_il.py
Normal file
46
youtube_dl/extractor/knesset_gov_il.py
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import unescapeHTML, ExtractorError
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
class KnessetGovIlIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https://main\.knesset\.gov\.il/Activity/committees/(?P<committee>[^/]+)/Pages/CommitteeTVarchive\.aspx\?TopicID=(?P<topicid>[0-9]+)'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'https://main.knesset.gov.il/Activity/committees/CoronaVirus/Pages/CommitteeTVarchive.aspx?TopicID=19932',
|
||||||
|
'only_matching': True
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
m = re.match(self._VALID_URL, url)
|
||||||
|
video_id = '-'.join(m.groups())
|
||||||
|
|
||||||
|
self._download_webpage(url, video_id, note='Getting cookie')
|
||||||
|
webpage = self._download_webpage(
|
||||||
|
url,
|
||||||
|
video_id,
|
||||||
|
headers=self._get_cookies(url)
|
||||||
|
)
|
||||||
|
|
||||||
|
m = re.search(
|
||||||
|
r"SetAzurePlayerFileName\(\'(?P<mpd>[^']+)\',\s*\'(?P<title>[^']+)\',\s*\'(?P<date>[^']+)\'",
|
||||||
|
webpage
|
||||||
|
)
|
||||||
|
if not m:
|
||||||
|
raise ExtractorError('Video not found at url')
|
||||||
|
|
||||||
|
data = m.groupdict()
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': unescapeHTML(data['title']).strip(),
|
||||||
|
'description': unescapeHTML(data['date']).strip(),
|
||||||
|
'formats': self._extract_mpd_formats(
|
||||||
|
unescapeHTML(data['mpd']),
|
||||||
|
video_id,
|
||||||
|
'dash'
|
||||||
|
)
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user