]> Raphaƫl G. Git Repositories - youtubedl/blobdiff - youtube_dl/extractor/udemy.py
New upstream version 2016.12.01
[youtubedl] / youtube_dl / extractor / udemy.py
index 89b86955913587c3c09474fdffaab8ad338bb26a..cce29c6e07134c58425f5486b15ce6d9e017d0d7 100644 (file)
@@ -5,6 +5,7 @@ import re
 from .common import InfoExtractor
 from ..compat import (
     compat_HTTPError,
+    compat_str,
     compat_urllib_request,
     compat_urlparse,
 )
@@ -207,7 +208,7 @@ class UdemyIE(InfoExtractor):
             if youtube_url:
                 return self.url_result(youtube_url, 'Youtube')
 
-        video_id = asset['id']
+        video_id = compat_str(asset['id'])
         thumbnail = asset.get('thumbnail_url') or asset.get('thumbnailUrl')
         duration = float_or_none(asset.get('data', {}).get('duration'))
 
@@ -307,7 +308,7 @@ class UdemyIE(InfoExtractor):
 
 class UdemyCourseIE(UdemyIE):
     IE_NAME = 'udemy:course'
-    _VALID_URL = r'https?://www\.udemy\.com/(?P<id>[^/?#&]+)'
+    _VALID_URL = r'https?://(?:www\.)?udemy\.com/(?P<id>[^/?#&]+)'
     _TESTS = []
 
     @classmethod