Fix signature URL regex

pull/1254/head
Omar Roth 4 years ago
parent 529aff3126
commit 83b1d80a5b
No known key found for this signature in database
GPG Key ID: B8254FB7EC3D37F2

@ -190,6 +190,7 @@ def update_decrypt_function
decrypt_function = fetch_decrypt_function decrypt_function = fetch_decrypt_function
yield decrypt_function yield decrypt_function
rescue ex rescue ex
# TODO: Log error
next next
ensure ensure
sleep 1.minute sleep 1.minute

@ -2,7 +2,7 @@ alias SigProc = Proc(Array(String), Int32, Array(String))
def fetch_decrypt_function(id = "CvFH_6DNRCY") def fetch_decrypt_function(id = "CvFH_6DNRCY")
document = YT_POOL.client &.get("/watch?v=#{id}&gl=US&hl=en").body document = YT_POOL.client &.get("/watch?v=#{id}&gl=US&hl=en").body
url = document.match(/src="(?<url>\/yts\/jsbin\/player_ias-[^\/]+\/en_US\/base.js)"/).not_nil!["url"] url = document.match(/src="(?<url>\/s\/player\/[^\/]+\/player_ias[^\/]+\/en_US\/base.js)"/).not_nil!["url"]
player = YT_POOL.client &.get(url).body player = YT_POOL.client &.get(url).body
function_name = player.match(/^(?<name>[^=]+)=function\(\w\){\w=\w\.split\(""\);[^\. ]+\.[^( ]+/m).not_nil!["name"] function_name = player.match(/^(?<name>[^=]+)=function\(\w\){\w=\w\.split\(""\);[^\. ]+\.[^( ]+/m).not_nil!["name"]

Loading…
Cancel
Save