ojuso-map/apps/map/validators.py

6 lines
200 B
Python

from django.core.validators import RegexValidator
class YoutubeURLValidator(RegexValidator):
regex = r'https?:\/\/(((www.)?youtube.com\/((watch\?v=)|(watch\/)))|(youtu.be\/))([A-z0-9]{1,11}).+'