Merge pull request #5985 from zx8/master
authorSergey M. <dstftw@gmail.com>
Mon, 15 Jun 2015 15:31:47 +0000 (20:31 +0500)
committerSergey M. <dstftw@gmail.com>
Mon, 15 Jun 2015 15:31:47 +0000 (20:31 +0500)
[safari] make url regex more lenient

youtube_dl/extractor/safari.py

index 10251f29e033ef241618ed7985e214dc0e76cd51..20ba6fa336738ab635fa290370948ed0eff2f8b9 100644 (file)
@@ -83,7 +83,7 @@ class SafariIE(SafariBaseIE):
                                     library/view/[^/]+|
                                     api/v1/book
                                 )/
-                                (?P<course_id>\d+)/
+                                (?P<course_id>[^/]+)/
                                     (?:chapter(?:-content)?/)?
                                 (?P<part>part\d+)\.html
     '''
@@ -122,7 +122,7 @@ class SafariCourseIE(SafariBaseIE):
     IE_NAME = 'safari:course'
     IE_DESC = 'safaribooksonline.com online courses'
 
-    _VALID_URL = r'https?://(?:www\.)?safaribooksonline\.com/(?:library/view/[^/]+|api/v1/book)/(?P<id>\d+)/?(?:[#?]|$)'
+    _VALID_URL = r'https?://(?:www\.)?safaribooksonline\.com/(?:library/view/[^/]+|api/v1/book)/(?P<id>[^/]+)/?(?:[#?]|$)'
 
     _TESTS = [{
         'url': 'https://www.safaribooksonline.com/library/view/hadoop-fundamentals-livelessons/9780133392838/',