Last active
December 26, 2020 21:41
-
-
Save muhammedfurkan/b479f16721514025a36b09b56e18f750 to your computer and use it in GitHub Desktop.
youtube playlist checker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def youtube_url_validation(url): | |
youtube_regex = (r'(https?://)?(www\.)?(youtube|youtu|youtube-nocookie)\.(com|be)/(playlist\?list=|embed/|v/|.\?)') | |
youtube_regex_match = re.match(youtube_regex, url) | |
if youtube_regex_match: | |
return "success" | |
return "error" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment