replace url by signatureCipher if url is not present

This commit is contained in:
Fijxu 2025-06-12 16:18:01 -04:00
parent 0c96e0977f
commit b1e7e0c45e
No known key found for this signature in database
GPG Key ID: 32C1DDF333EDA6A4

View File

@ -146,6 +146,9 @@ def extract_video_info(video_id : String)
if streaming_data = player_response["streamingData"]?
%w[formats adaptiveFormats].each do |key|
streaming_data.as_h[key]?.try &.as_a.each do |format|
if format.as_h["url"].nil?
format.as_h["url"] = format.as_h["signatureCipher"]
end
format.as_h["url"] = JSON::Any.new(convert_url(format))
end
end