Created
September 28, 2017 02:01
-
-
Save harej/30f71eacac7654c0b4bb4183e120ea33 to your computer and use it in GitHub Desktop.
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 random | |
import requests | |
from time import sleep | |
while True: | |
random_id = ''.join(random.choices('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_', k=11)) | |
url = 'https://www.youtube.com/watch?v=' + random_id | |
r = requests.get(url) | |
if r.text.find('This video is unavailable') == -1: | |
print(url) | |
break | |
sleep(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment