Browse Source

[twitch] Only match digits for the video id

Urls can also contain contain a query (for example a timestamp '?t=foo')
totalwebcasting
Jaime Marquínez Ferrándiz 10 years ago
parent
commit
93f787070f
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      youtube_dl/extractor/twitch.py

+ 3
- 3
youtube_dl/extractor/twitch.py View File

@ -149,7 +149,7 @@ class TwitchItemBaseIE(TwitchBaseIE):
class TwitchVideoIE(TwitchItemBaseIE): class TwitchVideoIE(TwitchItemBaseIE):
IE_NAME = 'twitch:video' IE_NAME = 'twitch:video'
_VALID_URL = r'%s/[^/]+/b/(?P<id>[^/]+)' % TwitchBaseIE._VALID_URL_BASE
_VALID_URL = r'%s/[^/]+/b/(?P<id>\d+)' % TwitchBaseIE._VALID_URL_BASE
_ITEM_TYPE = 'video' _ITEM_TYPE = 'video'
_ITEM_SHORTCUT = 'a' _ITEM_SHORTCUT = 'a'
@ -165,7 +165,7 @@ class TwitchVideoIE(TwitchItemBaseIE):
class TwitchChapterIE(TwitchItemBaseIE): class TwitchChapterIE(TwitchItemBaseIE):
IE_NAME = 'twitch:chapter' IE_NAME = 'twitch:chapter'
_VALID_URL = r'%s/[^/]+/c/(?P<id>[^/]+)' % TwitchBaseIE._VALID_URL_BASE
_VALID_URL = r'%s/[^/]+/c/(?P<id>\d+)' % TwitchBaseIE._VALID_URL_BASE
_ITEM_TYPE = 'chapter' _ITEM_TYPE = 'chapter'
_ITEM_SHORTCUT = 'c' _ITEM_SHORTCUT = 'c'
@ -184,7 +184,7 @@ class TwitchChapterIE(TwitchItemBaseIE):
class TwitchVodIE(TwitchItemBaseIE): class TwitchVodIE(TwitchItemBaseIE):
IE_NAME = 'twitch:vod' IE_NAME = 'twitch:vod'
_VALID_URL = r'%s/[^/]+/v/(?P<id>[^/]+)' % TwitchBaseIE._VALID_URL_BASE
_VALID_URL = r'%s/[^/]+/v/(?P<id>\d+)' % TwitchBaseIE._VALID_URL_BASE
_ITEM_TYPE = 'vod' _ITEM_TYPE = 'vod'
_ITEM_SHORTCUT = 'v' _ITEM_SHORTCUT = 'v'


Loading…
Cancel
Save