This repository has been archived by the owner on May 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
YTFuzz_v0.1b_no_options.py
71 lines (63 loc) · 2.04 KB
/
YTFuzz_v0.1b_no_options.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# YTFuzz v0.1b
# Find unlisted/private videos because
# why the fuck not you're bored at 2am
#
# @soymjolk, 2018
from bs4 import BeautifulSoup
import requests
import time
import random
import string
# Here's what a YouTube video's URL looks like: https://www.youtube.com/watch?v=dwk0juwZJk8
# We want to replace everything after the ?v= with random [a-z], [A-Z], [0-9] strings
# BeautifulSoup checks if the Unlisted badge is found on the page
# <span class="style-scope ytd-badge-supported-renderer">Unlisted</span>
# If the Unlisted badge is found, URL is printed to terminal
# If the Unlisted badge is NOT found, skip it and move on
# TODO: make it work
# add option support
# that's about it honestly
### ./ytfuzz.py -h OR ./ytfuzz.py --help ###
# ytfuzz v0.1b by @soymjolk
#
# -h this menu
# -o output to a file (./ytfuzz.py -o dir/out.txt)
# -v verbose (show title, channel, and errors)
# -t show title
# -c show channel
# -r multithread support (./ytfuzz.py -r 4 [four threads])
# -w wait for next request (./ytfuzz.py -w 5 [five seconds])
# -p log public videos as well
inv = "<title>YouTube</title>"
count = 0
invCount = 0
invCountLimit = 50
while True:
gen = ''.join([random.choice(string.ascii_letters + string.digits) for n in range(11)])
# url = "https://www.youtube.com/watch?v=HXNs9N4vj6Y" # - valid
# url = "https://www.youtube.com/watch?v=jfWjEFr5B3" - invalid
url = ("https://www.youtube.com/watch?v=" + gen)
# print(url)
req = requests.get(url)
# req.encoding = 'ISO-8859-1'
txt = req.text
# print(req.encoding)
# print(txt)
# here's where shit gets interesting
# invalid URL has <yt-icon class="style-scope yt-player-error-message-renderer">, valid does not
bstxt = BeautifulSoup(txt, 'html.parser')
t = str(bstxt.title)
count += 1
print(count)
if (t == inv):
invCount += 1
if (invCount == invCountLimit):
print(str(invCountLimit) + " invalid")
invCountLimit += 50
# print("Invalid! Title is: " + t)
elif (t != inv):
print("Valid! Title: " + t + " and URL: " + url)
else:
print("prolly got ip ban'd")
break
# time.sleep(2)