mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Fix embed extractor for age-gated videos
This commit is contained in:
parent
4865529fed
commit
0c8dff162d
1 changed files with 4 additions and 1 deletions
|
@ -636,7 +636,10 @@ def fetch_video(id, proxies, region)
|
|||
|
||||
# Try to pull streams from embed URL
|
||||
if info["reason"]?
|
||||
embed_info = HTTP::Params.parse(client.get("/get_video_info?video_id=#{id}&ps=default&eurl=&gl=US&hl=en&disable_polymer=1").body)
|
||||
embed_page = client.get("/embed/#{id}").body
|
||||
sts = embed_page.match(/"sts"\s*:\s*(?<sts>\d+)/).try &.["sts"]?
|
||||
sts ||= ""
|
||||
embed_info = HTTP::Params.parse(client.get("/get_video_info?video_id=#{id}&eurl=https://youtube.googleapis.com/v/#{id}&gl=US&hl=en&disable_polymer=1&sts=#{sts}").body)
|
||||
|
||||
if !embed_info["reason"]?
|
||||
embed_info.each do |key, value|
|
||||
|
|
Loading…
Reference in a new issue