[vimeo] Better formatting for regexp
authorPhilipp Hagemeister <phihag@phihag.de>
Sun, 22 Dec 2013 02:17:56 +0000 (03:17 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Sun, 22 Dec 2013 02:21:28 +0000 (03:21 +0100)
youtube_dl/extractor/vimeo.py

index ea440952898a15f24019ba421c9efbe810ff1fec..4e8fef1655cf553e602d0719a2e42f61e9d77ac2 100644 (file)
@@ -16,11 +16,20 @@ from ..utils import (
     unsmuggle_url,
 )
 
+
 class VimeoIE(InfoExtractor):
     """Information extractor for vimeo.com."""
 
     # _VALID_URL matches Vimeo URLs
-    _VALID_URL = r'(?P<proto>https?://)?(?:(?:www|(?P<player>player))\.)?vimeo(?P<pro>pro)?\.com/(?:.*?/)?(?P<direct_link>play_redirect_hls\?clip_id=)?(?:videos?/)?(?P<id>[0-9]+)/?(?:[?].*)?(?:#.*)?$'
+    _VALID_URL = r'''(?x)
+        (?P<proto>https?://)?
+        (?:(?:www|(?P<player>player))\.)?
+        vimeo(?P<pro>pro)?\.com/
+        (?:.*?/)?
+        (?P<direct_link>play_redirect_hls\?clip_id=)?
+        (?:videos?/)?
+        (?P<id>[0-9]+)
+        /?(?:[?].*)?(?:[#].*)?$'''
     _NETRC_MACHINE = 'vimeo'
     IE_NAME = u'vimeo'
     _TESTS = [