mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-22 16:44:32 +01:00
[TOKFM] Add new extractor
This commit is contained in:
parent
5113b69124
commit
5e5a835962
@ -1048,6 +1048,7 @@ from .tnaflix import (
|
||||
MovieFapIE,
|
||||
)
|
||||
from .toggle import ToggleIE
|
||||
from .tokfm import TOKFMIE
|
||||
from .tonline import TOnlineIE
|
||||
from .toongoggles import ToonGogglesIE
|
||||
from .toutv import TouTvIE
|
||||
|
33
youtube_dl/extractor/tokfm.py
Normal file
33
youtube_dl/extractor/tokfm.py
Normal file
@ -0,0 +1,33 @@
|
||||
# coding: utf-8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
|
||||
|
||||
class TOKFMIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://audycje\.tokfm\.pl/podcast/[^/]+/(?P<id>[0-9]+)'
|
||||
_TEST = {
|
||||
'url': 'http://audycje.tokfm.pl/podcast/Dr-Irena-Ozog-dr-Boguslaw-Grabowski-i-prof-Michal-Brzezinski/52972',
|
||||
'md5': '2047ca2976c616d18f8618946b62c3ed',
|
||||
'info_dict': {
|
||||
'id': '52972',
|
||||
'ext': 'mp3',
|
||||
'title': 'Dr Irena Ożóg, dr Bogusław Grabowski i prof. Michał Brzeziński',
|
||||
'description': 'Czy wróciły inwestycje? Jakie perspektywy dla wzrostu PKB?'
|
||||
}
|
||||
}
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
# TODO more code goes here, for example ...
|
||||
title = self._html_search_regex(r'<h1>(.+?)</h1>', webpage, 'title')
|
||||
description = self._html_search_regex(r'<div class=content>(.+?)</div>', webpage, None)
|
||||
js = self._download_json('http://audycje.tokfm.pl/gets', video_id, data='{"pid": %s, "st": "tokfm"}' % video_id)
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': title,
|
||||
'description': description,
|
||||
'url': js['url']
|
||||
# TODO more properties (see youtube_dl/extractor/common.py)
|
||||
}
|
Loading…
Reference in New Issue
Block a user