[twitch] Handle new /videos URLs (closes #24263)
Twitch URLs on the path /videos have changed e.g. from /videos/highlights to /videos?filter=highlights. I have added support for the new URLs. The old URLs now redirect to the base videos page, so I have removed support for them.
This commit is contained in:
parent
c97f5e934f
commit
27895ec658
@ -438,76 +438,76 @@ class TwitchVideosBaseIE(TwitchPlaylistBaseIE):
|
|||||||
|
|
||||||
class TwitchAllVideosIE(TwitchVideosBaseIE):
|
class TwitchAllVideosIE(TwitchVideosBaseIE):
|
||||||
IE_NAME = 'twitch:videos:all'
|
IE_NAME = 'twitch:videos:all'
|
||||||
_VALID_URL = r'%s/all' % TwitchVideosBaseIE._VALID_URL_VIDEOS_BASE
|
_VALID_URL = r'%s\?filter=all' % TwitchVideosBaseIE._VALID_URL_VIDEOS_BASE
|
||||||
_PLAYLIST_PATH = TwitchVideosBaseIE._PLAYLIST_PATH + 'archive,upload,highlight'
|
_PLAYLIST_PATH = TwitchVideosBaseIE._PLAYLIST_PATH + 'archive,upload,highlight'
|
||||||
_PLAYLIST_TYPE = 'all videos'
|
_PLAYLIST_TYPE = 'all videos'
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://www.twitch.tv/spamfish/videos/all',
|
'url': 'https://www.twitch.tv/spamfish/videos?filter=all&sort=time',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'spamfish',
|
'id': 'spamfish',
|
||||||
'title': 'Spamfish',
|
'title': 'Spamfish',
|
||||||
},
|
},
|
||||||
'playlist_mincount': 869,
|
'playlist_mincount': 893,
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://m.twitch.tv/spamfish/videos/all',
|
'url': 'https://m.twitch.tv/spamfish/videos?filter=all&sort=time',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
|
||||||
class TwitchUploadsIE(TwitchVideosBaseIE):
|
class TwitchUploadsIE(TwitchVideosBaseIE):
|
||||||
IE_NAME = 'twitch:videos:uploads'
|
IE_NAME = 'twitch:videos:uploads'
|
||||||
_VALID_URL = r'%s/uploads' % TwitchVideosBaseIE._VALID_URL_VIDEOS_BASE
|
_VALID_URL = r'%s\?filter=uploads' % TwitchVideosBaseIE._VALID_URL_VIDEOS_BASE
|
||||||
_PLAYLIST_PATH = TwitchVideosBaseIE._PLAYLIST_PATH + 'upload'
|
_PLAYLIST_PATH = TwitchVideosBaseIE._PLAYLIST_PATH + 'upload'
|
||||||
_PLAYLIST_TYPE = 'uploads'
|
_PLAYLIST_TYPE = 'uploads'
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://www.twitch.tv/spamfish/videos/uploads',
|
'url': 'https://www.twitch.tv/spamfish/videos?filter=uploads&sort=time',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'spamfish',
|
'id': 'spamfish',
|
||||||
'title': 'Spamfish',
|
'title': 'Spamfish',
|
||||||
},
|
},
|
||||||
'playlist_mincount': 0,
|
'playlist_mincount': 0,
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://m.twitch.tv/spamfish/videos/uploads',
|
'url': 'https://m.twitch.tv/spamfish/videos?filter=uploads&sort=time',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
|
||||||
class TwitchPastBroadcastsIE(TwitchVideosBaseIE):
|
class TwitchPastBroadcastsIE(TwitchVideosBaseIE):
|
||||||
IE_NAME = 'twitch:videos:past-broadcasts'
|
IE_NAME = 'twitch:videos:past-broadcasts'
|
||||||
_VALID_URL = r'%s/past-broadcasts' % TwitchVideosBaseIE._VALID_URL_VIDEOS_BASE
|
_VALID_URL = r'%s\?filter=archives' % TwitchVideosBaseIE._VALID_URL_VIDEOS_BASE
|
||||||
_PLAYLIST_PATH = TwitchVideosBaseIE._PLAYLIST_PATH + 'archive'
|
_PLAYLIST_PATH = TwitchVideosBaseIE._PLAYLIST_PATH + 'archive'
|
||||||
_PLAYLIST_TYPE = 'past broadcasts'
|
_PLAYLIST_TYPE = 'past broadcasts'
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://www.twitch.tv/spamfish/videos/past-broadcasts',
|
'url': 'https://www.twitch.tv/spamfish/videos?filter=archives&sort=time',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'spamfish',
|
'id': 'spamfish',
|
||||||
'title': 'Spamfish',
|
'title': 'Spamfish',
|
||||||
},
|
},
|
||||||
'playlist_mincount': 0,
|
'playlist_mincount': 25,
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://m.twitch.tv/spamfish/videos/past-broadcasts',
|
'url': 'https://m.twitch.tv/spamfish/videos?filter=archives&sort=time',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
|
||||||
class TwitchHighlightsIE(TwitchVideosBaseIE):
|
class TwitchHighlightsIE(TwitchVideosBaseIE):
|
||||||
IE_NAME = 'twitch:videos:highlights'
|
IE_NAME = 'twitch:videos:highlights'
|
||||||
_VALID_URL = r'%s/highlights' % TwitchVideosBaseIE._VALID_URL_VIDEOS_BASE
|
_VALID_URL = r'%s\?filter=highlights' % TwitchVideosBaseIE._VALID_URL_VIDEOS_BASE
|
||||||
_PLAYLIST_PATH = TwitchVideosBaseIE._PLAYLIST_PATH + 'highlight'
|
_PLAYLIST_PATH = TwitchVideosBaseIE._PLAYLIST_PATH + 'highlight'
|
||||||
_PLAYLIST_TYPE = 'highlights'
|
_PLAYLIST_TYPE = 'highlights'
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://www.twitch.tv/spamfish/videos/highlights',
|
'url': 'https://www.twitch.tv/spamfish/videos?filter=highlights&sort=time',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'spamfish',
|
'id': 'spamfish',
|
||||||
'title': 'Spamfish',
|
'title': 'Spamfish',
|
||||||
},
|
},
|
||||||
'playlist_mincount': 805,
|
'playlist_mincount': 867,
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://m.twitch.tv/spamfish/videos/highlights',
|
'url': 'https://m.twitch.tv/spamfish/videos?filter=highlights&sort=time',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user