support youtube channels without vanity URLs, resolves #6
This commit is contained in:
parent
c1c39d9e17
commit
ffe0049bab
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue