Sfoglia il codice sorgente

[twitch:stream] Improve _VALID_URL (Closes #6294)

Sergey M․ 10 anni fa
parent
commit
faa1f83ab4
1 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  1. 6 3
      youtube_dl/extractor/twitch.py

+ 6 - 3
youtube_dl/extractor/twitch.py

@@ -310,9 +310,9 @@ class TwitchBookmarksIE(TwitchPlaylistBaseIE):
 
 
 class TwitchStreamIE(TwitchBaseIE):
 class TwitchStreamIE(TwitchBaseIE):
     IE_NAME = 'twitch:stream'
     IE_NAME = 'twitch:stream'
-    _VALID_URL = r'%s/(?P<id>[^/]+)/?(?:\#.*)?$' % TwitchBaseIE._VALID_URL_BASE
+    _VALID_URL = r'%s/(?P<id>[^/#?]+)/?(?:\#.*)?$' % TwitchBaseIE._VALID_URL_BASE
 
 
-    _TEST = {
+    _TESTS = [{
         'url': 'http://www.twitch.tv/shroomztv',
         'url': 'http://www.twitch.tv/shroomztv',
         'info_dict': {
         'info_dict': {
             'id': '12772022048',
             'id': '12772022048',
@@ -331,7 +331,10 @@ class TwitchStreamIE(TwitchBaseIE):
             # m3u8 download
             # m3u8 download
             'skip_download': True,
             'skip_download': True,
         },
         },
-    }
+    }, {
+        'url': 'http://www.twitch.tv/miracle_doto#profile-0',
+        'only_matching': True,
+    }]
 
 
     def _real_extract(self, url):
     def _real_extract(self, url):
         channel_id = self._match_id(url)
         channel_id = self._match_id(url)