main
David 2022-03-31 02:14:56 +02:00
parent 2e4595e561
commit 226708d9c5
7 changed files with 18 additions and 18 deletions

2
.gitignore vendored
View File

@ -129,4 +129,4 @@ dmypy.json
.pyre/
.old/*
results/*
responses/*

View File

@ -1,7 +1,4 @@
from email import charset
import mimetypes
from os import listdir
from urllib import response
import os
import json
markdown = ""
@ -10,7 +7,10 @@ markdown += "|-------------|----------------|-----------------|----------|\n"
txt_output = ""
files = listdir('results')
if not os.path.exists('results'):
os.makedirs('results')
files = os.listdir('responses')
client_ids = []
@ -26,7 +26,7 @@ for client_id in client_ids:
client_files.sort(reverse=True) # highest version first
for client_file in client_files:
response_data_raw = open('results/' + client_file, 'r', encoding='utf-8').read()
response_data_raw = open('responses/' + client_file, 'r', encoding='utf-8').read()
response_data = json.loads(response_data_raw)
client_name = None
@ -73,10 +73,10 @@ for client_id in client_ids:
break
f = open("working_clients.md", "w")
f = open("results/working_clients.md", "w")
f.write(markdown)
f.close()
f = open("working_clients.txt", "w")
f = open("results/working_clients.txt", "w")
f.write(txt_output)
f.close()

View File

@ -1,8 +1,8 @@
import requests
import os
client_versions = open("client_versions.txt", "r").readlines()
data_template = open("post_data.txt", "r").read()
client_versions = open("payloads/client_versions.txt", "r").readlines()
data_template = open("payloads/post_data.txt", "r").read()
headers = {
"Origin": "https://www.youtube.com",
@ -11,11 +11,11 @@ headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.52"
}
if not os.path.exists('results'):
os.makedirs('resuls')
if not os.path.exists('responses'):
os.makedirs('responses')
for client_name_id in range(0, 100):
for client_name_id in range(1, 100):
for client_version in client_versions:
client_version = client_version.replace("\n", "").replace("\r", "")
if client_version == "":
@ -23,17 +23,17 @@ for client_name_id in range(0, 100):
try_id = str(client_name_id) + "_" + client_version
print(try_id)
print("Try ClientId: " + str(client_name_id) + " ClientVersion: " + str(client_version))
data = data_template.replace('%clientName%', str(client_name_id)).replace('%clientVersion%', client_version)
try:
response = requests.post("https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", data=data, headers=headers, timeout=5)
print(response.status_code)
print("Response Code: " + str(response.status_code))
if response.status_code == 200:
out = open("results/" + try_id + ".json", "w+", encoding="utf-8")
out = open("responses/" + try_id + ".json", "w", encoding="utf-8")
out.write(response.text)
out.close()
except Exception as ex:

View File

@ -25,7 +25,7 @@
"consistencyTokenJars": []
}
},
"videoId": "d-u_7WV1Yl8",
"videoId": "xcJtL7QggTI",
"playbackContext": {
"contentPlaybackContext": {
"currentUrl": "/watch?v=7t0SqerlBA0",