]> git.bitcoin.ninja Git - youtube-dl/commitdiff
Merge pull request #5076 from Ftornik/Lynda-subtitles-hotfix
authorSergey M. <dstftw@gmail.com>
Fri, 27 Feb 2015 14:56:54 +0000 (20:56 +0600)
committerSergey M. <dstftw@gmail.com>
Fri, 27 Feb 2015 14:56:54 +0000 (20:56 +0600)
[lynda] Fixed subtitles broken file

youtube_dl/extractor/lynda.py
youtube_dl/extractor/rtve.py

index 8bb21ee1d710d8ecd2b942e29a64fc57d07fde76..bfd9b73d250c0b90c50a5579d0e5283471e381c1 100644 (file)
@@ -18,7 +18,7 @@ from ..utils import (
 class LyndaIE(InfoExtractor):
     IE_NAME = 'lynda'
     IE_DESC = 'lynda.com videos'
-    _VALID_URL = r'https?://www\.lynda\.com/[^/]+/[^/]+/\d+/(\d+)-\d\.html'
+    _VALID_URL = r'https?://www\.lynda\.com/(?:[^/]+/[^/]+/\d+|player/embed)/(\d+)'
     _LOGIN_URL = 'https://www.lynda.com/login/login.aspx'
     _NETRC_MACHINE = 'lynda'
 
@@ -27,7 +27,7 @@ class LyndaIE(InfoExtractor):
 
     ACCOUNT_CREDENTIALS_HINT = 'Use --username and --password options to provide lynda.com account credentials.'
 
-    _TEST = {
+    _TESTS = [{
         'url': 'http://www.lynda.com/Bootstrap-tutorials/Using-exercise-files/110885/114408-4.html',
         'md5': 'ecfc6862da89489161fb9cd5f5a6fac1',
         'info_dict': {
@@ -36,7 +36,10 @@ class LyndaIE(InfoExtractor):
             'title': 'Using the exercise files',
             'duration': 68
         }
-    }
+    }, {
+        'url': 'https://www.lynda.com/player/embed/133770?tr=foo=1;bar=g;fizz=rt&fs=0',
+        'only_matching': True,
+    }]
 
     def _real_initialize(self):
         self._login()
index c0fd23ff108f8b523a0e71f458147287954f429c..b42442d127c13e69fc81cb27e71cf117d2cb96b2 100644 (file)
@@ -8,8 +8,9 @@ import time
 from .common import InfoExtractor
 from ..compat import compat_urlparse
 from ..utils import (
-    struct_unpack,
+    float_or_none,
     remove_end,
+    struct_unpack,
 )
 
 
@@ -67,6 +68,7 @@ class RTVEALaCartaIE(InfoExtractor):
             'id': '2491869',
             'ext': 'mp4',
             'title': 'Balonmano - Swiss Cup masculina. Final: EspaƱa-Suecia',
+            'duration': 5024.566,
         },
     }, {
         'note': 'Live stream',
@@ -113,6 +115,7 @@ class RTVEALaCartaIE(InfoExtractor):
             'thumbnail': info.get('image'),
             'page_url': url,
             'subtitles': subtitles,
+            'duration': float_or_none(info.get('duration'), scale=1000),
         }
 
     def _get_subtitles(self, video_id, sub_file):