aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2016-09-06 15:48:51 +0100
committerRemita Amine <remitamine@gmail.com>2016-09-06 15:56:17 +0100
commitc33c962adf656fc482bdad2dd8452065512027a9 (patch)
tree9c993af4d684defee656f36139ea902702d07b82 /youtube_dl/extractor
parentbdcc046d12f853d1096d226923fceb18a904786c (diff)
[trutv] Add new extractor(#10519)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/extractors.py1
-rw-r--r--youtube_dl/extractor/trutv.py35
2 files changed, 36 insertions, 0 deletions
diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py
index dbd5fa965..f72faa8a7 100644
--- a/youtube_dl/extractor/extractors.py
+++ b/youtube_dl/extractor/extractors.py
@@ -890,6 +890,7 @@ from .toypics import ToypicsUserIE, ToypicsIE
from .traileraddict import TrailerAddictIE
from .trilulilu import TriluliluIE
from .trollvids import TrollvidsIE
+from .trutv import TruTVIE
from .tube8 import Tube8IE
from .tubitv import TubiTvIE
from .tudou import (
diff --git a/youtube_dl/extractor/trutv.py b/youtube_dl/extractor/trutv.py
new file mode 100644
index 000000000..e60d8a181
--- /dev/null
+++ b/youtube_dl/extractor/trutv.py
@@ -0,0 +1,35 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .turner import TurnerBaseIE
+
+
+class TruTVIE(TurnerBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?trutv\.com(?:(?P<path>/shows/[^/]+/videos/[^/?#]+?)\.html|/full-episodes/[^/]+/(?P<id>\d+))'
+ _TEST = {
+ 'url': 'http://www.trutv.com/shows/10-things/videos/you-wont-believe-these-sports-bets.html',
+ 'md5': '2cdc844f317579fed1a7251b087ff417',
+ 'info_dict': {
+ 'id': '/shows/10-things/videos/you-wont-believe-these-sports-bets',
+ 'ext': 'mp4',
+ 'title': 'You Won\'t Believe These Sports Bets',
+ 'description': 'Jamie Lee sits down with a bookie to discuss the bizarre world of illegal sports betting.',
+ 'upload_date': '20130305',
+ }
+ }
+
+ def _real_extract(self, url):
+ path, video_id = re.match(self._VALID_URL, url).groups()
+ if path:
+ data_src = 'http://www.trutv.com/video/cvp/v2/xml/content.xml?id=%s.xml' % path
+ else:
+ data_src = 'http://www.trutv.com/tveverywhere/services/cvpXML.do?titleId=' + video_id
+ return self._extract_cvp_info(
+ data_src, path, {
+ 'secure': {
+ 'media_src': 'http://androidhls-secure.cdn.turner.com/trutv/big',
+ 'tokenizer_src': 'http://www.trutv.com/tveverywhere/processors/services/token_ipadAdobe.do',
+ },
+ })