Update tokfm.py

In 25 line server require text data not json
This commit is contained in:
kopalniadolow 2017-09-09 15:16:10 +02:00 committed by GitHub
parent 5e5a835962
commit 137ad3763b
1 changed files with 2 additions and 3 deletions

View File

@ -20,7 +20,6 @@ class TOKFMIE(InfoExtractor):
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, video_id)
# TODO more code goes here, for example ...
title = self._html_search_regex(r'<h1>(.+?)</h1>', webpage, 'title') title = self._html_search_regex(r'<h1>(.+?)</h1>', webpage, 'title')
description = self._html_search_regex(r'<div class=content>(.+?)</div>', webpage, None) 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) js = self._download_json('http://audycje.tokfm.pl/gets', video_id, data='{"pid": %s, "st": "tokfm"}' % video_id)
@ -28,6 +27,6 @@ class TOKFMIE(InfoExtractor):
'id': video_id, 'id': video_id,
'title': title, 'title': title,
'description': description, 'description': description,
'url': js['url'] 'url': js['url'],
# TODO more properties (see youtube_dl/extractor/common.py) 'ext': 'mp3'
} }