From 09cace68c240f0f9ea75f7790484eb17e0cbb0cd Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 6 Aug 2020 00:47:37 +0200 Subject: [PATCH] hard web auth. --- youtube_dl/extractor/soundcloud.py | 4 +- youtube_dl/extractor/test.py | 70 ++++++++++++++++++++++++++++-- 2 files changed, 69 insertions(+), 5 deletions(-) diff --git a/youtube_dl/extractor/soundcloud.py b/youtube_dl/extractor/soundcloud.py index 6d124c66e..1b9313fa5 100644 --- a/youtube_dl/extractor/soundcloud.py +++ b/youtube_dl/extractor/soundcloud.py @@ -358,7 +358,7 @@ def _login(self): var g = function(e, t) { return o[e -= 0] }; - e[g("0x9")] = { + e[g("0x9")] = { #e = function 162 initialize: function() { v = window[g("0x5")].now(); var e = function(e) { @@ -381,6 +381,8 @@ def _login(self): }) } ''' + #after shifting the list + #["forEach", "length", "Chrome PDF Plugin", "512", "mozInnerScreenY", "Date", "addEventListener", "Native Client", "424242", "exports", "height", "Widevine Content Decryption Module", "mousemove", "keyup", "1024", "420", "https:", "128", "plugins", "charCodeAt", "4096", "typeof global", "undefined", "now", "msLaunchUri", "screen", "eval", "safari", "navigator", "WebKit built-in PDF", "isTrusted", "touchmove", "webdriver", "__webdriver_script_fn", "Chromium PDF Viewer", "$cdc_asdjflasutopfhvcZLmcfl_", "keydown", "typeof process", "encodeURIComponent", "getAttribute", "document", "unescape", "256", "call", "Chrome PDF Viewer", "_Selenium_IDE_Recorder", "width", "TestUA", "location", "name"] ''' sign: function(e, t, n, o) {e = "tom_heidel@web.de", t = "EXLwg5lHTO2dslU5EePe3xkw0m1h86Cd", n = "0763ed7314c69015fd4a0dc16bbf4b90", o = undefined diff --git a/youtube_dl/extractor/test.py b/youtube_dl/extractor/test.py index 3ec71871d..ae8456892 100644 --- a/youtube_dl/extractor/test.py +++ b/youtube_dl/extractor/test.py @@ -8,10 +8,10 @@ def sign():#, username=_USERNAME, client_id=_CLIENT_ID, key=_KEY): u = 0 #u is actually screenWidth * screenHeight for 1920*1080 = 2073600 mU = 2073600 l = 1024 #1046? - mL = 1046 + mL = 1028 timestamp = millis = int(round(time.time() * 1000)) mTimestamp = timestamp - (timestamp - random.randint(50000, 850000)) #hacky timestamp difference - uTimestamp = random.randint(50000, 850000) + uTimestamp = random.randint(50000, 85000) w = 42 #1049? mW = 1049 b = k = 2 #25? @@ -30,13 +30,15 @@ def sign():#, username=_USERNAME, client_id=_CLIENT_ID, key=_KEY): y = '8' #some kind of version?? r = _USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36" e = _USERNAME = "tom_heidel@web.de" - t = _CLIENT_ID = 'EXLwg5lHTO2dslU5EePe3xkw0m1h86Cd' + t = _CLIENT_ID = 'EXLwg5lHTO2dslU5EePe3xkw0m1h86Cd' #'T5R4kgWS2PRf6lzLyIravUMnKlbIxQag' #'EXLwg5lHTO2dslU5EePe3xkw0m1h86Cd' p = n + y + d + r + e + t + d + n h = p + print(h) + m = 8011470 f = 0 @@ -49,4 +51,64 @@ def sign():#, username=_USERNAME, client_id=_CLIENT_ID, key=_KEY): return out -print(sign()) \ No newline at end of file +#print(sign()) + +def signp(a, i, s, w, u, l, b, k, c, n, r, e, t): + ''' + zero = 0 + i = a = 1 + mA = 33 + u = 0 #u is actually screenWidth * screenHeight for 1920*1080 = 2073600 + mU = 2073600 + l = 1024 #1046? + mL = 1028 + timestamp = millis = int(round(time.time() * 1000)) + mTimestamp = timestamp - (timestamp - random.randint(50000, 850000)) #hacky timestamp difference + uTimestamp = random.randint(50000, 85000) + w = 42 #1049? + mW = 1049 + b = k = 2 #25? + mB = mK = 25 + underscore = 0 #4, 5? + mUnderscore = 5 + ''' + + d = '-'.join([str(mInt) for mInt in [a, i, s, w, u, l, b, k]]) + #d = '-'.join([str(mInt) for mInt in [mA, i, uTimestamp, mW, mU, mL, mB, mK]]) + print(d) + + #c = mUnderscore + + #n = _KEY = '0763ed7314c69015fd4a0dc16bbf4b90' + y = '8' #some kind of version?? + rr = _USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36" + ee = _USERNAME = "tom_heidel@web.de" + tt = _CLIENT_ID = 'EXLwg5lHTO2dslU5EePe3xkw0m1h86Cd' #'T5R4kgWS2PRf6lzLyIravUMnKlbIxQag' #'EXLwg5lHTO2dslU5EePe3xkw0m1h86Cd' + + + p = n + y + d + r + e + t + d + n + + h = p + + print(h) + + m = 8011470 + f = 0 + + for f in range(f, len(h)): + m = (m >> 1) + ((1 & m) << 23) + m += ord(h[f]) + m &= 16777215 + + print(m) + + out = str(y) + ':' + str(d) + ':' + format(m, 'x') + ':' + str(c) + + return out + +print(signp(33, 1, 193702, 748, 2073600, 1046, 2, 2, 4, "0763ed7314c69015fd4a0dc16bbf4b90", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36", "tom_heidel@web.de", "T5R4kgWS2PRf6lzLyIravUMnKlbIxQag")) + +#d = "33-1-193702-748-2073600-1046-2-2" +#p = "0763ed7314c69015fd4a0dc16bbf4b90833-1-193702-748-2073600-1046-2-2Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36tom_heidel@web.deT5R4kgWS2PRf6lzLyIravUMnKlbIxQag33-1-193702-748-2073600-1046-2-20763ed7314c69015fd4a0dc16bbf4b90" + +#sig = "8:33-1-193702-748-2073600-1046-2-2:3bfb60:4" \ No newline at end of file