support youtube channels without vanity URLs, resolves #6
This commit is contained in:
@@ -35,6 +35,9 @@ class FrontEndTestCase(TestCase):
|
||||
'valid': (
|
||||
'https://www.youtube.com/testchannel',
|
||||
'https://www.youtube.com/c/testchannel',
|
||||
'https://www.youtube.com/c/testchannel/videos',
|
||||
'https://www.youtube.com/channel/testchannel',
|
||||
'https://www.youtube.com/channel/testchannel/videos',
|
||||
),
|
||||
'invalid_schema': (
|
||||
'http://www.youtube.com/c/playlist',
|
||||
|
||||
@@ -157,7 +157,7 @@ class ValidateSourceView(FormView):
|
||||
Source.SOURCE_TYPE_YOUTUBE_CHANNEL: {
|
||||
'scheme': 'https',
|
||||
'domain': 'www.youtube.com',
|
||||
'path_regex': '^\/(c\/)?([^\/]+)$',
|
||||
'path_regex': '^\/(c\/|channel\/)?([^\/]+)(\/videos)?$',
|
||||
'path_must_not_match': ('/playlist', '/c/playlist'),
|
||||
'qs_args': [],
|
||||
'extract_key': ('path_regex', 1),
|
||||
|
||||
Reference in New Issue
Block a user