]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[odnoklassniki] Improve _VALID_URL readability
authorSergey M․ <dstftw@gmail.com>
Sun, 8 Apr 2018 15:21:21 +0000 (22:21 +0700)
committerSergey M․ <dstftw@gmail.com>
Sun, 8 Apr 2018 15:21:21 +0000 (22:21 +0700)
youtube_dl/extractor/odnoklassniki.py

index d87d0960fbb4d660c1eb4f7d5266ee5f2ca540d8..190d8af4da373962cc2f1e1366a24e51de0b8b36 100644 (file)
@@ -19,7 +19,18 @@ from ..utils import (
 
 
 class OdnoklassnikiIE(InfoExtractor):
-    _VALID_URL = r'https?://(?:(?:www|m|mobile)\.)?(?:odnoklassniki|ok)\.ru/(?:video(?:embed)?/|web-api/video/moviePlayer/|live/|dk\?.*?st\.mvId=)(?P<id>[\d-]+)'
+    _VALID_URL = r'''(?x)
+                https?://
+                    (?:(?:www|m|mobile)\.)?
+                    (?:odnoklassniki|ok)\.ru/
+                    (?:
+                        video(?:embed)?/|
+                        web-api/video/moviePlayer/|
+                        live/|
+                        dk\?.*?st\.mvId=
+                    )
+                    (?P<id>[\d-]+)
+                '''
     _TESTS = [{
         # metadata in JSON
         'url': 'http://ok.ru/video/20079905452',