Add support for changing signature param

This commit is contained in:
Omar Roth
2019-02-22 20:36:16 -06:00
parent bdc9196b4a
commit 7f75a7ca0b
2 changed files with 12 additions and 10 deletions

View File

@@ -286,10 +286,8 @@ class Video
end
end
if streams[0]? && streams[0]["s"]?
streams.each do |fmt|
fmt["url"] += "&signature=" + decrypt_signature(fmt["s"], decrypt_function)
end
streams.each do |fmt|
fmt["url"] += decrypt_signature(fmt, decrypt_function)
end
return streams
@@ -381,10 +379,8 @@ class Video
end
end
if adaptive_fmts[0]? && adaptive_fmts[0]["s"]?
adaptive_fmts.each do |fmt|
fmt["url"] += "&signature=" + decrypt_signature(fmt["s"], decrypt_function)
end
adaptive_fmts.each do |fmt|
fmt["url"] += decrypt_signature(fmt, decrypt_function)
end
return adaptive_fmts