Parse t.me/@<user> URLs as valid usernames

This commit is contained in:
Lonami 2019-09-16 11:36:35 +02:00 committed by GitHub
parent c1774276c2
commit 75ca28df49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,7 +50,7 @@ mimetypes.add_type('audio/ogg', '.ogg')
mimetypes.add_type('audio/flac', '.flac') mimetypes.add_type('audio/flac', '.flac')
USERNAME_RE = re.compile( USERNAME_RE = re.compile(
r'@|(?:https?://)?(?:www\.)?(?:telegram\.(?:me|dog)|t\.me)/(joinchat/)?' r'@|(?:https?://)?(?:www\.)?(?:telegram\.(?:me|dog)|t\.me)/(@|joinchat/)?'
) )
TG_JOIN_RE = re.compile( TG_JOIN_RE = re.compile(
r'tg://(join)\?invite=' r'tg://(join)\?invite='