Browse Source

Merge branch 'teletask' of https://github.com/MaxReimann/youtube-dl into MaxReimann-teletask

master
Sergey M․ 10 years ago
parent
commit
2b8f151094
2 changed files with 68 additions and 0 deletions
  1. 1
      youtube_dl/extractor/__init__.py
  2. 67
      youtube_dl/extractor/teletask.py

1
youtube_dl/extractor/__init__.py

@ -406,6 +406,7 @@ from .ted import TEDIE
from .telebruxelles import TeleBruxellesIE from .telebruxelles import TeleBruxellesIE
from .telecinco import TelecincoIE from .telecinco import TelecincoIE
from .telemb import TeleMBIE from .telemb import TeleMBIE
from .teletask import TeleTaskIE
from .tenplay import TenPlayIE from .tenplay import TenPlayIE
from .testurl import TestURLIE from .testurl import TestURLIE
from .tf1 import TF1IE from .tf1 import TF1IE

67
youtube_dl/extractor/teletask.py

@ -0,0 +1,67 @@
# coding: utf-8
from __future__ import unicode_literals
import re
import datetime
from .common import InfoExtractor
class TeleTaskIE(InfoExtractor):
_VALID_URL = r'http?://(?:www\.)?tele-task\.de/archive/video/html5/(?P<id>[0-9]+)/'
_TEST = {
'url': 'http://www.tele-task.de/archive/video/html5/26168/',
'info_dict': {
'title': 'Duplicate Detection',
},
'playlist': [{
'md5': '290ef69fb2792e481169c3958dbfbd57',
'info_dict': {
'title': 'Duplicate Detection',
'upload_date': '20141218',
'id': 'speaker_26168',
'ext': 'mp4',
}
},
{
'md5': 'e1e7218c5f0e4790015a437fcf6c71b4',
'info_dict': {
'title': 'Duplicate Detection',
'upload_date': '20141218',
'id': 'slides_26168',
'ext': 'mp4',
}
}]
}
def _real_extract(self, url):
lecture_id = self._match_id(url)
webpage = self._download_webpage(url, lecture_id)
title = self._html_search_regex(
r'itemprop="name">([^"]+)</a>', webpage, 'title')
url_speaker = self._html_search_regex(
r'class="speaker".*?src="([^"]+)"', webpage, 'video_url_speaker', flags=re.DOTALL)
url_slides = self._html_search_regex(
r'class="slides".*?src="([^"]+)"', webpage, 'video_url_slides', flags=re.DOTALL)
date = self._html_search_regex(
r'<td class="label">Date:</td><td>([^"]+)</td>', webpage, 'date')
date = datetime.datetime.strptime(date, '%d.%m.%Y').strftime('%Y%m%d')
entries = [{
'title': title,
'upload_date': date,
'id': "speaker_"+lecture_id,
'url': url_speaker,
},
{
'title': title,
'upload_date': date,
'id': "slides_"+lecture_id,
'url': url_slides}]
return {
'_type': "playlist",
'id': lecture_id,
'title': title,
'entries': entries,
}
Loading…
Cancel
Save