summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-01-21 02:15:28 +0600
committerSergey M․ <dstftw@gmail.com>2015-01-21 02:15:28 +0600
commit564bb5e964fc263012784baa579a10eee822a436 (patch)
tree236e484c868c6ba4112e8051932c21edb6b471d8
parent2df54b4ba81a2615d8f5a9016061eed389ba5b6e (diff)
downloadyoutube-dl-564bb5e964fc263012784baa579a10eee822a436.tar.gz
youtube-dl-564bb5e964fc263012784baa579a10eee822a436.tar.xz
youtube-dl-564bb5e964fc263012784baa579a10eee822a436.zip
[tinypic] Tweak VALID_URL regex (Closes #4754)
-rw-r--r--youtube_dl/extractor/tinypic.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/youtube_dl/extractor/tinypic.py b/youtube_dl/extractor/tinypic.py
index 4fe89dbe5..e036b8cdf 100644
--- a/youtube_dl/extractor/tinypic.py
+++ b/youtube_dl/extractor/tinypic.py
@@ -9,17 +9,23 @@ from ..utils import ExtractorError
 class TinyPicIE(InfoExtractor):
     IE_NAME = 'tinypic'
     IE_DESC = 'tinypic.com videos'
-    _VALID_URL = r'http://tinypic\.com/player\.php\?v=(?P<id>[^&]+)&s=\d+'
-
-    _TEST = {
-        'url': 'http://tinypic.com/player.php?v=6xw7tc%3E&s=5#.UtqZmbRFCM8',
-        'md5': '609b74432465364e72727ebc6203f044',
-        'info_dict': {
-            'id': '6xw7tc',
-            'ext': 'flv',
-            'title': 'shadow phenomenon weird',
+    _VALID_URL = r'http://(?:.+?\.)?tinypic\.com/player\.php\?v=(?P<id>[^&]+)&s=\d+'
+
+    _TESTS = [
+        {
+            'url': 'http://tinypic.com/player.php?v=6xw7tc%3E&s=5#.UtqZmbRFCM8',
+            'md5': '609b74432465364e72727ebc6203f044',
+            'info_dict': {
+                'id': '6xw7tc',
+                'ext': 'flv',
+                'title': 'shadow phenomenon weird',
+            },
+        },
+        {
+            'url': 'http://de.tinypic.com/player.php?v=dy90yh&s=8',
+            'only_matching': True,
         }
-    }
+    ]
 
     def _real_extract(self, url):
         mobj = re.match(self._VALID_URL, url)