[nba] Improve _VALID_URL regex (fixes #4387)
authorcryptonaut <cryptonaut64@gmail.com>
Sat, 6 Dec 2014 09:42:58 +0000 (01:42 -0800)
committercryptonaut <cryptonaut64@gmail.com>
Sat, 6 Dec 2014 09:49:22 +0000 (01:49 -0800)
Allows for optional trailing / or /index.html

youtube_dl/extractor/nba.py

index f69fe0925ee4d5d68699f09d84a568ce34f787ec..842ea66a183c6ded8fef0e2807c1f390c0a77d27 100644 (file)
@@ -10,7 +10,7 @@ from ..utils import (
 
 
 class NBAIE(InfoExtractor):
-    _VALID_URL = r'https?://(?:watch\.|www\.)?nba\.com/(?:nba/)?video(?P<id>/[^?]*?)(?:/index\.html)?(?:\?.*)?$'
+    _VALID_URL = r'https?://(?:watch\.|www\.)?nba\.com/(?:nba/)?video(?P<id>/[^?]*?)/?(?:/index\.html)?(?:\?.*)?$'
     _TEST = {
         'url': 'http://www.nba.com/video/games/nets/2012/12/04/0021200253-okc-bkn-recap.nba/index.html',
         'md5': 'c0edcfc37607344e2ff8f13c378c88a4',