Created
May 11, 2022 16:11
-
-
Save sethwololo/5f92144552a1ce2ceaf174f360d7c4e4 to your computer and use it in GitHub Desktop.
Verify YouTube video existence with Python
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 requests | |
def validateYoutube(self, youtube_id): | |
response = requests.head('https://img.youtube.com/vi/' + youtube_id + '/mqdefault.jpg') | |
if response.status_code == 200: | |
return True | |
else: | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment