Skip to content

Commit

Permalink
Refresh Client Versions, Improve things, Apply #3
Browse files Browse the repository at this point in the history
  • Loading branch information
zerodytrash committed Sep 18, 2022
1 parent 76e3340 commit 6f7c6b7
Show file tree
Hide file tree
Showing 13 changed files with 661 additions and 432 deletions.
194 changes: 131 additions & 63 deletions README.md

Large diffs are not rendered by default.

27 changes: 17 additions & 10 deletions analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def get_structure_tree(data, depth = 0):
working_clients_output = ""
working_versions = []

video_id = ""

if not os.path.exists('results'):
os.makedirs('results')
Expand All @@ -64,6 +63,12 @@ def get_structure_tree(data, depth = 0):
client_files = [file for file in files if file.startswith(str(client_id) + '_')]
client_files.sort(reverse=True) # highest version first

versions = []
for file_name in client_files:
version = file_name.split("_")[1]
if version not in versions:
versions.append(version)

for client_file in client_files:
response_data_raw = open('responses/' + client_file, 'r', encoding='utf-8').read()
response_data = json.loads(response_data_raw)
Expand All @@ -80,11 +85,6 @@ def get_structure_tree(data, depth = 0):
client_name = response_data_raw.split('&c=')[1].split('&')[0]
except Exception:
continue

try:
video_id = response_data_raw.split('&docid=')[1].split('&')[0]
except Exception:
print("missing doc id (video id)")

working_clients_output += str(client_id) + ";" + client_name + ";" + client_version + "\n"

Expand Down Expand Up @@ -140,6 +140,9 @@ def get_structure_tree(data, depth = 0):
if client_name == "TVHTML5_SIMPLY_EMBEDDED_PLAYER":
extraInfo += "&bull; No Age-restrictions<br>"

if "android" in client_name.lower():
extraInfo += "&bull; Needs [`androidSdkVersion`](#params)<br>"


ignore_attributes = ["videoDetails", "playerConfig", "responseContext", "playabilityStatus", "streamingData", "playbackTracking", "trackingParams", "adPlacements", "playerAds", "adParams", "adBreakParams", "onResponseReceivedEndpoints", "playerSettingsMenuData"]

Expand All @@ -155,13 +158,17 @@ def get_structure_tree(data, depth = 0):

extraInfo += "<details><summary>Show Response</summary>" + get_structure_tree(response_data) +"</details>"

other_versions = ""
if len(versions) > 1:
other_versions = "<br><br><details><summary>All Versions</summary>" + "<br>".join(versions) +"</details>"


markdown += "|ID: *" + str(client_id) + "*<br>" + client_name + "<br>" + client_version + "|" + formats_summary + formatsStr + adaptiveFormatsStr + "|" + extraInfo + "|\n"
markdown += "|ID: *" + str(client_id) + "*<br><b>" + client_name + "</b><br>" + client_version + other_versions + "|" + formats_summary + formatsStr + adaptiveFormatsStr + "|" + extraInfo + "|\n"

break

readme_header = open("templates/readme_header.md", "r").read()
readme_header = readme_header.replace("%videoId%", video_id)
readme_template = open("templates/readme_template.md", "r").read()
readme_template = readme_template.replace("%table%", markdown)

f = open("results/working_clients.md", "w", encoding="utf-8")
f.write(markdown)
Expand All @@ -177,5 +184,5 @@ def get_structure_tree(data, depth = 0):
f.close()

f = open("readme.md", "w", encoding="utf-8")
f.write(readme_header + markdown)
f.write(readme_template)
f.close()
14 changes: 11 additions & 3 deletions innerbrute.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import requests
import os
import time

client_versions = open("payloads/client_versions.txt", "r").readlines()
data_template = open("payloads/post_data.txt", "r").read()
Expand Down Expand Up @@ -54,7 +55,9 @@
if not os.path.exists('responses'):
os.makedirs('responses')

for client_name_id in range(1, 100):
requests_failed = 0

for client_name_id in range(1, 120):
for client_version in client_versions:
client_version = client_version.replace("\n", "").replace("\r", "")
if client_version == "":
Expand All @@ -64,11 +67,13 @@

try_id = str(client_name_id) + "_" + client_version + "_" + str(len(innertube_hosts) - i) + "_" + host["domain"] + "_" + host["key"]

print("Try ClientId: " + str(client_name_id) + " ClientVersion: " + str(client_version) + " @ " + host["domain"])
print("Try ClientId: " + str(client_name_id) + " ClientVersion: " + str(client_version) + " @ " + host["domain"] + " Failed Requests: " + str(requests_failed))

data = data_template.replace("%videoId%", host["video_id"]).replace('%clientName%', str(client_name_id)).replace('%clientVersion%', client_version)

for i in range(0, 2):
headers = host["headers"].copy()

for i in range(0, 4):
try:
response = requests.post("https://" + host["domain"] + "/youtubei/v1/player?key=" + host["key"], data=data, headers=host["headers"], timeout=5)

Expand All @@ -81,4 +86,7 @@

break
except Exception as ex:
if i == 3:
requests_failed += 1
time.sleep(0.5)
print(ex)
100 changes: 50 additions & 50 deletions misc/android_versions.txt
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
7.4.620913-release
57.38.2
100.0.4896.79
8.0.623343-release
63.34.5
105.0.5195.124
3.0.1
7.7
2.12.422490447
8.2
3.8.466520855
1.9
100.0.4896.79
105.0.5195.124
6.3
1.11.0.358
1.8
1.0.421968649
2.4.042
1.0.471963630
2.4.065-3
1.8.2.392356939
11.6.06.433184565-release-armeabi-v7a
2022.03.20.437098296.Release
12.0.06.457705062-release-armeabi-v7a
2022.06.26.459604605.Release
8.5.6.197464524.go
2.41.438904386
2.45.467721145
3.3
27.0.326
4.4.439927113
13.13.7.23.arm
0.1.315561676
2.9.0.365531209.assistantlite.210329
5.00
2022.14.0-439152615-release
8.4.500.429168112.25
3.65.2.438022649
1.22.062.06.90
2.21.261.04.90
122.0.353872967.DR122
9.155.0.2
4.5.470770319
13.33.12.26.arm
0.1.452181178
2.13.0.439234666.armeabi-v7a.release
5.20R2
2022.36.0-472143158-release
8.6.263.471358013.15
3.76.26.471848990
1.22.362.03.90
2.22.154.2.all.alldpi
172.0.466841314.duo.android
9.162.0.2
3.0.208511728
2.48.75.6
3.2.5.164561151-armeabi-v7a
5.22.041.03.30
2.50.25.3
3.3.2.454109171-release-armeabi-v7a
5.22.222.02.90
1.14.220323006
11.23.3
11.48.0801
157.0
2022.03.20.437881873.Release
5.49.0.430730993
2022.08.07.467804210.Release
5.55.0.455383490
1.4.large
1.141.435035767
2020062202
2.143.434517044
52.0.323183643
5.75.0.426435368
5.22.1
2022.01.32371
1.158.462657757
2022082901
2.143.460223562
84.0.463159461
6.6.0.472601992
2022.8.24.0.2
2022.08.36996
8.26.8771-1.T
22.09.20
30.0.20-19
22.33.15
32.3.14-19
1.0.196287551
1.22.062.06.90
1.22.062.06.90
1.22.342.07.90
2.0.0.432514663
26.2.3.381920558
6.32.0.436351116.8-release
2022.02.07.428774713
6.45.0.472354770.1-release
2022.08.08.468275888
11.10.0.305602887
40.0.402967813
1.78.217178463.release
7.7.051
messages.android
10.55.0
1.5.2.242191532
12
1.1.413207646
13
1.1.458567181
6.5.1.12
2.19.1.303051424
2.48.0.377032688.gms
17.11.35
22.09.101
17.35.36
22.35.100
2.10.7.6
3.25.54
7.12.1
4.71.51
6.12.1
4.0.5
7.32.1
5.23.51
6.34.1
4.0.25
93 changes: 45 additions & 48 deletions misc/apple_versions.txt
Original file line number Diff line number Diff line change
@@ -1,55 +1,52 @@
1.27
2.3
206.0
1.51
1.0.150
1.0.42
2.1.65
1.9.40904
1.37
2.4
228.0
1.63
1.0.172
1.0.48
2.1.85
1.9.57601
2.0.648
6.13
86.0.0
1.8
163.0
2.9.1
2.3.18
1.13.7
2.220308.1
1.7.1
2.40.433747733
9.0.43
5.01
2.2022.12201
6.36
96.0.0
1.9
174.1.0
2.10.5
2.3.19
2.220824.1
1.8.0
2.45.468575109
9.1.39
5.24.3
2.2022.36201
0.0.77
1.16.80
1.1
1.19.1
5.5
5.84
22.11.1
7.12.3
79.0.3945.10
2.2022.10204
3.16
4.6.1
1.2022.12202
4.4.4763
22.12.100
3.42.0
1.2022.12202
1.2022.12202
6.7
22.35.1
7.36.1
101.0.4951.27
2.2022.34204
3.17
4.7.2
1.2022.36207
4.5.4945
22.36.102
1.2022.34205
1.2022.36202
3.4
2.20.31
2.50.105
6.12
17.13.3
100.0.4896.77
4.2022.12400
5.50
6.0.220320
7.12.0
3.2.00005
2.57.109
6.35
17.36.4
105.0.5195.129
4.2022.36202
5.60
6.0.220821
7.15.0
2.22.0
6.33.0
5.9.1
22.14
6.44.0
6.0.3
22.33
3.4.0
9.154
8 changes: 6 additions & 2 deletions misc/fetch_android_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

output = open("android_versions.txt", "w")

response = requests.get("https://androidapksfree.com/devapk/google-inc/")
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.33"
}

response = requests.get("https://androidapksfree.com/devapk/google-inc/", headers=headers)

#print(response.text)

Expand All @@ -14,7 +18,7 @@
continue

try:
response_apk = requests.get(apk_link)
response_apk = requests.get(apk_link, headers=headers)
apk_version = response_apk.text.split("latest apk version ")[1].split('"')[0].split(" ")[0].split("_")[0]
print(apk_version)

Expand Down
Loading

0 comments on commit 6f7c6b7

Please sign in to comment.